tencentcloud-sdk-cvm 1.0.199
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-cvm.rb +11 -0
- data/lib/v20170312/client.rb +1908 -0
- data/lib/v20170312/models.rb +5952 -0
- metadata +66 -0
|
@@ -0,0 +1,1908 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
|
4
|
+
#
|
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
# you may not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
# See the License for the specific language governing permissions and
|
|
15
|
+
# limitations under the License.
|
|
16
|
+
|
|
17
|
+
require 'json'
|
|
18
|
+
|
|
19
|
+
module TencentCloud
|
|
20
|
+
module Cvm
|
|
21
|
+
module V20170312
|
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
|
23
|
+
|
|
24
|
+
def initialize(credential, region, profile = nil)
|
|
25
|
+
api_version = '2017-03-12'
|
|
26
|
+
api_endpoint = 'cvm.tencentcloudapi.com'
|
|
27
|
+
sdk_version = 'CVM_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# 本接口 (AllocateHosts) 用于创建一个或多个指定配置的CDH实例。
|
|
33
|
+
# * 当HostChargeType为PREPAID时,必须指定HostChargePrepaid参数。
|
|
34
|
+
|
|
35
|
+
# @param request: Request instance for AllocateHosts.
|
|
36
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::AllocateHostsRequest`
|
|
37
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::AllocateHostsResponse`
|
|
38
|
+
def AllocateHosts(request)
|
|
39
|
+
body = send_request('AllocateHosts', request.serialize)
|
|
40
|
+
response = JSON.parse(body)
|
|
41
|
+
if response['Response'].key?('Error') == false
|
|
42
|
+
model = AllocateHostsResponse.new
|
|
43
|
+
model.deserialize(response['Response'])
|
|
44
|
+
model
|
|
45
|
+
else
|
|
46
|
+
code = response['Response']['Error']['Code']
|
|
47
|
+
message = response['Response']['Error']['Message']
|
|
48
|
+
reqid = response['Response']['RequestId']
|
|
49
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
50
|
+
end
|
|
51
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
52
|
+
raise e
|
|
53
|
+
rescue StandardError => e
|
|
54
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# 本接口 (AssociateInstancesKeyPairs) 用于将密钥绑定到实例上。
|
|
58
|
+
|
|
59
|
+
# * 将密钥的公钥写入到实例的`SSH`配置当中,用户就可以通过该密钥的私钥来登录实例。
|
|
60
|
+
# * 如果实例原来绑定过密钥,那么原来的密钥将失效。
|
|
61
|
+
# * 如果实例原来是通过密码登录,绑定密钥后无法使用密码登录。
|
|
62
|
+
# * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。
|
|
63
|
+
|
|
64
|
+
# @param request: Request instance for AssociateInstancesKeyPairs.
|
|
65
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::AssociateInstancesKeyPairsRequest`
|
|
66
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::AssociateInstancesKeyPairsResponse`
|
|
67
|
+
def AssociateInstancesKeyPairs(request)
|
|
68
|
+
body = send_request('AssociateInstancesKeyPairs', request.serialize)
|
|
69
|
+
response = JSON.parse(body)
|
|
70
|
+
if response['Response'].key?('Error') == false
|
|
71
|
+
model = AssociateInstancesKeyPairsResponse.new
|
|
72
|
+
model.deserialize(response['Response'])
|
|
73
|
+
model
|
|
74
|
+
else
|
|
75
|
+
code = response['Response']['Error']['Code']
|
|
76
|
+
message = response['Response']['Error']['Message']
|
|
77
|
+
reqid = response['Response']['RequestId']
|
|
78
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
79
|
+
end
|
|
80
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
81
|
+
raise e
|
|
82
|
+
rescue StandardError => e
|
|
83
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# 本接口 (AssociateSecurityGroups) 用于绑定安全组到指定实例。
|
|
87
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
88
|
+
|
|
89
|
+
# @param request: Request instance for AssociateSecurityGroups.
|
|
90
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::AssociateSecurityGroupsRequest`
|
|
91
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::AssociateSecurityGroupsResponse`
|
|
92
|
+
def AssociateSecurityGroups(request)
|
|
93
|
+
body = send_request('AssociateSecurityGroups', request.serialize)
|
|
94
|
+
response = JSON.parse(body)
|
|
95
|
+
if response['Response'].key?('Error') == false
|
|
96
|
+
model = AssociateSecurityGroupsResponse.new
|
|
97
|
+
model.deserialize(response['Response'])
|
|
98
|
+
model
|
|
99
|
+
else
|
|
100
|
+
code = response['Response']['Error']['Code']
|
|
101
|
+
message = response['Response']['Error']['Message']
|
|
102
|
+
reqid = response['Response']['RequestId']
|
|
103
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
104
|
+
end
|
|
105
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
106
|
+
raise e
|
|
107
|
+
rescue StandardError => e
|
|
108
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# 本接口 (CreateDisasterRecoverGroup)用于创建[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。创建好的置放群组,可在[创建实例](https://cloud.tencent.com/document/api/213/15730)时指定。
|
|
112
|
+
|
|
113
|
+
# @param request: Request instance for CreateDisasterRecoverGroup.
|
|
114
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::CreateDisasterRecoverGroupRequest`
|
|
115
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::CreateDisasterRecoverGroupResponse`
|
|
116
|
+
def CreateDisasterRecoverGroup(request)
|
|
117
|
+
body = send_request('CreateDisasterRecoverGroup', request.serialize)
|
|
118
|
+
response = JSON.parse(body)
|
|
119
|
+
if response['Response'].key?('Error') == false
|
|
120
|
+
model = CreateDisasterRecoverGroupResponse.new
|
|
121
|
+
model.deserialize(response['Response'])
|
|
122
|
+
model
|
|
123
|
+
else
|
|
124
|
+
code = response['Response']['Error']['Code']
|
|
125
|
+
message = response['Response']['Error']['Message']
|
|
126
|
+
reqid = response['Response']['RequestId']
|
|
127
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
128
|
+
end
|
|
129
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
130
|
+
raise e
|
|
131
|
+
rescue StandardError => e
|
|
132
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# 本接口(CreateImage)用于将实例的系统盘制作为新镜像,创建后的镜像可以用于创建实例。
|
|
136
|
+
|
|
137
|
+
# @param request: Request instance for CreateImage.
|
|
138
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::CreateImageRequest`
|
|
139
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::CreateImageResponse`
|
|
140
|
+
def CreateImage(request)
|
|
141
|
+
body = send_request('CreateImage', request.serialize)
|
|
142
|
+
response = JSON.parse(body)
|
|
143
|
+
if response['Response'].key?('Error') == false
|
|
144
|
+
model = CreateImageResponse.new
|
|
145
|
+
model.deserialize(response['Response'])
|
|
146
|
+
model
|
|
147
|
+
else
|
|
148
|
+
code = response['Response']['Error']['Code']
|
|
149
|
+
message = response['Response']['Error']['Message']
|
|
150
|
+
reqid = response['Response']['RequestId']
|
|
151
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
152
|
+
end
|
|
153
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
154
|
+
raise e
|
|
155
|
+
rescue StandardError => e
|
|
156
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# 本接口 (CreateKeyPair) 用于创建一个 `OpenSSH RSA` 密钥对,可以用于登录 `Linux` 实例。
|
|
160
|
+
|
|
161
|
+
# * 开发者只需指定密钥对名称,即可由系统自动创建密钥对,并返回所生成的密钥对的 `ID` 及其公钥、私钥的内容。
|
|
162
|
+
# * 密钥对名称不能和已经存在的密钥对的名称重复。
|
|
163
|
+
# * 私钥的内容可以保存到文件中作为 `SSH` 的一种认证方式。
|
|
164
|
+
# * 腾讯云不会保存用户的私钥,请妥善保管。
|
|
165
|
+
|
|
166
|
+
# @param request: Request instance for CreateKeyPair.
|
|
167
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::CreateKeyPairRequest`
|
|
168
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::CreateKeyPairResponse`
|
|
169
|
+
def CreateKeyPair(request)
|
|
170
|
+
body = send_request('CreateKeyPair', request.serialize)
|
|
171
|
+
response = JSON.parse(body)
|
|
172
|
+
if response['Response'].key?('Error') == false
|
|
173
|
+
model = CreateKeyPairResponse.new
|
|
174
|
+
model.deserialize(response['Response'])
|
|
175
|
+
model
|
|
176
|
+
else
|
|
177
|
+
code = response['Response']['Error']['Code']
|
|
178
|
+
message = response['Response']['Error']['Message']
|
|
179
|
+
reqid = response['Response']['RequestId']
|
|
180
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
181
|
+
end
|
|
182
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
183
|
+
raise e
|
|
184
|
+
rescue StandardError => e
|
|
185
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# 本接口 (DeleteDisasterRecoverGroups)用于删除[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。只有空的置放群组才能被删除,非空的群组需要先销毁组内所有云服务器,才能执行删除操作,不然会产生删除置放群组失败的错误。
|
|
189
|
+
|
|
190
|
+
# @param request: Request instance for DeleteDisasterRecoverGroups.
|
|
191
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DeleteDisasterRecoverGroupsRequest`
|
|
192
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DeleteDisasterRecoverGroupsResponse`
|
|
193
|
+
def DeleteDisasterRecoverGroups(request)
|
|
194
|
+
body = send_request('DeleteDisasterRecoverGroups', request.serialize)
|
|
195
|
+
response = JSON.parse(body)
|
|
196
|
+
if response['Response'].key?('Error') == false
|
|
197
|
+
model = DeleteDisasterRecoverGroupsResponse.new
|
|
198
|
+
model.deserialize(response['Response'])
|
|
199
|
+
model
|
|
200
|
+
else
|
|
201
|
+
code = response['Response']['Error']['Code']
|
|
202
|
+
message = response['Response']['Error']['Message']
|
|
203
|
+
reqid = response['Response']['RequestId']
|
|
204
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
205
|
+
end
|
|
206
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
207
|
+
raise e
|
|
208
|
+
rescue StandardError => e
|
|
209
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# 本接口(DeleteImages)用于删除一个或多个镜像。
|
|
213
|
+
|
|
214
|
+
# * 当[镜像状态](https://cloud.tencent.com/document/product/213/15753#Image)为`创建中`和`使用中`时, 不允许删除。镜像状态可以通过[DescribeImages](https://cloud.tencent.com/document/api/213/9418)获取。
|
|
215
|
+
# * 每个地域最多只支持创建10个自定义镜像,删除镜像可以释放账户的配额。
|
|
216
|
+
# * 当镜像正在被其它账户分享时,不允许删除。
|
|
217
|
+
|
|
218
|
+
# @param request: Request instance for DeleteImages.
|
|
219
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DeleteImagesRequest`
|
|
220
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DeleteImagesResponse`
|
|
221
|
+
def DeleteImages(request)
|
|
222
|
+
body = send_request('DeleteImages', request.serialize)
|
|
223
|
+
response = JSON.parse(body)
|
|
224
|
+
if response['Response'].key?('Error') == false
|
|
225
|
+
model = DeleteImagesResponse.new
|
|
226
|
+
model.deserialize(response['Response'])
|
|
227
|
+
model
|
|
228
|
+
else
|
|
229
|
+
code = response['Response']['Error']['Code']
|
|
230
|
+
message = response['Response']['Error']['Message']
|
|
231
|
+
reqid = response['Response']['RequestId']
|
|
232
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
233
|
+
end
|
|
234
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
235
|
+
raise e
|
|
236
|
+
rescue StandardError => e
|
|
237
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# 本接口 (DeleteKeyPairs) 用于删除已在腾讯云托管的密钥对。
|
|
241
|
+
|
|
242
|
+
# * 可以同时删除多个密钥对。
|
|
243
|
+
# * 不能删除已被实例或镜像引用的密钥对,所以需要独立判断是否所有密钥对都被成功删除。
|
|
244
|
+
|
|
245
|
+
# @param request: Request instance for DeleteKeyPairs.
|
|
246
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DeleteKeyPairsRequest`
|
|
247
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DeleteKeyPairsResponse`
|
|
248
|
+
def DeleteKeyPairs(request)
|
|
249
|
+
body = send_request('DeleteKeyPairs', request.serialize)
|
|
250
|
+
response = JSON.parse(body)
|
|
251
|
+
if response['Response'].key?('Error') == false
|
|
252
|
+
model = DeleteKeyPairsResponse.new
|
|
253
|
+
model.deserialize(response['Response'])
|
|
254
|
+
model
|
|
255
|
+
else
|
|
256
|
+
code = response['Response']['Error']['Code']
|
|
257
|
+
message = response['Response']['Error']['Message']
|
|
258
|
+
reqid = response['Response']['RequestId']
|
|
259
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
260
|
+
end
|
|
261
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
262
|
+
raise e
|
|
263
|
+
rescue StandardError => e
|
|
264
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# 本接口(DescribeAccountQuota)用于查询用户配额详情。
|
|
268
|
+
|
|
269
|
+
# @param request: Request instance for DescribeAccountQuota.
|
|
270
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeAccountQuotaRequest`
|
|
271
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeAccountQuotaResponse`
|
|
272
|
+
def DescribeAccountQuota(request)
|
|
273
|
+
body = send_request('DescribeAccountQuota', request.serialize)
|
|
274
|
+
response = JSON.parse(body)
|
|
275
|
+
if response['Response'].key?('Error') == false
|
|
276
|
+
model = DescribeAccountQuotaResponse.new
|
|
277
|
+
model.deserialize(response['Response'])
|
|
278
|
+
model
|
|
279
|
+
else
|
|
280
|
+
code = response['Response']['Error']['Code']
|
|
281
|
+
message = response['Response']['Error']['Message']
|
|
282
|
+
reqid = response['Response']['RequestId']
|
|
283
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
284
|
+
end
|
|
285
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
286
|
+
raise e
|
|
287
|
+
rescue StandardError => e
|
|
288
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# 本接口 (DescribeDisasterRecoverGroupQuota)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)配额。
|
|
292
|
+
|
|
293
|
+
# @param request: Request instance for DescribeDisasterRecoverGroupQuota.
|
|
294
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeDisasterRecoverGroupQuotaRequest`
|
|
295
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeDisasterRecoverGroupQuotaResponse`
|
|
296
|
+
def DescribeDisasterRecoverGroupQuota(request)
|
|
297
|
+
body = send_request('DescribeDisasterRecoverGroupQuota', request.serialize)
|
|
298
|
+
response = JSON.parse(body)
|
|
299
|
+
if response['Response'].key?('Error') == false
|
|
300
|
+
model = DescribeDisasterRecoverGroupQuotaResponse.new
|
|
301
|
+
model.deserialize(response['Response'])
|
|
302
|
+
model
|
|
303
|
+
else
|
|
304
|
+
code = response['Response']['Error']['Code']
|
|
305
|
+
message = response['Response']['Error']['Message']
|
|
306
|
+
reqid = response['Response']['RequestId']
|
|
307
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
308
|
+
end
|
|
309
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
310
|
+
raise e
|
|
311
|
+
rescue StandardError => e
|
|
312
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
# 本接口 (DescribeDisasterRecoverGroups)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)信息。
|
|
316
|
+
|
|
317
|
+
# @param request: Request instance for DescribeDisasterRecoverGroups.
|
|
318
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeDisasterRecoverGroupsRequest`
|
|
319
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeDisasterRecoverGroupsResponse`
|
|
320
|
+
def DescribeDisasterRecoverGroups(request)
|
|
321
|
+
body = send_request('DescribeDisasterRecoverGroups', request.serialize)
|
|
322
|
+
response = JSON.parse(body)
|
|
323
|
+
if response['Response'].key?('Error') == false
|
|
324
|
+
model = DescribeDisasterRecoverGroupsResponse.new
|
|
325
|
+
model.deserialize(response['Response'])
|
|
326
|
+
model
|
|
327
|
+
else
|
|
328
|
+
code = response['Response']['Error']['Code']
|
|
329
|
+
message = response['Response']['Error']['Message']
|
|
330
|
+
reqid = response['Response']['RequestId']
|
|
331
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
332
|
+
end
|
|
333
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
334
|
+
raise e
|
|
335
|
+
rescue StandardError => e
|
|
336
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# 本接口 (DescribeHosts) 用于获取一个或多个CDH实例的详细信息。
|
|
340
|
+
|
|
341
|
+
# @param request: Request instance for DescribeHosts.
|
|
342
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeHostsRequest`
|
|
343
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeHostsResponse`
|
|
344
|
+
def DescribeHosts(request)
|
|
345
|
+
body = send_request('DescribeHosts', request.serialize)
|
|
346
|
+
response = JSON.parse(body)
|
|
347
|
+
if response['Response'].key?('Error') == false
|
|
348
|
+
model = DescribeHostsResponse.new
|
|
349
|
+
model.deserialize(response['Response'])
|
|
350
|
+
model
|
|
351
|
+
else
|
|
352
|
+
code = response['Response']['Error']['Code']
|
|
353
|
+
message = response['Response']['Error']['Message']
|
|
354
|
+
reqid = response['Response']['RequestId']
|
|
355
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
356
|
+
end
|
|
357
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
358
|
+
raise e
|
|
359
|
+
rescue StandardError => e
|
|
360
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# 本接口(DescribeImageQuota)用于查询用户帐号的镜像配额。
|
|
364
|
+
|
|
365
|
+
# @param request: Request instance for DescribeImageQuota.
|
|
366
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeImageQuotaRequest`
|
|
367
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeImageQuotaResponse`
|
|
368
|
+
def DescribeImageQuota(request)
|
|
369
|
+
body = send_request('DescribeImageQuota', request.serialize)
|
|
370
|
+
response = JSON.parse(body)
|
|
371
|
+
if response['Response'].key?('Error') == false
|
|
372
|
+
model = DescribeImageQuotaResponse.new
|
|
373
|
+
model.deserialize(response['Response'])
|
|
374
|
+
model
|
|
375
|
+
else
|
|
376
|
+
code = response['Response']['Error']['Code']
|
|
377
|
+
message = response['Response']['Error']['Message']
|
|
378
|
+
reqid = response['Response']['RequestId']
|
|
379
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
380
|
+
end
|
|
381
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
382
|
+
raise e
|
|
383
|
+
rescue StandardError => e
|
|
384
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# 本接口(DescribeImageSharePermission)用于查询镜像分享信息。
|
|
388
|
+
|
|
389
|
+
# @param request: Request instance for DescribeImageSharePermission.
|
|
390
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeImageSharePermissionRequest`
|
|
391
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeImageSharePermissionResponse`
|
|
392
|
+
def DescribeImageSharePermission(request)
|
|
393
|
+
body = send_request('DescribeImageSharePermission', request.serialize)
|
|
394
|
+
response = JSON.parse(body)
|
|
395
|
+
if response['Response'].key?('Error') == false
|
|
396
|
+
model = DescribeImageSharePermissionResponse.new
|
|
397
|
+
model.deserialize(response['Response'])
|
|
398
|
+
model
|
|
399
|
+
else
|
|
400
|
+
code = response['Response']['Error']['Code']
|
|
401
|
+
message = response['Response']['Error']['Message']
|
|
402
|
+
reqid = response['Response']['RequestId']
|
|
403
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
404
|
+
end
|
|
405
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
406
|
+
raise e
|
|
407
|
+
rescue StandardError => e
|
|
408
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# 本接口(DescribeImages) 用于查看镜像列表。
|
|
412
|
+
|
|
413
|
+
# * 可以通过指定镜像ID来查询指定镜像的详细信息,或通过设定过滤器来查询满足过滤条件的镜像的详细信息。
|
|
414
|
+
# * 指定偏移(Offset)和限制(Limit)来选择结果中的一部分,默认返回满足条件的前20个镜像信息。
|
|
415
|
+
|
|
416
|
+
# @param request: Request instance for DescribeImages.
|
|
417
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeImagesRequest`
|
|
418
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeImagesResponse`
|
|
419
|
+
def DescribeImages(request)
|
|
420
|
+
body = send_request('DescribeImages', request.serialize)
|
|
421
|
+
response = JSON.parse(body)
|
|
422
|
+
if response['Response'].key?('Error') == false
|
|
423
|
+
model = DescribeImagesResponse.new
|
|
424
|
+
model.deserialize(response['Response'])
|
|
425
|
+
model
|
|
426
|
+
else
|
|
427
|
+
code = response['Response']['Error']['Code']
|
|
428
|
+
message = response['Response']['Error']['Message']
|
|
429
|
+
reqid = response['Response']['RequestId']
|
|
430
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
431
|
+
end
|
|
432
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
433
|
+
raise e
|
|
434
|
+
rescue StandardError => e
|
|
435
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# 查看可以导入的镜像操作系统信息。
|
|
439
|
+
|
|
440
|
+
# @param request: Request instance for DescribeImportImageOs.
|
|
441
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeImportImageOsRequest`
|
|
442
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeImportImageOsResponse`
|
|
443
|
+
def DescribeImportImageOs(request)
|
|
444
|
+
body = send_request('DescribeImportImageOs', request.serialize)
|
|
445
|
+
response = JSON.parse(body)
|
|
446
|
+
if response['Response'].key?('Error') == false
|
|
447
|
+
model = DescribeImportImageOsResponse.new
|
|
448
|
+
model.deserialize(response['Response'])
|
|
449
|
+
model
|
|
450
|
+
else
|
|
451
|
+
code = response['Response']['Error']['Code']
|
|
452
|
+
message = response['Response']['Error']['Message']
|
|
453
|
+
reqid = response['Response']['RequestId']
|
|
454
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
455
|
+
end
|
|
456
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
457
|
+
raise e
|
|
458
|
+
rescue StandardError => e
|
|
459
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
# 本接口(DescribeInstanceFamilyConfigs)查询当前用户和地域所支持的机型族列表信息。
|
|
463
|
+
|
|
464
|
+
# @param request: Request instance for DescribeInstanceFamilyConfigs.
|
|
465
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceFamilyConfigsRequest`
|
|
466
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceFamilyConfigsResponse`
|
|
467
|
+
def DescribeInstanceFamilyConfigs(request)
|
|
468
|
+
body = send_request('DescribeInstanceFamilyConfigs', request.serialize)
|
|
469
|
+
response = JSON.parse(body)
|
|
470
|
+
if response['Response'].key?('Error') == false
|
|
471
|
+
model = DescribeInstanceFamilyConfigsResponse.new
|
|
472
|
+
model.deserialize(response['Response'])
|
|
473
|
+
model
|
|
474
|
+
else
|
|
475
|
+
code = response['Response']['Error']['Code']
|
|
476
|
+
message = response['Response']['Error']['Message']
|
|
477
|
+
reqid = response['Response']['RequestId']
|
|
478
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
479
|
+
end
|
|
480
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
481
|
+
raise e
|
|
482
|
+
rescue StandardError => e
|
|
483
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
# 本接口 (DescribeInstanceInternetBandwidthConfigs) 用于查询实例带宽配置。
|
|
487
|
+
|
|
488
|
+
# * 只支持查询`BANDWIDTH_PREPAID`( 预付费按带宽结算 )计费模式的带宽配置。
|
|
489
|
+
# * 接口返回实例的所有带宽配置信息(包含历史的带宽配置信息)。
|
|
490
|
+
|
|
491
|
+
# @param request: Request instance for DescribeInstanceInternetBandwidthConfigs.
|
|
492
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceInternetBandwidthConfigsRequest`
|
|
493
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceInternetBandwidthConfigsResponse`
|
|
494
|
+
def DescribeInstanceInternetBandwidthConfigs(request)
|
|
495
|
+
body = send_request('DescribeInstanceInternetBandwidthConfigs', request.serialize)
|
|
496
|
+
response = JSON.parse(body)
|
|
497
|
+
if response['Response'].key?('Error') == false
|
|
498
|
+
model = DescribeInstanceInternetBandwidthConfigsResponse.new
|
|
499
|
+
model.deserialize(response['Response'])
|
|
500
|
+
model
|
|
501
|
+
else
|
|
502
|
+
code = response['Response']['Error']['Code']
|
|
503
|
+
message = response['Response']['Error']['Message']
|
|
504
|
+
reqid = response['Response']['RequestId']
|
|
505
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
506
|
+
end
|
|
507
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
508
|
+
raise e
|
|
509
|
+
rescue StandardError => e
|
|
510
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# 本接口 (DescribeInstanceTypeConfigs) 用于查询实例机型配置。
|
|
514
|
+
|
|
515
|
+
# * 可以根据`zone`、`instance-family`来查询实例机型配置。过滤条件详见过滤器[`Filter`](https://cloud.tencent.com/document/api/213/15753#Filter)。
|
|
516
|
+
# * 如果参数为空,返回指定地域的所有实例机型配置。
|
|
517
|
+
|
|
518
|
+
# @param request: Request instance for DescribeInstanceTypeConfigs.
|
|
519
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceTypeConfigsRequest`
|
|
520
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceTypeConfigsResponse`
|
|
521
|
+
def DescribeInstanceTypeConfigs(request)
|
|
522
|
+
body = send_request('DescribeInstanceTypeConfigs', request.serialize)
|
|
523
|
+
response = JSON.parse(body)
|
|
524
|
+
if response['Response'].key?('Error') == false
|
|
525
|
+
model = DescribeInstanceTypeConfigsResponse.new
|
|
526
|
+
model.deserialize(response['Response'])
|
|
527
|
+
model
|
|
528
|
+
else
|
|
529
|
+
code = response['Response']['Error']['Code']
|
|
530
|
+
message = response['Response']['Error']['Message']
|
|
531
|
+
reqid = response['Response']['RequestId']
|
|
532
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
533
|
+
end
|
|
534
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
535
|
+
raise e
|
|
536
|
+
rescue StandardError => e
|
|
537
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
# 本接口 ( DescribeInstanceVncUrl ) 用于查询实例管理终端地址,获取的地址可用于实例的 VNC 登录。
|
|
541
|
+
|
|
542
|
+
# * 处于 `STOPPED` 状态的机器无法使用此功能。
|
|
543
|
+
# * 管理终端地址的有效期为 15 秒,调用接口成功后如果 15 秒内不使用该链接进行访问,管理终端地址自动失效,您需要重新查询。
|
|
544
|
+
# * 管理终端地址一旦被访问,将自动失效,您需要重新查询。
|
|
545
|
+
# * 如果连接断开,每分钟内重新连接的次数不能超过 30 次。
|
|
546
|
+
# * 获取到 `InstanceVncUrl` 后,您需要在链接 <https://img.qcloud.com/qcloud/app/active_vnc/index.html?> 末尾加上参数 `InstanceVncUrl=xxxx` 。
|
|
547
|
+
|
|
548
|
+
# - 参数 `InstanceVncUrl` :调用接口成功后会返回的 `InstanceVncUrl` 的值。
|
|
549
|
+
|
|
550
|
+
# 最后组成的 URL 格式如下:
|
|
551
|
+
|
|
552
|
+
# ```
|
|
553
|
+
# https://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9
|
|
554
|
+
# ```
|
|
555
|
+
|
|
556
|
+
# @param request: Request instance for DescribeInstanceVncUrl.
|
|
557
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceVncUrlRequest`
|
|
558
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstanceVncUrlResponse`
|
|
559
|
+
def DescribeInstanceVncUrl(request)
|
|
560
|
+
body = send_request('DescribeInstanceVncUrl', request.serialize)
|
|
561
|
+
response = JSON.parse(body)
|
|
562
|
+
if response['Response'].key?('Error') == false
|
|
563
|
+
model = DescribeInstanceVncUrlResponse.new
|
|
564
|
+
model.deserialize(response['Response'])
|
|
565
|
+
model
|
|
566
|
+
else
|
|
567
|
+
code = response['Response']['Error']['Code']
|
|
568
|
+
message = response['Response']['Error']['Message']
|
|
569
|
+
reqid = response['Response']['RequestId']
|
|
570
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
571
|
+
end
|
|
572
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
573
|
+
raise e
|
|
574
|
+
rescue StandardError => e
|
|
575
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
# 本接口 (DescribeInstances) 用于查询一个或多个实例的详细信息。
|
|
579
|
+
|
|
580
|
+
# * 可以根据实例`ID`、实例名称或者实例计费模式等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。
|
|
581
|
+
# * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。
|
|
582
|
+
# * 支持查询实例的最新操作(LatestOperation)以及最新操作状态(LatestOperationState)。
|
|
583
|
+
|
|
584
|
+
# @param request: Request instance for DescribeInstances.
|
|
585
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesRequest`
|
|
586
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesResponse`
|
|
587
|
+
def DescribeInstances(request)
|
|
588
|
+
body = send_request('DescribeInstances', request.serialize)
|
|
589
|
+
response = JSON.parse(body)
|
|
590
|
+
if response['Response'].key?('Error') == false
|
|
591
|
+
model = DescribeInstancesResponse.new
|
|
592
|
+
model.deserialize(response['Response'])
|
|
593
|
+
model
|
|
594
|
+
else
|
|
595
|
+
code = response['Response']['Error']['Code']
|
|
596
|
+
message = response['Response']['Error']['Message']
|
|
597
|
+
reqid = response['Response']['RequestId']
|
|
598
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
599
|
+
end
|
|
600
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
601
|
+
raise e
|
|
602
|
+
rescue StandardError => e
|
|
603
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
# 本接口 (DescribeInstancesModification) 用于查询指定实例支持调整的机型配置。
|
|
607
|
+
|
|
608
|
+
# @param request: Request instance for DescribeInstancesModification.
|
|
609
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesModificationRequest`
|
|
610
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesModificationResponse`
|
|
611
|
+
def DescribeInstancesModification(request)
|
|
612
|
+
body = send_request('DescribeInstancesModification', request.serialize)
|
|
613
|
+
response = JSON.parse(body)
|
|
614
|
+
if response['Response'].key?('Error') == false
|
|
615
|
+
model = DescribeInstancesModificationResponse.new
|
|
616
|
+
model.deserialize(response['Response'])
|
|
617
|
+
model
|
|
618
|
+
else
|
|
619
|
+
code = response['Response']['Error']['Code']
|
|
620
|
+
message = response['Response']['Error']['Message']
|
|
621
|
+
reqid = response['Response']['RequestId']
|
|
622
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
623
|
+
end
|
|
624
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
625
|
+
raise e
|
|
626
|
+
rescue StandardError => e
|
|
627
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
# 本接口(DescribeInstancesOperationLimit)用于查询实例操作限制。
|
|
631
|
+
|
|
632
|
+
# * 目前支持调整配置操作限制次数查询。
|
|
633
|
+
|
|
634
|
+
# @param request: Request instance for DescribeInstancesOperationLimit.
|
|
635
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesOperationLimitRequest`
|
|
636
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesOperationLimitResponse`
|
|
637
|
+
def DescribeInstancesOperationLimit(request)
|
|
638
|
+
body = send_request('DescribeInstancesOperationLimit', request.serialize)
|
|
639
|
+
response = JSON.parse(body)
|
|
640
|
+
if response['Response'].key?('Error') == false
|
|
641
|
+
model = DescribeInstancesOperationLimitResponse.new
|
|
642
|
+
model.deserialize(response['Response'])
|
|
643
|
+
model
|
|
644
|
+
else
|
|
645
|
+
code = response['Response']['Error']['Code']
|
|
646
|
+
message = response['Response']['Error']['Message']
|
|
647
|
+
reqid = response['Response']['RequestId']
|
|
648
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
649
|
+
end
|
|
650
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
651
|
+
raise e
|
|
652
|
+
rescue StandardError => e
|
|
653
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
654
|
+
end
|
|
655
|
+
|
|
656
|
+
# 本接口 (DescribeInstancesStatus) 用于查询一个或多个实例的状态。
|
|
657
|
+
|
|
658
|
+
# * 可以根据实例`ID`来查询实例的状态。
|
|
659
|
+
# * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例状态。
|
|
660
|
+
|
|
661
|
+
# @param request: Request instance for DescribeInstancesStatus.
|
|
662
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesStatusRequest`
|
|
663
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInstancesStatusResponse`
|
|
664
|
+
def DescribeInstancesStatus(request)
|
|
665
|
+
body = send_request('DescribeInstancesStatus', request.serialize)
|
|
666
|
+
response = JSON.parse(body)
|
|
667
|
+
if response['Response'].key?('Error') == false
|
|
668
|
+
model = DescribeInstancesStatusResponse.new
|
|
669
|
+
model.deserialize(response['Response'])
|
|
670
|
+
model
|
|
671
|
+
else
|
|
672
|
+
code = response['Response']['Error']['Code']
|
|
673
|
+
message = response['Response']['Error']['Message']
|
|
674
|
+
reqid = response['Response']['RequestId']
|
|
675
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
676
|
+
end
|
|
677
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
678
|
+
raise e
|
|
679
|
+
rescue StandardError => e
|
|
680
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
681
|
+
end
|
|
682
|
+
|
|
683
|
+
# 本接口(DescribeInternetChargeTypeConfigs)用于查询网络的计费类型。
|
|
684
|
+
|
|
685
|
+
# @param request: Request instance for DescribeInternetChargeTypeConfigs.
|
|
686
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeInternetChargeTypeConfigsRequest`
|
|
687
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeInternetChargeTypeConfigsResponse`
|
|
688
|
+
def DescribeInternetChargeTypeConfigs(request)
|
|
689
|
+
body = send_request('DescribeInternetChargeTypeConfigs', request.serialize)
|
|
690
|
+
response = JSON.parse(body)
|
|
691
|
+
if response['Response'].key?('Error') == false
|
|
692
|
+
model = DescribeInternetChargeTypeConfigsResponse.new
|
|
693
|
+
model.deserialize(response['Response'])
|
|
694
|
+
model
|
|
695
|
+
else
|
|
696
|
+
code = response['Response']['Error']['Code']
|
|
697
|
+
message = response['Response']['Error']['Message']
|
|
698
|
+
reqid = response['Response']['RequestId']
|
|
699
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
700
|
+
end
|
|
701
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
702
|
+
raise e
|
|
703
|
+
rescue StandardError => e
|
|
704
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
705
|
+
end
|
|
706
|
+
|
|
707
|
+
# 本接口 (DescribeKeyPairs) 用于查询密钥对信息。
|
|
708
|
+
|
|
709
|
+
# * 密钥对是通过一种算法生成的一对密钥,在生成的密钥对中,一个向外界公开,称为公钥;另一个用户自己保留,称为私钥。密钥对的公钥内容可以通过这个接口查询,但私钥内容系统不保留。
|
|
710
|
+
|
|
711
|
+
# @param request: Request instance for DescribeKeyPairs.
|
|
712
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeKeyPairsRequest`
|
|
713
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeKeyPairsResponse`
|
|
714
|
+
def DescribeKeyPairs(request)
|
|
715
|
+
body = send_request('DescribeKeyPairs', request.serialize)
|
|
716
|
+
response = JSON.parse(body)
|
|
717
|
+
if response['Response'].key?('Error') == false
|
|
718
|
+
model = DescribeKeyPairsResponse.new
|
|
719
|
+
model.deserialize(response['Response'])
|
|
720
|
+
model
|
|
721
|
+
else
|
|
722
|
+
code = response['Response']['Error']['Code']
|
|
723
|
+
message = response['Response']['Error']['Message']
|
|
724
|
+
reqid = response['Response']['RequestId']
|
|
725
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
726
|
+
end
|
|
727
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
728
|
+
raise e
|
|
729
|
+
rescue StandardError => e
|
|
730
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
731
|
+
end
|
|
732
|
+
|
|
733
|
+
# 本接口(DescribeRegions)用于查询地域信息。因平台策略原因,该接口暂时停止更新,为确保您正常调用,可切换至新链接:https://cloud.tencent.com/document/product/1278/55255。
|
|
734
|
+
|
|
735
|
+
# @param request: Request instance for DescribeRegions.
|
|
736
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeRegionsRequest`
|
|
737
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeRegionsResponse`
|
|
738
|
+
def DescribeRegions(request)
|
|
739
|
+
body = send_request('DescribeRegions', request.serialize)
|
|
740
|
+
response = JSON.parse(body)
|
|
741
|
+
if response['Response'].key?('Error') == false
|
|
742
|
+
model = DescribeRegionsResponse.new
|
|
743
|
+
model.deserialize(response['Response'])
|
|
744
|
+
model
|
|
745
|
+
else
|
|
746
|
+
code = response['Response']['Error']['Code']
|
|
747
|
+
message = response['Response']['Error']['Message']
|
|
748
|
+
reqid = response['Response']['RequestId']
|
|
749
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
750
|
+
end
|
|
751
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
752
|
+
raise e
|
|
753
|
+
rescue StandardError => e
|
|
754
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
755
|
+
end
|
|
756
|
+
|
|
757
|
+
# 本接口(DescribeReservedInstances)可提供列出用户已购买的预留实例
|
|
758
|
+
|
|
759
|
+
# @param request: Request instance for DescribeReservedInstances.
|
|
760
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesRequest`
|
|
761
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesResponse`
|
|
762
|
+
def DescribeReservedInstances(request)
|
|
763
|
+
body = send_request('DescribeReservedInstances', request.serialize)
|
|
764
|
+
response = JSON.parse(body)
|
|
765
|
+
if response['Response'].key?('Error') == false
|
|
766
|
+
model = DescribeReservedInstancesResponse.new
|
|
767
|
+
model.deserialize(response['Response'])
|
|
768
|
+
model
|
|
769
|
+
else
|
|
770
|
+
code = response['Response']['Error']['Code']
|
|
771
|
+
message = response['Response']['Error']['Message']
|
|
772
|
+
reqid = response['Response']['RequestId']
|
|
773
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
774
|
+
end
|
|
775
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
776
|
+
raise e
|
|
777
|
+
rescue StandardError => e
|
|
778
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
779
|
+
end
|
|
780
|
+
|
|
781
|
+
# 本接口(DescribeReservedInstancesConfigInfos)供用户列出可购买预留实例机型配置。预留实例当前只针对国际站白名单用户开放。
|
|
782
|
+
|
|
783
|
+
# @param request: Request instance for DescribeReservedInstancesConfigInfos.
|
|
784
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesConfigInfosRequest`
|
|
785
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesConfigInfosResponse`
|
|
786
|
+
def DescribeReservedInstancesConfigInfos(request)
|
|
787
|
+
body = send_request('DescribeReservedInstancesConfigInfos', request.serialize)
|
|
788
|
+
response = JSON.parse(body)
|
|
789
|
+
if response['Response'].key?('Error') == false
|
|
790
|
+
model = DescribeReservedInstancesConfigInfosResponse.new
|
|
791
|
+
model.deserialize(response['Response'])
|
|
792
|
+
model
|
|
793
|
+
else
|
|
794
|
+
code = response['Response']['Error']['Code']
|
|
795
|
+
message = response['Response']['Error']['Message']
|
|
796
|
+
reqid = response['Response']['RequestId']
|
|
797
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
798
|
+
end
|
|
799
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
800
|
+
raise e
|
|
801
|
+
rescue StandardError => e
|
|
802
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
803
|
+
end
|
|
804
|
+
|
|
805
|
+
# 本接口(DescribeReservedInstancesOfferings)供用户列出可购买的预留实例配置
|
|
806
|
+
|
|
807
|
+
# @param request: Request instance for DescribeReservedInstancesOfferings.
|
|
808
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesOfferingsRequest`
|
|
809
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeReservedInstancesOfferingsResponse`
|
|
810
|
+
def DescribeReservedInstancesOfferings(request)
|
|
811
|
+
body = send_request('DescribeReservedInstancesOfferings', request.serialize)
|
|
812
|
+
response = JSON.parse(body)
|
|
813
|
+
if response['Response'].key?('Error') == false
|
|
814
|
+
model = DescribeReservedInstancesOfferingsResponse.new
|
|
815
|
+
model.deserialize(response['Response'])
|
|
816
|
+
model
|
|
817
|
+
else
|
|
818
|
+
code = response['Response']['Error']['Code']
|
|
819
|
+
message = response['Response']['Error']['Message']
|
|
820
|
+
reqid = response['Response']['RequestId']
|
|
821
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
822
|
+
end
|
|
823
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
824
|
+
raise e
|
|
825
|
+
rescue StandardError => e
|
|
826
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
# 本接口(DescribeZoneInstanceConfigInfos) 获取可用区的机型信息。
|
|
830
|
+
|
|
831
|
+
# @param request: Request instance for DescribeZoneInstanceConfigInfos.
|
|
832
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeZoneInstanceConfigInfosRequest`
|
|
833
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeZoneInstanceConfigInfosResponse`
|
|
834
|
+
def DescribeZoneInstanceConfigInfos(request)
|
|
835
|
+
body = send_request('DescribeZoneInstanceConfigInfos', request.serialize)
|
|
836
|
+
response = JSON.parse(body)
|
|
837
|
+
if response['Response'].key?('Error') == false
|
|
838
|
+
model = DescribeZoneInstanceConfigInfosResponse.new
|
|
839
|
+
model.deserialize(response['Response'])
|
|
840
|
+
model
|
|
841
|
+
else
|
|
842
|
+
code = response['Response']['Error']['Code']
|
|
843
|
+
message = response['Response']['Error']['Message']
|
|
844
|
+
reqid = response['Response']['RequestId']
|
|
845
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
846
|
+
end
|
|
847
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
848
|
+
raise e
|
|
849
|
+
rescue StandardError => e
|
|
850
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
# 本接口(DescribeZones)用于查询可用区信息。
|
|
854
|
+
|
|
855
|
+
# @param request: Request instance for DescribeZones.
|
|
856
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DescribeZonesRequest`
|
|
857
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DescribeZonesResponse`
|
|
858
|
+
def DescribeZones(request)
|
|
859
|
+
body = send_request('DescribeZones', request.serialize)
|
|
860
|
+
response = JSON.parse(body)
|
|
861
|
+
if response['Response'].key?('Error') == false
|
|
862
|
+
model = DescribeZonesResponse.new
|
|
863
|
+
model.deserialize(response['Response'])
|
|
864
|
+
model
|
|
865
|
+
else
|
|
866
|
+
code = response['Response']['Error']['Code']
|
|
867
|
+
message = response['Response']['Error']['Message']
|
|
868
|
+
reqid = response['Response']['RequestId']
|
|
869
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
870
|
+
end
|
|
871
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
872
|
+
raise e
|
|
873
|
+
rescue StandardError => e
|
|
874
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
875
|
+
end
|
|
876
|
+
|
|
877
|
+
# 本接口 (DisassociateInstancesKeyPairs) 用于解除实例的密钥绑定关系。
|
|
878
|
+
|
|
879
|
+
# * 只支持[`STOPPED`](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)状态的`Linux`操作系统的实例。
|
|
880
|
+
# * 解绑密钥后,实例可以通过原来设置的密码登录。
|
|
881
|
+
# * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/15736) 接口来设置登录密码。
|
|
882
|
+
# * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。
|
|
883
|
+
|
|
884
|
+
# @param request: Request instance for DisassociateInstancesKeyPairs.
|
|
885
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DisassociateInstancesKeyPairsRequest`
|
|
886
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DisassociateInstancesKeyPairsResponse`
|
|
887
|
+
def DisassociateInstancesKeyPairs(request)
|
|
888
|
+
body = send_request('DisassociateInstancesKeyPairs', request.serialize)
|
|
889
|
+
response = JSON.parse(body)
|
|
890
|
+
if response['Response'].key?('Error') == false
|
|
891
|
+
model = DisassociateInstancesKeyPairsResponse.new
|
|
892
|
+
model.deserialize(response['Response'])
|
|
893
|
+
model
|
|
894
|
+
else
|
|
895
|
+
code = response['Response']['Error']['Code']
|
|
896
|
+
message = response['Response']['Error']['Message']
|
|
897
|
+
reqid = response['Response']['RequestId']
|
|
898
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
899
|
+
end
|
|
900
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
901
|
+
raise e
|
|
902
|
+
rescue StandardError => e
|
|
903
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
# 本接口 (DisassociateSecurityGroups) 用于解绑实例的指定安全组。
|
|
907
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
908
|
+
|
|
909
|
+
# @param request: Request instance for DisassociateSecurityGroups.
|
|
910
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::DisassociateSecurityGroupsRequest`
|
|
911
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::DisassociateSecurityGroupsResponse`
|
|
912
|
+
def DisassociateSecurityGroups(request)
|
|
913
|
+
body = send_request('DisassociateSecurityGroups', request.serialize)
|
|
914
|
+
response = JSON.parse(body)
|
|
915
|
+
if response['Response'].key?('Error') == false
|
|
916
|
+
model = DisassociateSecurityGroupsResponse.new
|
|
917
|
+
model.deserialize(response['Response'])
|
|
918
|
+
model
|
|
919
|
+
else
|
|
920
|
+
code = response['Response']['Error']['Code']
|
|
921
|
+
message = response['Response']['Error']['Message']
|
|
922
|
+
reqid = response['Response']['RequestId']
|
|
923
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
924
|
+
end
|
|
925
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
926
|
+
raise e
|
|
927
|
+
rescue StandardError => e
|
|
928
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
929
|
+
end
|
|
930
|
+
|
|
931
|
+
# 本接口(ImportImage)用于导入镜像,导入后的镜像可用于创建实例。目前支持 RAW、VHD、QCOW2、VMDK 镜像格式。
|
|
932
|
+
|
|
933
|
+
# @param request: Request instance for ImportImage.
|
|
934
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ImportImageRequest`
|
|
935
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ImportImageResponse`
|
|
936
|
+
def ImportImage(request)
|
|
937
|
+
body = send_request('ImportImage', request.serialize)
|
|
938
|
+
response = JSON.parse(body)
|
|
939
|
+
if response['Response'].key?('Error') == false
|
|
940
|
+
model = ImportImageResponse.new
|
|
941
|
+
model.deserialize(response['Response'])
|
|
942
|
+
model
|
|
943
|
+
else
|
|
944
|
+
code = response['Response']['Error']['Code']
|
|
945
|
+
message = response['Response']['Error']['Message']
|
|
946
|
+
reqid = response['Response']['RequestId']
|
|
947
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
948
|
+
end
|
|
949
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
950
|
+
raise e
|
|
951
|
+
rescue StandardError => e
|
|
952
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
953
|
+
end
|
|
954
|
+
|
|
955
|
+
# 本接口 (ImportKeyPair) 用于导入密钥对。
|
|
956
|
+
|
|
957
|
+
# * 本接口的功能是将密钥对导入到用户账户,并不会自动绑定到实例。如需绑定可以使用[AssociasteInstancesKeyPair](https://cloud.tencent.com/document/api/213/9404)接口。
|
|
958
|
+
# * 需指定密钥对名称以及该密钥对的公钥文本。
|
|
959
|
+
# * 如果用户只有私钥,可以通过 `SSL` 工具将私钥转换成公钥后再导入。
|
|
960
|
+
|
|
961
|
+
# @param request: Request instance for ImportKeyPair.
|
|
962
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ImportKeyPairRequest`
|
|
963
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ImportKeyPairResponse`
|
|
964
|
+
def ImportKeyPair(request)
|
|
965
|
+
body = send_request('ImportKeyPair', request.serialize)
|
|
966
|
+
response = JSON.parse(body)
|
|
967
|
+
if response['Response'].key?('Error') == false
|
|
968
|
+
model = ImportKeyPairResponse.new
|
|
969
|
+
model.deserialize(response['Response'])
|
|
970
|
+
model
|
|
971
|
+
else
|
|
972
|
+
code = response['Response']['Error']['Code']
|
|
973
|
+
message = response['Response']['Error']['Message']
|
|
974
|
+
reqid = response['Response']['RequestId']
|
|
975
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
976
|
+
end
|
|
977
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
978
|
+
raise e
|
|
979
|
+
rescue StandardError => e
|
|
980
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
981
|
+
end
|
|
982
|
+
|
|
983
|
+
# 本接口(InquirePricePurchaseReservedInstancesOffering)用于创建预留实例询价。本接口仅允许针对购买限制范围内的预留实例配置进行询价。预留实例当前只针对国际站白名单用户开放。
|
|
984
|
+
|
|
985
|
+
# @param request: Request instance for InquirePricePurchaseReservedInstancesOffering.
|
|
986
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquirePricePurchaseReservedInstancesOfferingRequest`
|
|
987
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquirePricePurchaseReservedInstancesOfferingResponse`
|
|
988
|
+
def InquirePricePurchaseReservedInstancesOffering(request)
|
|
989
|
+
body = send_request('InquirePricePurchaseReservedInstancesOffering', request.serialize)
|
|
990
|
+
response = JSON.parse(body)
|
|
991
|
+
if response['Response'].key?('Error') == false
|
|
992
|
+
model = InquirePricePurchaseReservedInstancesOfferingResponse.new
|
|
993
|
+
model.deserialize(response['Response'])
|
|
994
|
+
model
|
|
995
|
+
else
|
|
996
|
+
code = response['Response']['Error']['Code']
|
|
997
|
+
message = response['Response']['Error']['Message']
|
|
998
|
+
reqid = response['Response']['RequestId']
|
|
999
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1000
|
+
end
|
|
1001
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1002
|
+
raise e
|
|
1003
|
+
rescue StandardError => e
|
|
1004
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
# 本接口 (InquiryPriceModifyInstancesChargeType) 用于切换实例的计费模式询价。
|
|
1008
|
+
|
|
1009
|
+
# * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。
|
|
1010
|
+
# * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例、竞价实例不支持该操作。
|
|
1011
|
+
|
|
1012
|
+
# @param request: Request instance for InquiryPriceModifyInstancesChargeType.
|
|
1013
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceModifyInstancesChargeTypeRequest`
|
|
1014
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceModifyInstancesChargeTypeResponse`
|
|
1015
|
+
def InquiryPriceModifyInstancesChargeType(request)
|
|
1016
|
+
body = send_request('InquiryPriceModifyInstancesChargeType', request.serialize)
|
|
1017
|
+
response = JSON.parse(body)
|
|
1018
|
+
if response['Response'].key?('Error') == false
|
|
1019
|
+
model = InquiryPriceModifyInstancesChargeTypeResponse.new
|
|
1020
|
+
model.deserialize(response['Response'])
|
|
1021
|
+
model
|
|
1022
|
+
else
|
|
1023
|
+
code = response['Response']['Error']['Code']
|
|
1024
|
+
message = response['Response']['Error']['Message']
|
|
1025
|
+
reqid = response['Response']['RequestId']
|
|
1026
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1027
|
+
end
|
|
1028
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1029
|
+
raise e
|
|
1030
|
+
rescue StandardError => e
|
|
1031
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1032
|
+
end
|
|
1033
|
+
|
|
1034
|
+
# 本接口 (InquiryPriceRenewInstances) 用于续费包年包月实例询价。
|
|
1035
|
+
|
|
1036
|
+
# * 只支持查询包年包月实例的续费价格。
|
|
1037
|
+
|
|
1038
|
+
# @param request: Request instance for InquiryPriceRenewInstances.
|
|
1039
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceRenewInstancesRequest`
|
|
1040
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceRenewInstancesResponse`
|
|
1041
|
+
def InquiryPriceRenewInstances(request)
|
|
1042
|
+
body = send_request('InquiryPriceRenewInstances', request.serialize)
|
|
1043
|
+
response = JSON.parse(body)
|
|
1044
|
+
if response['Response'].key?('Error') == false
|
|
1045
|
+
model = InquiryPriceRenewInstancesResponse.new
|
|
1046
|
+
model.deserialize(response['Response'])
|
|
1047
|
+
model
|
|
1048
|
+
else
|
|
1049
|
+
code = response['Response']['Error']['Code']
|
|
1050
|
+
message = response['Response']['Error']['Message']
|
|
1051
|
+
reqid = response['Response']['RequestId']
|
|
1052
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1053
|
+
end
|
|
1054
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1055
|
+
raise e
|
|
1056
|
+
rescue StandardError => e
|
|
1057
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1058
|
+
end
|
|
1059
|
+
|
|
1060
|
+
# 本接口 (InquiryPriceResetInstance) 用于重装实例询价。
|
|
1061
|
+
|
|
1062
|
+
# * 如果指定了`ImageId`参数,则使用指定的镜像进行重装询价;否则按照当前实例使用的镜像进行重装询价。
|
|
1063
|
+
# * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。
|
|
1064
|
+
# * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。
|
|
1065
|
+
|
|
1066
|
+
# @param request: Request instance for InquiryPriceResetInstance.
|
|
1067
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstanceRequest`
|
|
1068
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstanceResponse`
|
|
1069
|
+
def InquiryPriceResetInstance(request)
|
|
1070
|
+
body = send_request('InquiryPriceResetInstance', request.serialize)
|
|
1071
|
+
response = JSON.parse(body)
|
|
1072
|
+
if response['Response'].key?('Error') == false
|
|
1073
|
+
model = InquiryPriceResetInstanceResponse.new
|
|
1074
|
+
model.deserialize(response['Response'])
|
|
1075
|
+
model
|
|
1076
|
+
else
|
|
1077
|
+
code = response['Response']['Error']['Code']
|
|
1078
|
+
message = response['Response']['Error']['Message']
|
|
1079
|
+
reqid = response['Response']['RequestId']
|
|
1080
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1081
|
+
end
|
|
1082
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1083
|
+
raise e
|
|
1084
|
+
rescue StandardError => e
|
|
1085
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1086
|
+
end
|
|
1087
|
+
|
|
1088
|
+
# 本接口 (InquiryPriceResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限询价。
|
|
1089
|
+
|
|
1090
|
+
# * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。
|
|
1091
|
+
# * 对于`BANDWIDTH_PREPAID`计费方式的带宽,目前不支持调小带宽,且需要输入参数`StartTime`和`EndTime`,指定调整后的带宽的生效时间段。在这种场景下会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1092
|
+
# * 对于 `TRAFFIC_POSTPAID_BY_HOUR`、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。
|
|
1093
|
+
# * 接口不支持调整`BANDWIDTH_POSTPAID_BY_MONTH`计费方式的带宽。
|
|
1094
|
+
# * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。
|
|
1095
|
+
# * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整`TRAFFIC_POSTPAID_BY_HOUR`和`BANDWIDTH_PACKAGE`计费方式的带宽。
|
|
1096
|
+
|
|
1097
|
+
# @param request: Request instance for InquiryPriceResetInstancesInternetMaxBandwidth.
|
|
1098
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstancesInternetMaxBandwidthRequest`
|
|
1099
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstancesInternetMaxBandwidthResponse`
|
|
1100
|
+
def InquiryPriceResetInstancesInternetMaxBandwidth(request)
|
|
1101
|
+
body = send_request('InquiryPriceResetInstancesInternetMaxBandwidth', request.serialize)
|
|
1102
|
+
response = JSON.parse(body)
|
|
1103
|
+
if response['Response'].key?('Error') == false
|
|
1104
|
+
model = InquiryPriceResetInstancesInternetMaxBandwidthResponse.new
|
|
1105
|
+
model.deserialize(response['Response'])
|
|
1106
|
+
model
|
|
1107
|
+
else
|
|
1108
|
+
code = response['Response']['Error']['Code']
|
|
1109
|
+
message = response['Response']['Error']['Message']
|
|
1110
|
+
reqid = response['Response']['RequestId']
|
|
1111
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1112
|
+
end
|
|
1113
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1114
|
+
raise e
|
|
1115
|
+
rescue StandardError => e
|
|
1116
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1117
|
+
end
|
|
1118
|
+
|
|
1119
|
+
# 本接口 (InquiryPriceResetInstancesType) 用于调整实例的机型询价。
|
|
1120
|
+
|
|
1121
|
+
# * 目前只支持[系统盘类型](https://cloud.tencent.com/document/product/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。
|
|
1122
|
+
# * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。
|
|
1123
|
+
# * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1124
|
+
|
|
1125
|
+
# @param request: Request instance for InquiryPriceResetInstancesType.
|
|
1126
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstancesTypeRequest`
|
|
1127
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResetInstancesTypeResponse`
|
|
1128
|
+
def InquiryPriceResetInstancesType(request)
|
|
1129
|
+
body = send_request('InquiryPriceResetInstancesType', request.serialize)
|
|
1130
|
+
response = JSON.parse(body)
|
|
1131
|
+
if response['Response'].key?('Error') == false
|
|
1132
|
+
model = InquiryPriceResetInstancesTypeResponse.new
|
|
1133
|
+
model.deserialize(response['Response'])
|
|
1134
|
+
model
|
|
1135
|
+
else
|
|
1136
|
+
code = response['Response']['Error']['Code']
|
|
1137
|
+
message = response['Response']['Error']['Message']
|
|
1138
|
+
reqid = response['Response']['RequestId']
|
|
1139
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1140
|
+
end
|
|
1141
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1142
|
+
raise e
|
|
1143
|
+
rescue StandardError => e
|
|
1144
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1145
|
+
end
|
|
1146
|
+
|
|
1147
|
+
# 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。
|
|
1148
|
+
|
|
1149
|
+
# * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性)询价,且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。
|
|
1150
|
+
# * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。
|
|
1151
|
+
|
|
1152
|
+
# @param request: Request instance for InquiryPriceResizeInstanceDisks.
|
|
1153
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResizeInstanceDisksRequest`
|
|
1154
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceResizeInstanceDisksResponse`
|
|
1155
|
+
def InquiryPriceResizeInstanceDisks(request)
|
|
1156
|
+
body = send_request('InquiryPriceResizeInstanceDisks', request.serialize)
|
|
1157
|
+
response = JSON.parse(body)
|
|
1158
|
+
if response['Response'].key?('Error') == false
|
|
1159
|
+
model = InquiryPriceResizeInstanceDisksResponse.new
|
|
1160
|
+
model.deserialize(response['Response'])
|
|
1161
|
+
model
|
|
1162
|
+
else
|
|
1163
|
+
code = response['Response']['Error']['Code']
|
|
1164
|
+
message = response['Response']['Error']['Message']
|
|
1165
|
+
reqid = response['Response']['RequestId']
|
|
1166
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1167
|
+
end
|
|
1168
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1169
|
+
raise e
|
|
1170
|
+
rescue StandardError => e
|
|
1171
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1172
|
+
end
|
|
1173
|
+
|
|
1174
|
+
# 本接口(InquiryPriceRunInstances)用于创建实例询价。本接口仅允许针对购买限制范围内的实例配置进行询价, 详见:[创建实例](https://cloud.tencent.com/document/api/213/15730)。
|
|
1175
|
+
|
|
1176
|
+
# @param request: Request instance for InquiryPriceRunInstances.
|
|
1177
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceRunInstancesRequest`
|
|
1178
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceRunInstancesResponse`
|
|
1179
|
+
def InquiryPriceRunInstances(request)
|
|
1180
|
+
body = send_request('InquiryPriceRunInstances', request.serialize)
|
|
1181
|
+
response = JSON.parse(body)
|
|
1182
|
+
if response['Response'].key?('Error') == false
|
|
1183
|
+
model = InquiryPriceRunInstancesResponse.new
|
|
1184
|
+
model.deserialize(response['Response'])
|
|
1185
|
+
model
|
|
1186
|
+
else
|
|
1187
|
+
code = response['Response']['Error']['Code']
|
|
1188
|
+
message = response['Response']['Error']['Message']
|
|
1189
|
+
reqid = response['Response']['RequestId']
|
|
1190
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1191
|
+
end
|
|
1192
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1193
|
+
raise e
|
|
1194
|
+
rescue StandardError => e
|
|
1195
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
# 本接口 (InquiryPriceTerminateInstances) 用于退还实例询价。
|
|
1199
|
+
|
|
1200
|
+
# * 查询退还实例可以返还的费用。
|
|
1201
|
+
# * 支持批量操作,每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定[错误码](#4.-.E9.94.99.E8.AF.AF.E7.A0.81)返回。
|
|
1202
|
+
|
|
1203
|
+
# @param request: Request instance for InquiryPriceTerminateInstances.
|
|
1204
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::InquiryPriceTerminateInstancesRequest`
|
|
1205
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::InquiryPriceTerminateInstancesResponse`
|
|
1206
|
+
def InquiryPriceTerminateInstances(request)
|
|
1207
|
+
body = send_request('InquiryPriceTerminateInstances', request.serialize)
|
|
1208
|
+
response = JSON.parse(body)
|
|
1209
|
+
if response['Response'].key?('Error') == false
|
|
1210
|
+
model = InquiryPriceTerminateInstancesResponse.new
|
|
1211
|
+
model.deserialize(response['Response'])
|
|
1212
|
+
model
|
|
1213
|
+
else
|
|
1214
|
+
code = response['Response']['Error']['Code']
|
|
1215
|
+
message = response['Response']['Error']['Message']
|
|
1216
|
+
reqid = response['Response']['RequestId']
|
|
1217
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1218
|
+
end
|
|
1219
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1220
|
+
raise e
|
|
1221
|
+
rescue StandardError => e
|
|
1222
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1223
|
+
end
|
|
1224
|
+
|
|
1225
|
+
# 本接口 (ModifyDisasterRecoverGroupAttribute)用于修改[分散置放群组](https://cloud.tencent.com/document/product/213/15486)属性。
|
|
1226
|
+
|
|
1227
|
+
# @param request: Request instance for ModifyDisasterRecoverGroupAttribute.
|
|
1228
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyDisasterRecoverGroupAttributeRequest`
|
|
1229
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyDisasterRecoverGroupAttributeResponse`
|
|
1230
|
+
def ModifyDisasterRecoverGroupAttribute(request)
|
|
1231
|
+
body = send_request('ModifyDisasterRecoverGroupAttribute', request.serialize)
|
|
1232
|
+
response = JSON.parse(body)
|
|
1233
|
+
if response['Response'].key?('Error') == false
|
|
1234
|
+
model = ModifyDisasterRecoverGroupAttributeResponse.new
|
|
1235
|
+
model.deserialize(response['Response'])
|
|
1236
|
+
model
|
|
1237
|
+
else
|
|
1238
|
+
code = response['Response']['Error']['Code']
|
|
1239
|
+
message = response['Response']['Error']['Message']
|
|
1240
|
+
reqid = response['Response']['RequestId']
|
|
1241
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1242
|
+
end
|
|
1243
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1244
|
+
raise e
|
|
1245
|
+
rescue StandardError => e
|
|
1246
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1247
|
+
end
|
|
1248
|
+
|
|
1249
|
+
# 本接口(ModifyHostsAttribute)用于修改CDH实例的属性,如实例名称和续费标记等。参数HostName和RenewFlag必须设置其中一个,但不能同时设置。
|
|
1250
|
+
|
|
1251
|
+
# @param request: Request instance for ModifyHostsAttribute.
|
|
1252
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyHostsAttributeRequest`
|
|
1253
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyHostsAttributeResponse`
|
|
1254
|
+
def ModifyHostsAttribute(request)
|
|
1255
|
+
body = send_request('ModifyHostsAttribute', request.serialize)
|
|
1256
|
+
response = JSON.parse(body)
|
|
1257
|
+
if response['Response'].key?('Error') == false
|
|
1258
|
+
model = ModifyHostsAttributeResponse.new
|
|
1259
|
+
model.deserialize(response['Response'])
|
|
1260
|
+
model
|
|
1261
|
+
else
|
|
1262
|
+
code = response['Response']['Error']['Code']
|
|
1263
|
+
message = response['Response']['Error']['Message']
|
|
1264
|
+
reqid = response['Response']['RequestId']
|
|
1265
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1266
|
+
end
|
|
1267
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1268
|
+
raise e
|
|
1269
|
+
rescue StandardError => e
|
|
1270
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1271
|
+
end
|
|
1272
|
+
|
|
1273
|
+
# 本接口(ModifyImageAttribute)用于修改镜像属性。
|
|
1274
|
+
|
|
1275
|
+
# * 已分享的镜像无法修改属性。
|
|
1276
|
+
|
|
1277
|
+
# @param request: Request instance for ModifyImageAttribute.
|
|
1278
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyImageAttributeRequest`
|
|
1279
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyImageAttributeResponse`
|
|
1280
|
+
def ModifyImageAttribute(request)
|
|
1281
|
+
body = send_request('ModifyImageAttribute', request.serialize)
|
|
1282
|
+
response = JSON.parse(body)
|
|
1283
|
+
if response['Response'].key?('Error') == false
|
|
1284
|
+
model = ModifyImageAttributeResponse.new
|
|
1285
|
+
model.deserialize(response['Response'])
|
|
1286
|
+
model
|
|
1287
|
+
else
|
|
1288
|
+
code = response['Response']['Error']['Code']
|
|
1289
|
+
message = response['Response']['Error']['Message']
|
|
1290
|
+
reqid = response['Response']['RequestId']
|
|
1291
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1292
|
+
end
|
|
1293
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1294
|
+
raise e
|
|
1295
|
+
rescue StandardError => e
|
|
1296
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1297
|
+
end
|
|
1298
|
+
|
|
1299
|
+
# 本接口(ModifyImageSharePermission)用于修改镜像分享信息。
|
|
1300
|
+
|
|
1301
|
+
# * 分享镜像后,被分享账户可以通过该镜像创建实例。
|
|
1302
|
+
# * 每个自定义镜像最多可共享给50个账户。
|
|
1303
|
+
# * 分享镜像无法更改名称,描述,仅可用于创建实例。
|
|
1304
|
+
# * 只支持分享到对方账户相同地域。
|
|
1305
|
+
|
|
1306
|
+
# @param request: Request instance for ModifyImageSharePermission.
|
|
1307
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyImageSharePermissionRequest`
|
|
1308
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyImageSharePermissionResponse`
|
|
1309
|
+
def ModifyImageSharePermission(request)
|
|
1310
|
+
body = send_request('ModifyImageSharePermission', request.serialize)
|
|
1311
|
+
response = JSON.parse(body)
|
|
1312
|
+
if response['Response'].key?('Error') == false
|
|
1313
|
+
model = ModifyImageSharePermissionResponse.new
|
|
1314
|
+
model.deserialize(response['Response'])
|
|
1315
|
+
model
|
|
1316
|
+
else
|
|
1317
|
+
code = response['Response']['Error']['Code']
|
|
1318
|
+
message = response['Response']['Error']['Message']
|
|
1319
|
+
reqid = response['Response']['RequestId']
|
|
1320
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1321
|
+
end
|
|
1322
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1323
|
+
raise e
|
|
1324
|
+
rescue StandardError => e
|
|
1325
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1326
|
+
end
|
|
1327
|
+
|
|
1328
|
+
# 本接口 (ModifyInstancesAttribute) 用于修改实例的属性(目前只支持修改实例的名称和关联的安全组)。
|
|
1329
|
+
|
|
1330
|
+
# * 每次请求必须指定实例的一种属性用于修改。
|
|
1331
|
+
# * “实例名称”仅为方便用户自己管理之用,腾讯云并不以此名称作为在线支持或是进行实例管理操作的依据。
|
|
1332
|
+
# * 支持批量操作。每次请求批量实例的上限为100。
|
|
1333
|
+
# * 修改关联安全组时,子机原来关联的安全组会被解绑。
|
|
1334
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1335
|
+
|
|
1336
|
+
# @param request: Request instance for ModifyInstancesAttribute.
|
|
1337
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesAttributeRequest`
|
|
1338
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesAttributeResponse`
|
|
1339
|
+
def ModifyInstancesAttribute(request)
|
|
1340
|
+
body = send_request('ModifyInstancesAttribute', request.serialize)
|
|
1341
|
+
response = JSON.parse(body)
|
|
1342
|
+
if response['Response'].key?('Error') == false
|
|
1343
|
+
model = ModifyInstancesAttributeResponse.new
|
|
1344
|
+
model.deserialize(response['Response'])
|
|
1345
|
+
model
|
|
1346
|
+
else
|
|
1347
|
+
code = response['Response']['Error']['Code']
|
|
1348
|
+
message = response['Response']['Error']['Message']
|
|
1349
|
+
reqid = response['Response']['RequestId']
|
|
1350
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1351
|
+
end
|
|
1352
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1353
|
+
raise e
|
|
1354
|
+
rescue StandardError => e
|
|
1355
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1356
|
+
end
|
|
1357
|
+
|
|
1358
|
+
# 本接口 (ModifyInstancesChargeType) 用于切换实例的计费模式。
|
|
1359
|
+
|
|
1360
|
+
# * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。
|
|
1361
|
+
# * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例不支持该操作。
|
|
1362
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1363
|
+
|
|
1364
|
+
# @param request: Request instance for ModifyInstancesChargeType.
|
|
1365
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesChargeTypeRequest`
|
|
1366
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesChargeTypeResponse`
|
|
1367
|
+
def ModifyInstancesChargeType(request)
|
|
1368
|
+
body = send_request('ModifyInstancesChargeType', request.serialize)
|
|
1369
|
+
response = JSON.parse(body)
|
|
1370
|
+
if response['Response'].key?('Error') == false
|
|
1371
|
+
model = ModifyInstancesChargeTypeResponse.new
|
|
1372
|
+
model.deserialize(response['Response'])
|
|
1373
|
+
model
|
|
1374
|
+
else
|
|
1375
|
+
code = response['Response']['Error']['Code']
|
|
1376
|
+
message = response['Response']['Error']['Message']
|
|
1377
|
+
reqid = response['Response']['RequestId']
|
|
1378
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1379
|
+
end
|
|
1380
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1381
|
+
raise e
|
|
1382
|
+
rescue StandardError => e
|
|
1383
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1384
|
+
end
|
|
1385
|
+
|
|
1386
|
+
# 本接口 (ModifyInstancesProject) 用于修改实例所属项目。
|
|
1387
|
+
|
|
1388
|
+
# * 项目为一个虚拟概念,用户可以在一个账户下面建立多个项目,每个项目中管理不同的资源;将多个不同实例分属到不同项目中,后续使用 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口查询实例,项目ID可用于过滤结果。
|
|
1389
|
+
# * 绑定负载均衡的实例不支持修改实例所属项目,请先使用[`DeregisterInstancesFromLoadBalancer`](https://cloud.tencent.com/document/api/214/1258)接口解绑负载均衡。
|
|
1390
|
+
# [^_^]: # ( 修改实例所属项目会自动解关联实例原来关联的安全组,修改完成后可使用[`ModifyInstancesAttribute`](https://cloud.tencent.com/document/api/213/15739)接口关联安全组。)
|
|
1391
|
+
# * 支持批量操作。每次请求批量实例的上限为100。
|
|
1392
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1393
|
+
|
|
1394
|
+
# @param request: Request instance for ModifyInstancesProject.
|
|
1395
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesProjectRequest`
|
|
1396
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesProjectResponse`
|
|
1397
|
+
def ModifyInstancesProject(request)
|
|
1398
|
+
body = send_request('ModifyInstancesProject', request.serialize)
|
|
1399
|
+
response = JSON.parse(body)
|
|
1400
|
+
if response['Response'].key?('Error') == false
|
|
1401
|
+
model = ModifyInstancesProjectResponse.new
|
|
1402
|
+
model.deserialize(response['Response'])
|
|
1403
|
+
model
|
|
1404
|
+
else
|
|
1405
|
+
code = response['Response']['Error']['Code']
|
|
1406
|
+
message = response['Response']['Error']['Message']
|
|
1407
|
+
reqid = response['Response']['RequestId']
|
|
1408
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1409
|
+
end
|
|
1410
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1411
|
+
raise e
|
|
1412
|
+
rescue StandardError => e
|
|
1413
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1414
|
+
end
|
|
1415
|
+
|
|
1416
|
+
# 本接口 (ModifyInstancesRenewFlag) 用于修改包年包月实例续费标识。
|
|
1417
|
+
|
|
1418
|
+
# * 实例被标识为自动续费后,每次在实例到期时,会自动续费一个月。
|
|
1419
|
+
# * 支持批量操作。每次请求批量实例的上限为100。
|
|
1420
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1421
|
+
|
|
1422
|
+
# @param request: Request instance for ModifyInstancesRenewFlag.
|
|
1423
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesRenewFlagRequest`
|
|
1424
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesRenewFlagResponse`
|
|
1425
|
+
def ModifyInstancesRenewFlag(request)
|
|
1426
|
+
body = send_request('ModifyInstancesRenewFlag', request.serialize)
|
|
1427
|
+
response = JSON.parse(body)
|
|
1428
|
+
if response['Response'].key?('Error') == false
|
|
1429
|
+
model = ModifyInstancesRenewFlagResponse.new
|
|
1430
|
+
model.deserialize(response['Response'])
|
|
1431
|
+
model
|
|
1432
|
+
else
|
|
1433
|
+
code = response['Response']['Error']['Code']
|
|
1434
|
+
message = response['Response']['Error']['Message']
|
|
1435
|
+
reqid = response['Response']['RequestId']
|
|
1436
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1437
|
+
end
|
|
1438
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1439
|
+
raise e
|
|
1440
|
+
rescue StandardError => e
|
|
1441
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1442
|
+
end
|
|
1443
|
+
|
|
1444
|
+
# 本接口(ModifyInstancesVpcAttribute)用于修改实例vpc属性,如私有网络ip。
|
|
1445
|
+
# * 此操作默认会关闭实例,完成后再启动。
|
|
1446
|
+
# * 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。执行此操作前请确保指定的实例上没有绑定[弹性网卡](https://cloud.tencent.com/document/product/576)和[负载均衡](https://cloud.tencent.com/document/product/214)。
|
|
1447
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1448
|
+
|
|
1449
|
+
# @param request: Request instance for ModifyInstancesVpcAttribute.
|
|
1450
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesVpcAttributeRequest`
|
|
1451
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyInstancesVpcAttributeResponse`
|
|
1452
|
+
def ModifyInstancesVpcAttribute(request)
|
|
1453
|
+
body = send_request('ModifyInstancesVpcAttribute', request.serialize)
|
|
1454
|
+
response = JSON.parse(body)
|
|
1455
|
+
if response['Response'].key?('Error') == false
|
|
1456
|
+
model = ModifyInstancesVpcAttributeResponse.new
|
|
1457
|
+
model.deserialize(response['Response'])
|
|
1458
|
+
model
|
|
1459
|
+
else
|
|
1460
|
+
code = response['Response']['Error']['Code']
|
|
1461
|
+
message = response['Response']['Error']['Message']
|
|
1462
|
+
reqid = response['Response']['RequestId']
|
|
1463
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1464
|
+
end
|
|
1465
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1466
|
+
raise e
|
|
1467
|
+
rescue StandardError => e
|
|
1468
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1469
|
+
end
|
|
1470
|
+
|
|
1471
|
+
# 本接口 (ModifyKeyPairAttribute) 用于修改密钥对属性。
|
|
1472
|
+
|
|
1473
|
+
# * 修改密钥对ID所指定的密钥对的名称和描述信息。
|
|
1474
|
+
# * 密钥对名称不能和已经存在的密钥对的名称重复。
|
|
1475
|
+
# * 密钥对ID是密钥对的唯一标识,不可修改。
|
|
1476
|
+
|
|
1477
|
+
# @param request: Request instance for ModifyKeyPairAttribute.
|
|
1478
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ModifyKeyPairAttributeRequest`
|
|
1479
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ModifyKeyPairAttributeResponse`
|
|
1480
|
+
def ModifyKeyPairAttribute(request)
|
|
1481
|
+
body = send_request('ModifyKeyPairAttribute', request.serialize)
|
|
1482
|
+
response = JSON.parse(body)
|
|
1483
|
+
if response['Response'].key?('Error') == false
|
|
1484
|
+
model = ModifyKeyPairAttributeResponse.new
|
|
1485
|
+
model.deserialize(response['Response'])
|
|
1486
|
+
model
|
|
1487
|
+
else
|
|
1488
|
+
code = response['Response']['Error']['Code']
|
|
1489
|
+
message = response['Response']['Error']['Message']
|
|
1490
|
+
reqid = response['Response']['RequestId']
|
|
1491
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1492
|
+
end
|
|
1493
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1494
|
+
raise e
|
|
1495
|
+
rescue StandardError => e
|
|
1496
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1497
|
+
end
|
|
1498
|
+
|
|
1499
|
+
# 本接口(PurchaseReservedInstancesOffering)用于用户购买一个或者多个指定配置的预留实例
|
|
1500
|
+
|
|
1501
|
+
# @param request: Request instance for PurchaseReservedInstancesOffering.
|
|
1502
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::PurchaseReservedInstancesOfferingRequest`
|
|
1503
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::PurchaseReservedInstancesOfferingResponse`
|
|
1504
|
+
def PurchaseReservedInstancesOffering(request)
|
|
1505
|
+
body = send_request('PurchaseReservedInstancesOffering', request.serialize)
|
|
1506
|
+
response = JSON.parse(body)
|
|
1507
|
+
if response['Response'].key?('Error') == false
|
|
1508
|
+
model = PurchaseReservedInstancesOfferingResponse.new
|
|
1509
|
+
model.deserialize(response['Response'])
|
|
1510
|
+
model
|
|
1511
|
+
else
|
|
1512
|
+
code = response['Response']['Error']['Code']
|
|
1513
|
+
message = response['Response']['Error']['Message']
|
|
1514
|
+
reqid = response['Response']['RequestId']
|
|
1515
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1516
|
+
end
|
|
1517
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1518
|
+
raise e
|
|
1519
|
+
rescue StandardError => e
|
|
1520
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1521
|
+
end
|
|
1522
|
+
|
|
1523
|
+
# 本接口 (RebootInstances) 用于重启实例。
|
|
1524
|
+
|
|
1525
|
+
# * 只有状态为`RUNNING`的实例才可以进行此操作。
|
|
1526
|
+
# * 接口调用成功时,实例会进入`REBOOTING`状态;重启实例成功时,实例会进入`RUNNING`状态。
|
|
1527
|
+
# * 支持强制重启。强制重启的效果等同于关闭物理计算机的电源开关再重新启动。强制重启可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常重启时使用。
|
|
1528
|
+
# * 支持批量操作,每次请求批量实例的上限为100。
|
|
1529
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1530
|
+
|
|
1531
|
+
# @param request: Request instance for RebootInstances.
|
|
1532
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::RebootInstancesRequest`
|
|
1533
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::RebootInstancesResponse`
|
|
1534
|
+
def RebootInstances(request)
|
|
1535
|
+
body = send_request('RebootInstances', request.serialize)
|
|
1536
|
+
response = JSON.parse(body)
|
|
1537
|
+
if response['Response'].key?('Error') == false
|
|
1538
|
+
model = RebootInstancesResponse.new
|
|
1539
|
+
model.deserialize(response['Response'])
|
|
1540
|
+
model
|
|
1541
|
+
else
|
|
1542
|
+
code = response['Response']['Error']['Code']
|
|
1543
|
+
message = response['Response']['Error']['Message']
|
|
1544
|
+
reqid = response['Response']['RequestId']
|
|
1545
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1546
|
+
end
|
|
1547
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1548
|
+
raise e
|
|
1549
|
+
rescue StandardError => e
|
|
1550
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1551
|
+
end
|
|
1552
|
+
|
|
1553
|
+
# 本接口 (RenewHosts) 用于续费包年包月CDH实例。
|
|
1554
|
+
|
|
1555
|
+
# * 只支持操作包年包月实例,否则操作会以特定[错误码](#6.-.E9.94.99.E8.AF.AF.E7.A0.81)返回。
|
|
1556
|
+
# * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1557
|
+
|
|
1558
|
+
# @param request: Request instance for RenewHosts.
|
|
1559
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::RenewHostsRequest`
|
|
1560
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::RenewHostsResponse`
|
|
1561
|
+
def RenewHosts(request)
|
|
1562
|
+
body = send_request('RenewHosts', request.serialize)
|
|
1563
|
+
response = JSON.parse(body)
|
|
1564
|
+
if response['Response'].key?('Error') == false
|
|
1565
|
+
model = RenewHostsResponse.new
|
|
1566
|
+
model.deserialize(response['Response'])
|
|
1567
|
+
model
|
|
1568
|
+
else
|
|
1569
|
+
code = response['Response']['Error']['Code']
|
|
1570
|
+
message = response['Response']['Error']['Message']
|
|
1571
|
+
reqid = response['Response']['RequestId']
|
|
1572
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1573
|
+
end
|
|
1574
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1575
|
+
raise e
|
|
1576
|
+
rescue StandardError => e
|
|
1577
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1578
|
+
end
|
|
1579
|
+
|
|
1580
|
+
# 本接口 (RenewInstances) 用于续费包年包月实例。
|
|
1581
|
+
|
|
1582
|
+
# * 只支持操作包年包月实例。
|
|
1583
|
+
# * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1584
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1585
|
+
|
|
1586
|
+
# @param request: Request instance for RenewInstances.
|
|
1587
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::RenewInstancesRequest`
|
|
1588
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::RenewInstancesResponse`
|
|
1589
|
+
def RenewInstances(request)
|
|
1590
|
+
body = send_request('RenewInstances', request.serialize)
|
|
1591
|
+
response = JSON.parse(body)
|
|
1592
|
+
if response['Response'].key?('Error') == false
|
|
1593
|
+
model = RenewInstancesResponse.new
|
|
1594
|
+
model.deserialize(response['Response'])
|
|
1595
|
+
model
|
|
1596
|
+
else
|
|
1597
|
+
code = response['Response']['Error']['Code']
|
|
1598
|
+
message = response['Response']['Error']['Message']
|
|
1599
|
+
reqid = response['Response']['RequestId']
|
|
1600
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1601
|
+
end
|
|
1602
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1603
|
+
raise e
|
|
1604
|
+
rescue StandardError => e
|
|
1605
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1606
|
+
end
|
|
1607
|
+
|
|
1608
|
+
# 本接口 (ResetInstance) 用于重装指定实例上的操作系统。
|
|
1609
|
+
|
|
1610
|
+
# * 如果指定了`ImageId`参数,则使用指定的镜像重装;否则按照当前实例使用的镜像进行重装。
|
|
1611
|
+
# * 系统盘将会被格式化,并重置;请确保系统盘中无重要文件。
|
|
1612
|
+
# * `Linux`和`Windows`系统互相切换时,该实例系统盘`ID`将发生变化,系统盘关联快照将无法回滚、恢复数据。
|
|
1613
|
+
# * 密码不指定将会通过站内信下发随机密码。
|
|
1614
|
+
# * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换。
|
|
1615
|
+
# * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换。
|
|
1616
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1617
|
+
|
|
1618
|
+
# @param request: Request instance for ResetInstance.
|
|
1619
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ResetInstanceRequest`
|
|
1620
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ResetInstanceResponse`
|
|
1621
|
+
def ResetInstance(request)
|
|
1622
|
+
body = send_request('ResetInstance', request.serialize)
|
|
1623
|
+
response = JSON.parse(body)
|
|
1624
|
+
if response['Response'].key?('Error') == false
|
|
1625
|
+
model = ResetInstanceResponse.new
|
|
1626
|
+
model.deserialize(response['Response'])
|
|
1627
|
+
model
|
|
1628
|
+
else
|
|
1629
|
+
code = response['Response']['Error']['Code']
|
|
1630
|
+
message = response['Response']['Error']['Message']
|
|
1631
|
+
reqid = response['Response']['RequestId']
|
|
1632
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1633
|
+
end
|
|
1634
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1635
|
+
raise e
|
|
1636
|
+
rescue StandardError => e
|
|
1637
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1638
|
+
end
|
|
1639
|
+
|
|
1640
|
+
# 本接口 (ResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限。
|
|
1641
|
+
|
|
1642
|
+
# * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。
|
|
1643
|
+
# * 对于 `BANDWIDTH_PREPAID` 计费方式的带宽,需要输入参数 `StartTime` 和 `EndTime` ,指定调整后的带宽的生效时间段。在这种场景下目前不支持调小带宽,会涉及扣费,请确保账户余额充足。可通过 [`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253) 接口查询账户余额。
|
|
1644
|
+
# * 对于 `TRAFFIC_POSTPAID_BY_HOUR` 、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。
|
|
1645
|
+
# * 接口不支持调整 `BANDWIDTH_POSTPAID_BY_MONTH` 计费方式的带宽。
|
|
1646
|
+
# * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。
|
|
1647
|
+
# * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整 `TRAFFIC_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽。
|
|
1648
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1649
|
+
|
|
1650
|
+
# @param request: Request instance for ResetInstancesInternetMaxBandwidth.
|
|
1651
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ResetInstancesInternetMaxBandwidthRequest`
|
|
1652
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ResetInstancesInternetMaxBandwidthResponse`
|
|
1653
|
+
def ResetInstancesInternetMaxBandwidth(request)
|
|
1654
|
+
body = send_request('ResetInstancesInternetMaxBandwidth', request.serialize)
|
|
1655
|
+
response = JSON.parse(body)
|
|
1656
|
+
if response['Response'].key?('Error') == false
|
|
1657
|
+
model = ResetInstancesInternetMaxBandwidthResponse.new
|
|
1658
|
+
model.deserialize(response['Response'])
|
|
1659
|
+
model
|
|
1660
|
+
else
|
|
1661
|
+
code = response['Response']['Error']['Code']
|
|
1662
|
+
message = response['Response']['Error']['Message']
|
|
1663
|
+
reqid = response['Response']['RequestId']
|
|
1664
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1665
|
+
end
|
|
1666
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1667
|
+
raise e
|
|
1668
|
+
rescue StandardError => e
|
|
1669
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1670
|
+
end
|
|
1671
|
+
|
|
1672
|
+
# 本接口 (ResetInstancesPassword) 用于将实例操作系统的密码重置为用户指定的密码。
|
|
1673
|
+
|
|
1674
|
+
# *如果是修改系统管理云密码:实例的操作系统不同,管理员帐号也会不一样(`Windows`为`Administrator`,`Ubuntu`为`ubuntu`,其它系统为`root`)。
|
|
1675
|
+
# * 重置处于运行中状态的实例密码,需要设置关机参数`ForceStop`为`TRUE`。如果没有显式指定强制关机参数,则只有处于关机状态的实例才允许执行重置密码操作。
|
|
1676
|
+
# * 支持批量操作。将多个实例操作系统的密码重置为相同的密码。每次请求批量实例的上限为100。
|
|
1677
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1678
|
+
|
|
1679
|
+
# @param request: Request instance for ResetInstancesPassword.
|
|
1680
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ResetInstancesPasswordRequest`
|
|
1681
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ResetInstancesPasswordResponse`
|
|
1682
|
+
def ResetInstancesPassword(request)
|
|
1683
|
+
body = send_request('ResetInstancesPassword', request.serialize)
|
|
1684
|
+
response = JSON.parse(body)
|
|
1685
|
+
if response['Response'].key?('Error') == false
|
|
1686
|
+
model = ResetInstancesPasswordResponse.new
|
|
1687
|
+
model.deserialize(response['Response'])
|
|
1688
|
+
model
|
|
1689
|
+
else
|
|
1690
|
+
code = response['Response']['Error']['Code']
|
|
1691
|
+
message = response['Response']['Error']['Message']
|
|
1692
|
+
reqid = response['Response']['RequestId']
|
|
1693
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1694
|
+
end
|
|
1695
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1696
|
+
raise e
|
|
1697
|
+
rescue StandardError => e
|
|
1698
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1699
|
+
end
|
|
1700
|
+
|
|
1701
|
+
# 本接口 (ResetInstancesType) 用于调整实例的机型。
|
|
1702
|
+
|
|
1703
|
+
# * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是CLOUD_BASIC、CLOUD_PREMIUM、CLOUD_SSD类型的实例使用该接口进行机型调整。
|
|
1704
|
+
# * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1705
|
+
# * 本接口为异步接口,调整实例配置请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表调整实例配置操作成功。
|
|
1706
|
+
|
|
1707
|
+
# @param request: Request instance for ResetInstancesType.
|
|
1708
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ResetInstancesTypeRequest`
|
|
1709
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ResetInstancesTypeResponse`
|
|
1710
|
+
def ResetInstancesType(request)
|
|
1711
|
+
body = send_request('ResetInstancesType', request.serialize)
|
|
1712
|
+
response = JSON.parse(body)
|
|
1713
|
+
if response['Response'].key?('Error') == false
|
|
1714
|
+
model = ResetInstancesTypeResponse.new
|
|
1715
|
+
model.deserialize(response['Response'])
|
|
1716
|
+
model
|
|
1717
|
+
else
|
|
1718
|
+
code = response['Response']['Error']['Code']
|
|
1719
|
+
message = response['Response']['Error']['Message']
|
|
1720
|
+
reqid = response['Response']['RequestId']
|
|
1721
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1722
|
+
end
|
|
1723
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1724
|
+
raise e
|
|
1725
|
+
rescue StandardError => e
|
|
1726
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1727
|
+
end
|
|
1728
|
+
|
|
1729
|
+
# 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。
|
|
1730
|
+
|
|
1731
|
+
# * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/api/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`和[CDH](https://cloud.tencent.com/document/product/416)实例的`LOCAL_BASIC`、`LOCAL_SSD`类型数据盘。
|
|
1732
|
+
# * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。
|
|
1733
|
+
# * 目前只支持扩容一块数据盘。
|
|
1734
|
+
# * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。
|
|
1735
|
+
|
|
1736
|
+
# @param request: Request instance for ResizeInstanceDisks.
|
|
1737
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::ResizeInstanceDisksRequest`
|
|
1738
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::ResizeInstanceDisksResponse`
|
|
1739
|
+
def ResizeInstanceDisks(request)
|
|
1740
|
+
body = send_request('ResizeInstanceDisks', request.serialize)
|
|
1741
|
+
response = JSON.parse(body)
|
|
1742
|
+
if response['Response'].key?('Error') == false
|
|
1743
|
+
model = ResizeInstanceDisksResponse.new
|
|
1744
|
+
model.deserialize(response['Response'])
|
|
1745
|
+
model
|
|
1746
|
+
else
|
|
1747
|
+
code = response['Response']['Error']['Code']
|
|
1748
|
+
message = response['Response']['Error']['Message']
|
|
1749
|
+
reqid = response['Response']['RequestId']
|
|
1750
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1751
|
+
end
|
|
1752
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1753
|
+
raise e
|
|
1754
|
+
rescue StandardError => e
|
|
1755
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1756
|
+
end
|
|
1757
|
+
|
|
1758
|
+
# 本接口 (RunInstances) 用于创建一个或多个指定配置的实例。
|
|
1759
|
+
|
|
1760
|
+
# * 实例创建成功后将自动开机启动,[实例状态](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)变为“运行中”。
|
|
1761
|
+
# * 预付费实例的购买会预先扣除本次实例购买所需金额,按小时后付费实例购买会预先冻结本次实例购买一小时内所需金额,在调用本接口前请确保账户余额充足。
|
|
1762
|
+
# * 调用本接口创建实例,支持代金券自动抵扣(注意,代金券不可用于抵扣后付费冻结金额),详情请参考[代金券选用规则](https://cloud.tencent.com/document/product/555/7428)。
|
|
1763
|
+
# * 本接口允许购买的实例数量遵循[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664),所创建的实例和官网入口创建的实例共用配额。
|
|
1764
|
+
# * 本接口为异步接口,当创建实例请求下发成功后会返回一个实例`ID`列表和一个`RequestId`,此时创建实例操作并未立即完成。在此期间实例的状态将会处于“PENDING”,实例创建结果可以通过调用 [DescribeInstancesStatus](https://cloud.tencent.com/document/product/213/15738) 接口查询,如果实例状态(InstanceState)由“PENDING”变为“RUNNING”,则代表实例创建成功,“LAUNCH_FAILED”代表实例创建失败。
|
|
1765
|
+
|
|
1766
|
+
# @param request: Request instance for RunInstances.
|
|
1767
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::RunInstancesRequest`
|
|
1768
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::RunInstancesResponse`
|
|
1769
|
+
def RunInstances(request)
|
|
1770
|
+
body = send_request('RunInstances', request.serialize)
|
|
1771
|
+
response = JSON.parse(body)
|
|
1772
|
+
if response['Response'].key?('Error') == false
|
|
1773
|
+
model = RunInstancesResponse.new
|
|
1774
|
+
model.deserialize(response['Response'])
|
|
1775
|
+
model
|
|
1776
|
+
else
|
|
1777
|
+
code = response['Response']['Error']['Code']
|
|
1778
|
+
message = response['Response']['Error']['Message']
|
|
1779
|
+
reqid = response['Response']['RequestId']
|
|
1780
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1781
|
+
end
|
|
1782
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1783
|
+
raise e
|
|
1784
|
+
rescue StandardError => e
|
|
1785
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1786
|
+
end
|
|
1787
|
+
|
|
1788
|
+
# 本接口 (StartInstances) 用于启动一个或多个实例。
|
|
1789
|
+
|
|
1790
|
+
# * 只有状态为`STOPPED`的实例才可以进行此操作。
|
|
1791
|
+
# * 接口调用成功时,实例会进入`STARTING`状态;启动实例成功时,实例会进入`RUNNING`状态。
|
|
1792
|
+
# * 支持批量操作。每次请求批量实例的上限为100。
|
|
1793
|
+
# * 本接口为异步接口,启动实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表启动实例操作成功。
|
|
1794
|
+
|
|
1795
|
+
# @param request: Request instance for StartInstances.
|
|
1796
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::StartInstancesRequest`
|
|
1797
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::StartInstancesResponse`
|
|
1798
|
+
def StartInstances(request)
|
|
1799
|
+
body = send_request('StartInstances', request.serialize)
|
|
1800
|
+
response = JSON.parse(body)
|
|
1801
|
+
if response['Response'].key?('Error') == false
|
|
1802
|
+
model = StartInstancesResponse.new
|
|
1803
|
+
model.deserialize(response['Response'])
|
|
1804
|
+
model
|
|
1805
|
+
else
|
|
1806
|
+
code = response['Response']['Error']['Code']
|
|
1807
|
+
message = response['Response']['Error']['Message']
|
|
1808
|
+
reqid = response['Response']['RequestId']
|
|
1809
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1810
|
+
end
|
|
1811
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1812
|
+
raise e
|
|
1813
|
+
rescue StandardError => e
|
|
1814
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1815
|
+
end
|
|
1816
|
+
|
|
1817
|
+
# 本接口 (StopInstances) 用于关闭一个或多个实例。
|
|
1818
|
+
|
|
1819
|
+
# * 只有状态为`RUNNING`的实例才可以进行此操作。
|
|
1820
|
+
# * 接口调用成功时,实例会进入`STOPPING`状态;关闭实例成功时,实例会进入`STOPPED`状态。
|
|
1821
|
+
# * 支持强制关闭。强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。
|
|
1822
|
+
# * 支持批量操作。每次请求批量实例的上限为100。
|
|
1823
|
+
# * 本接口为异步接口,关闭实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表关闭实例操作成功。
|
|
1824
|
+
|
|
1825
|
+
# @param request: Request instance for StopInstances.
|
|
1826
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::StopInstancesRequest`
|
|
1827
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::StopInstancesResponse`
|
|
1828
|
+
def StopInstances(request)
|
|
1829
|
+
body = send_request('StopInstances', request.serialize)
|
|
1830
|
+
response = JSON.parse(body)
|
|
1831
|
+
if response['Response'].key?('Error') == false
|
|
1832
|
+
model = StopInstancesResponse.new
|
|
1833
|
+
model.deserialize(response['Response'])
|
|
1834
|
+
model
|
|
1835
|
+
else
|
|
1836
|
+
code = response['Response']['Error']['Code']
|
|
1837
|
+
message = response['Response']['Error']['Message']
|
|
1838
|
+
reqid = response['Response']['RequestId']
|
|
1839
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1840
|
+
end
|
|
1841
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1842
|
+
raise e
|
|
1843
|
+
rescue StandardError => e
|
|
1844
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1845
|
+
end
|
|
1846
|
+
|
|
1847
|
+
# 本接口(SyncImages)用于将自定义镜像同步到其它地区。
|
|
1848
|
+
|
|
1849
|
+
# * 该接口每次调用只支持同步一个镜像。
|
|
1850
|
+
# * 该接口支持多个同步地域。
|
|
1851
|
+
# * 单个帐号在每个地域最多支持存在10个自定义镜像。
|
|
1852
|
+
|
|
1853
|
+
# @param request: Request instance for SyncImages.
|
|
1854
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::SyncImagesRequest`
|
|
1855
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::SyncImagesResponse`
|
|
1856
|
+
def SyncImages(request)
|
|
1857
|
+
body = send_request('SyncImages', request.serialize)
|
|
1858
|
+
response = JSON.parse(body)
|
|
1859
|
+
if response['Response'].key?('Error') == false
|
|
1860
|
+
model = SyncImagesResponse.new
|
|
1861
|
+
model.deserialize(response['Response'])
|
|
1862
|
+
model
|
|
1863
|
+
else
|
|
1864
|
+
code = response['Response']['Error']['Code']
|
|
1865
|
+
message = response['Response']['Error']['Message']
|
|
1866
|
+
reqid = response['Response']['RequestId']
|
|
1867
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1868
|
+
end
|
|
1869
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1870
|
+
raise e
|
|
1871
|
+
rescue StandardError => e
|
|
1872
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1873
|
+
end
|
|
1874
|
+
|
|
1875
|
+
# 本接口 (TerminateInstances) 用于主动退还实例。
|
|
1876
|
+
|
|
1877
|
+
# * 不再使用的实例,可通过本接口主动退还。
|
|
1878
|
+
# * 按量计费的实例通过本接口可直接退还;包年包月实例如符合[退还规则](https://cloud.tencent.com/document/product/213/9711),也可通过本接口主动退还。
|
|
1879
|
+
# * 包年包月实例首次调用本接口,实例将被移至回收站,再次调用本接口,实例将被销毁,且不可恢复。按量计费实例调用本接口将被直接销毁
|
|
1880
|
+
# * 支持批量操作,每次请求批量实例的上限为100。
|
|
1881
|
+
|
|
1882
|
+
# @param request: Request instance for TerminateInstances.
|
|
1883
|
+
# @type request: :class:`Tencentcloud::cvm::V20170312::TerminateInstancesRequest`
|
|
1884
|
+
# @rtype: :class:`Tencentcloud::cvm::V20170312::TerminateInstancesResponse`
|
|
1885
|
+
def TerminateInstances(request)
|
|
1886
|
+
body = send_request('TerminateInstances', request.serialize)
|
|
1887
|
+
response = JSON.parse(body)
|
|
1888
|
+
if response['Response'].key?('Error') == false
|
|
1889
|
+
model = TerminateInstancesResponse.new
|
|
1890
|
+
model.deserialize(response['Response'])
|
|
1891
|
+
model
|
|
1892
|
+
else
|
|
1893
|
+
code = response['Response']['Error']['Code']
|
|
1894
|
+
message = response['Response']['Error']['Message']
|
|
1895
|
+
reqid = response['Response']['RequestId']
|
|
1896
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
|
1897
|
+
end
|
|
1898
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
|
1899
|
+
raise e
|
|
1900
|
+
rescue StandardError => e
|
|
1901
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
|
1902
|
+
end
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
end
|
|
1906
|
+
end
|
|
1907
|
+
end
|
|
1908
|
+
end
|