RebootInstance.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. )
  20. type RebootInstanceRequest struct {
  21. core.JDCloudRequest
  22. /* 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) */
  23. RegionId string `json:"regionId"`
  24. /* RDS 实例ID,唯一标识一个RDS实例 */
  25. InstanceId string `json:"instanceId"`
  26. /* 是否重启主节点。<br> - 仅SQL Server 支持该参数 (Optional) */
  27. RebootMaster *bool `json:"rebootMaster"`
  28. /* 是否重启备节点。<br> - 仅SQL Server 支持该参数 (Optional) */
  29. RebootSlave *bool `json:"rebootSlave"`
  30. }
  31. /*
  32. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  33. * param instanceId: RDS 实例ID,唯一标识一个RDS实例 (Required)
  34. *
  35. * @Deprecated, not compatible when mandatory parameters changed
  36. */
  37. func NewRebootInstanceRequest(
  38. regionId string,
  39. instanceId string,
  40. ) *RebootInstanceRequest {
  41. return &RebootInstanceRequest{
  42. JDCloudRequest: core.JDCloudRequest{
  43. URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance",
  44. Method: "POST",
  45. Header: nil,
  46. Version: "v1",
  47. },
  48. RegionId: regionId,
  49. InstanceId: instanceId,
  50. }
  51. }
  52. /*
  53. * param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md) (Required)
  54. * param instanceId: RDS 实例ID,唯一标识一个RDS实例 (Required)
  55. * param rebootMaster: 是否重启主节点。<br> - 仅SQL Server 支持该参数 (Optional)
  56. * param rebootSlave: 是否重启备节点。<br> - 仅SQL Server 支持该参数 (Optional)
  57. */
  58. func NewRebootInstanceRequestWithAllParams(
  59. regionId string,
  60. instanceId string,
  61. rebootMaster *bool,
  62. rebootSlave *bool,
  63. ) *RebootInstanceRequest {
  64. return &RebootInstanceRequest{
  65. JDCloudRequest: core.JDCloudRequest{
  66. URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance",
  67. Method: "POST",
  68. Header: nil,
  69. Version: "v1",
  70. },
  71. RegionId: regionId,
  72. InstanceId: instanceId,
  73. RebootMaster: rebootMaster,
  74. RebootSlave: rebootSlave,
  75. }
  76. }
  77. /* This constructor has better compatible ability when API parameters changed */
  78. func NewRebootInstanceRequestWithoutParam() *RebootInstanceRequest {
  79. return &RebootInstanceRequest{
  80. JDCloudRequest: core.JDCloudRequest{
  81. URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance",
  82. Method: "POST",
  83. Header: nil,
  84. Version: "v1",
  85. },
  86. }
  87. }
  88. /* param regionId: 地域代码,取值范围参见[《各地域及可用区对照表》](../Enum-Definitions/Regions-AZ.md)(Required) */
  89. func (r *RebootInstanceRequest) SetRegionId(regionId string) {
  90. r.RegionId = regionId
  91. }
  92. /* param instanceId: RDS 实例ID,唯一标识一个RDS实例(Required) */
  93. func (r *RebootInstanceRequest) SetInstanceId(instanceId string) {
  94. r.InstanceId = instanceId
  95. }
  96. /* param rebootMaster: 是否重启主节点。<br> - 仅SQL Server 支持该参数(Optional) */
  97. func (r *RebootInstanceRequest) SetRebootMaster(rebootMaster bool) {
  98. r.RebootMaster = &rebootMaster
  99. }
  100. /* param rebootSlave: 是否重启备节点。<br> - 仅SQL Server 支持该参数(Optional) */
  101. func (r *RebootInstanceRequest) SetRebootSlave(rebootSlave bool) {
  102. r.RebootSlave = &rebootSlave
  103. }
  104. // GetRegionId returns path parameter 'regionId' if exist,
  105. // otherwise return empty string
  106. func (r RebootInstanceRequest) GetRegionId() string {
  107. return r.RegionId
  108. }
  109. type RebootInstanceResponse struct {
  110. RequestID string `json:"requestId"`
  111. Error core.ErrorResponse `json:"error"`
  112. Result RebootInstanceResult `json:"result"`
  113. }
  114. type RebootInstanceResult struct {
  115. }