DescribeInstancesCustomData.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // Copyright 2018 JDCLOUD.COM
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // NOTE: This class is auto generated by the jdcloud code generator program.
  16. package apis
  17. import (
  18. "github.com/jdcloud-api/jdcloud-sdk-go/core"
  19. vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models"
  20. common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models"
  21. )
  22. type DescribeInstancesCustomDataRequest struct {
  23. core.JDCloudRequest
  24. /* 地域ID */
  25. RegionId string `json:"regionId"`
  26. /* 页码;默认为1 (Optional) */
  27. PageNumber *int `json:"pageNumber"`
  28. /* 分页大小;默认为10;取值范围[1, 10] (Optional) */
  29. PageSize *int `json:"pageSize"`
  30. /* instanceId - 云主机ID,精确匹配,支持多个
  31. privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个
  32. vpcId - 私有网络ID,精确匹配,支持多个
  33. status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a>
  34. imageId - 镜像ID,精确匹配,支持多个
  35. networkInterfaceId - 弹性网卡ID,精确匹配,支持多个
  36. subnetId - 子网ID,精确匹配,支持多个
  37. (Optional) */
  38. Filters []common.Filter `json:"filters"`
  39. }
  40. /*
  41. * param regionId: 地域ID (Required)
  42. *
  43. * @Deprecated, not compatible when mandatory parameters changed
  44. */
  45. func NewDescribeInstancesCustomDataRequest(
  46. regionId string,
  47. ) *DescribeInstancesCustomDataRequest {
  48. return &DescribeInstancesCustomDataRequest{
  49. JDCloudRequest: core.JDCloudRequest{
  50. URL: "/regions/{regionId}/instancesCustomData",
  51. Method: "GET",
  52. Header: nil,
  53. Version: "v1",
  54. },
  55. RegionId: regionId,
  56. }
  57. }
  58. /*
  59. * param regionId: 地域ID (Required)
  60. * param pageNumber: 页码;默认为1 (Optional)
  61. * param pageSize: 分页大小;默认为10;取值范围[1, 10] (Optional)
  62. * param filters: instanceId - 云主机ID,精确匹配,支持多个
  63. privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个
  64. vpcId - 私有网络ID,精确匹配,支持多个
  65. status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a>
  66. imageId - 镜像ID,精确匹配,支持多个
  67. networkInterfaceId - 弹性网卡ID,精确匹配,支持多个
  68. subnetId - 子网ID,精确匹配,支持多个
  69. (Optional)
  70. */
  71. func NewDescribeInstancesCustomDataRequestWithAllParams(
  72. regionId string,
  73. pageNumber *int,
  74. pageSize *int,
  75. filters []common.Filter,
  76. ) *DescribeInstancesCustomDataRequest {
  77. return &DescribeInstancesCustomDataRequest{
  78. JDCloudRequest: core.JDCloudRequest{
  79. URL: "/regions/{regionId}/instancesCustomData",
  80. Method: "GET",
  81. Header: nil,
  82. Version: "v1",
  83. },
  84. RegionId: regionId,
  85. PageNumber: pageNumber,
  86. PageSize: pageSize,
  87. Filters: filters,
  88. }
  89. }
  90. /* This constructor has better compatible ability when API parameters changed */
  91. func NewDescribeInstancesCustomDataRequestWithoutParam() *DescribeInstancesCustomDataRequest {
  92. return &DescribeInstancesCustomDataRequest{
  93. JDCloudRequest: core.JDCloudRequest{
  94. URL: "/regions/{regionId}/instancesCustomData",
  95. Method: "GET",
  96. Header: nil,
  97. Version: "v1",
  98. },
  99. }
  100. }
  101. /* param regionId: 地域ID(Required) */
  102. func (r *DescribeInstancesCustomDataRequest) SetRegionId(regionId string) {
  103. r.RegionId = regionId
  104. }
  105. /* param pageNumber: 页码;默认为1(Optional) */
  106. func (r *DescribeInstancesCustomDataRequest) SetPageNumber(pageNumber int) {
  107. r.PageNumber = &pageNumber
  108. }
  109. /* param pageSize: 分页大小;默认为10;取值范围[1, 10](Optional) */
  110. func (r *DescribeInstancesCustomDataRequest) SetPageSize(pageSize int) {
  111. r.PageSize = &pageSize
  112. }
  113. /* param filters: instanceId - 云主机ID,精确匹配,支持多个
  114. privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个
  115. vpcId - 私有网络ID,精确匹配,支持多个
  116. status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a>
  117. imageId - 镜像ID,精确匹配,支持多个
  118. networkInterfaceId - 弹性网卡ID,精确匹配,支持多个
  119. subnetId - 子网ID,精确匹配,支持多个
  120. (Optional) */
  121. func (r *DescribeInstancesCustomDataRequest) SetFilters(filters []common.Filter) {
  122. r.Filters = filters
  123. }
  124. // GetRegionId returns path parameter 'regionId' if exist,
  125. // otherwise return empty string
  126. func (r DescribeInstancesCustomDataRequest) GetRegionId() string {
  127. return r.RegionId
  128. }
  129. type DescribeInstancesCustomDataResponse struct {
  130. RequestID string `json:"requestId"`
  131. Error core.ErrorResponse `json:"error"`
  132. Result DescribeInstancesCustomDataResult `json:"result"`
  133. }
  134. type DescribeInstancesCustomDataResult struct {
  135. CustomData []vm.CustomData `json:"customData"`
  136. TotalCount int `json:"totalCount"`
  137. }