DetachDisk.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 DetachDiskRequest struct {
  21. core.JDCloudRequest
  22. /* 地域ID */
  23. RegionId string `json:"regionId"`
  24. /* 云主机ID */
  25. InstanceId string `json:"instanceId"`
  26. /* 云硬盘ID */
  27. DiskId string `json:"diskId"`
  28. /* 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional) */
  29. Force *bool `json:"force"`
  30. }
  31. /*
  32. * param regionId: 地域ID (Required)
  33. * param instanceId: 云主机ID (Required)
  34. * param diskId: 云硬盘ID (Required)
  35. *
  36. * @Deprecated, not compatible when mandatory parameters changed
  37. */
  38. func NewDetachDiskRequest(
  39. regionId string,
  40. instanceId string,
  41. diskId string,
  42. ) *DetachDiskRequest {
  43. return &DetachDiskRequest{
  44. JDCloudRequest: core.JDCloudRequest{
  45. URL: "/regions/{regionId}/instances/{instanceId}:detachDisk",
  46. Method: "POST",
  47. Header: nil,
  48. Version: "v1",
  49. },
  50. RegionId: regionId,
  51. InstanceId: instanceId,
  52. DiskId: diskId,
  53. }
  54. }
  55. /*
  56. * param regionId: 地域ID (Required)
  57. * param instanceId: 云主机ID (Required)
  58. * param diskId: 云硬盘ID (Required)
  59. * param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional)
  60. */
  61. func NewDetachDiskRequestWithAllParams(
  62. regionId string,
  63. instanceId string,
  64. diskId string,
  65. force *bool,
  66. ) *DetachDiskRequest {
  67. return &DetachDiskRequest{
  68. JDCloudRequest: core.JDCloudRequest{
  69. URL: "/regions/{regionId}/instances/{instanceId}:detachDisk",
  70. Method: "POST",
  71. Header: nil,
  72. Version: "v1",
  73. },
  74. RegionId: regionId,
  75. InstanceId: instanceId,
  76. DiskId: diskId,
  77. Force: force,
  78. }
  79. }
  80. /* This constructor has better compatible ability when API parameters changed */
  81. func NewDetachDiskRequestWithoutParam() *DetachDiskRequest {
  82. return &DetachDiskRequest{
  83. JDCloudRequest: core.JDCloudRequest{
  84. URL: "/regions/{regionId}/instances/{instanceId}:detachDisk",
  85. Method: "POST",
  86. Header: nil,
  87. Version: "v1",
  88. },
  89. }
  90. }
  91. /* param regionId: 地域ID(Required) */
  92. func (r *DetachDiskRequest) SetRegionId(regionId string) {
  93. r.RegionId = regionId
  94. }
  95. /* param instanceId: 云主机ID(Required) */
  96. func (r *DetachDiskRequest) SetInstanceId(instanceId string) {
  97. r.InstanceId = instanceId
  98. }
  99. /* param diskId: 云硬盘ID(Required) */
  100. func (r *DetachDiskRequest) SetDiskId(diskId string) {
  101. r.DiskId = diskId
  102. }
  103. /* param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。(Optional) */
  104. func (r *DetachDiskRequest) SetForce(force bool) {
  105. r.Force = &force
  106. }
  107. // GetRegionId returns path parameter 'regionId' if exist,
  108. // otherwise return empty string
  109. func (r DetachDiskRequest) GetRegionId() string {
  110. return r.RegionId
  111. }
  112. type DetachDiskResponse struct {
  113. RequestID string `json:"requestId"`
  114. Error core.ErrorResponse `json:"error"`
  115. Result DetachDiskResult `json:"result"`
  116. }
  117. type DetachDiskResult struct {
  118. }