qingcloud-sdk 0.4.1 → 2.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +201 -21
- data/README.md +141 -61
- data/bin/console +3 -3
- data/lib/qingcloud/sdk.rb +16 -14
- data/lib/qingcloud/sdk/general/config.rb +70 -0
- data/lib/qingcloud/sdk/general/contract.rb +28 -17
- data/lib/qingcloud/sdk/general/default/config.yaml +13 -0
- data/lib/qingcloud/sdk/general/error.rb +41 -32
- data/lib/qingcloud/sdk/general/logger.rb +54 -0
- data/lib/qingcloud/sdk/request/preprocessor.rb +81 -0
- data/lib/qingcloud/sdk/request/request.rb +80 -0
- data/lib/qingcloud/sdk/request/signer.rb +53 -0
- data/lib/qingcloud/sdk/service/cache.rb +1005 -0
- data/lib/qingcloud/sdk/service/dns_alias.rb +150 -0
- data/lib/qingcloud/sdk/service/eip.rb +389 -0
- data/lib/qingcloud/sdk/service/image.rb +304 -0
- data/lib/qingcloud/sdk/service/instance.rb +585 -0
- data/lib/qingcloud/sdk/service/job.rb +71 -0
- data/lib/qingcloud/sdk/service/key_pair.rb +257 -0
- data/lib/qingcloud/sdk/service/load_balancer.rb +1119 -0
- data/lib/qingcloud/sdk/service/mongo.rb +566 -0
- data/lib/qingcloud/sdk/service/qingcloud.rb +185 -0
- data/lib/qingcloud/sdk/service/rdb.rb +751 -0
- data/lib/qingcloud/sdk/service/router.rb +778 -0
- data/lib/qingcloud/sdk/service/security_group.rb +645 -0
- data/lib/qingcloud/sdk/service/shared_storage.rb +666 -0
- data/lib/qingcloud/sdk/service/snapshot.rb +283 -0
- data/lib/qingcloud/sdk/service/tag.rb +227 -0
- data/lib/qingcloud/sdk/service/user_data.rb +61 -0
- data/lib/qingcloud/sdk/service/volume.rb +296 -0
- data/lib/qingcloud/sdk/service/vxnet.rb +295 -0
- data/lib/qingcloud/sdk/version.rb +19 -5
- metadata +98 -29
- data/.gitignore +0 -13
- data/.rspec +0 -2
- data/.travis.yml +0 -3
- data/Rakefile +0 -6
- data/lib/qingcloud/sdk/iaas/connector.rb +0 -99
- data/lib/qingcloud/sdk/iaas/foundation.rb +0 -73
- data/lib/qingcloud/sdk/iaas/service.rb +0 -1274
- data/lib/qingcloud/sdk/template/config.json +0 -4
- data/lib/qingcloud/sdk/utility/file_manager.rb +0 -43
- data/lib/qingcloud/sdk/utility/json_parser.rb +0 -41
- data/lib/qingcloud/sdk/utility/logger.rb +0 -19
- data/qingcloud-sdk.gemspec +0 -31
@@ -0,0 +1,61 @@
|
|
1
|
+
# +-------------------------------------------------------------------------
|
2
|
+
# | Copyright (C) 2016 Yunify, Inc.
|
3
|
+
# +-------------------------------------------------------------------------
|
4
|
+
# | Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# | you may not use this work except in compliance with the License.
|
6
|
+
# | You may obtain a copy of the License in the LICENSE file, or at:
|
7
|
+
# |
|
8
|
+
# | http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
# |
|
10
|
+
# | Unless required by applicable law or agreed to in writing, software
|
11
|
+
# | distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# | See the License for the specific language governing permissions and
|
14
|
+
# | limitations under the License.
|
15
|
+
# +-------------------------------------------------------------------------
|
16
|
+
|
17
|
+
require 'active_support/core_ext/hash/keys'
|
18
|
+
|
19
|
+
module QingCloud
|
20
|
+
module SDK
|
21
|
+
class UserDataService
|
22
|
+
attr_accessor :config, :properties
|
23
|
+
|
24
|
+
def initialize(config, properties)
|
25
|
+
self.config = config
|
26
|
+
self.properties = properties.deep_symbolize_keys
|
27
|
+
end
|
28
|
+
|
29
|
+
# Documentation URL: https://docs.qingcloud.com/api/userdata/upload_userdata_attachment.html
|
30
|
+
def upload_user_data_attachment(attachment_content: '', attachment_name: '')
|
31
|
+
input = {
|
32
|
+
config: config,
|
33
|
+
properties: properties,
|
34
|
+
api_name: 'UploadUserDataAttachment',
|
35
|
+
request_method: 'POST',
|
36
|
+
request_params: {
|
37
|
+
'attachment_content' => attachment_content,
|
38
|
+
'attachment_name' => attachment_name,
|
39
|
+
},
|
40
|
+
}
|
41
|
+
|
42
|
+
upload_user_data_attachment_input_validate input
|
43
|
+
|
44
|
+
request = Request.new input
|
45
|
+
request.send
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def upload_user_data_attachment_input_validate(input)
|
51
|
+
input.deep_stringify_keys!
|
52
|
+
|
53
|
+
unless !input['request_params']['attachment_content'].nil? && !input['request_params']['attachment_content'].to_s.empty?
|
54
|
+
raise ParameterRequiredError.new('attachment_content', 'UploadUserDataAttachmentInput')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
public
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,296 @@
|
|
1
|
+
# +-------------------------------------------------------------------------
|
2
|
+
# | Copyright (C) 2016 Yunify, Inc.
|
3
|
+
# +-------------------------------------------------------------------------
|
4
|
+
# | Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# | you may not use this work except in compliance with the License.
|
6
|
+
# | You may obtain a copy of the License in the LICENSE file, or at:
|
7
|
+
# |
|
8
|
+
# | http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
# |
|
10
|
+
# | Unless required by applicable law or agreed to in writing, software
|
11
|
+
# | distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# | See the License for the specific language governing permissions and
|
14
|
+
# | limitations under the License.
|
15
|
+
# +-------------------------------------------------------------------------
|
16
|
+
|
17
|
+
require 'active_support/core_ext/hash/keys'
|
18
|
+
|
19
|
+
module QingCloud
|
20
|
+
module SDK
|
21
|
+
class VolumeService
|
22
|
+
attr_accessor :config, :properties
|
23
|
+
|
24
|
+
def initialize(config, properties)
|
25
|
+
self.config = config
|
26
|
+
self.properties = properties.deep_symbolize_keys
|
27
|
+
end
|
28
|
+
|
29
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/attach_volumes.html
|
30
|
+
def attach_volumes(instance: '', volumes: [])
|
31
|
+
input = {
|
32
|
+
config: config,
|
33
|
+
properties: properties,
|
34
|
+
api_name: 'AttachVolumes',
|
35
|
+
request_method: 'GET',
|
36
|
+
request_params: {
|
37
|
+
'instance' => instance,
|
38
|
+
'volumes' => volumes,
|
39
|
+
},
|
40
|
+
}
|
41
|
+
|
42
|
+
attach_volumes_input_validate input
|
43
|
+
|
44
|
+
request = Request.new input
|
45
|
+
request.send
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def attach_volumes_input_validate(input)
|
51
|
+
input.deep_stringify_keys!
|
52
|
+
|
53
|
+
unless !input['request_params']['instance'].nil? && !input['request_params']['instance'].to_s.empty?
|
54
|
+
raise ParameterRequiredError.new('instance', 'AttachVolumesInput')
|
55
|
+
end
|
56
|
+
|
57
|
+
unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
|
58
|
+
raise ParameterRequiredError.new('volumes', 'AttachVolumesInput')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
public
|
63
|
+
|
64
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/create_volumes.html
|
65
|
+
def create_volumes(count: nil, size: nil, volume_name: '', volume_type: nil)
|
66
|
+
input = {
|
67
|
+
config: config,
|
68
|
+
properties: properties,
|
69
|
+
api_name: 'CreateVolumes',
|
70
|
+
request_method: 'GET',
|
71
|
+
request_params: {
|
72
|
+
'count' => count,
|
73
|
+
'size' => size,
|
74
|
+
'volume_name' => volume_name,
|
75
|
+
'volume_type' => volume_type, # volume_type's available values: 0, 1, 2, 3
|
76
|
+
},
|
77
|
+
}
|
78
|
+
|
79
|
+
create_volumes_input_validate input
|
80
|
+
|
81
|
+
request = Request.new input
|
82
|
+
request.send
|
83
|
+
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
def create_volumes_input_validate(input)
|
88
|
+
input.deep_stringify_keys!
|
89
|
+
|
90
|
+
unless !input['request_params']['size'].nil? && !input['request_params']['size'].to_s.empty?
|
91
|
+
raise ParameterRequiredError.new('size', 'CreateVolumesInput')
|
92
|
+
end
|
93
|
+
|
94
|
+
if input['request_params']['volume_type'] && !input['request_params']['volume_type'].to_s.empty?
|
95
|
+
volume_type_valid_values = %w(0 1 2 3)
|
96
|
+
unless volume_type_valid_values.include? input['request_params']['volume_type'].to_s
|
97
|
+
raise ParameterValueNotAllowedError.new(
|
98
|
+
'volume_type',
|
99
|
+
input['request_params']['volume_type'],
|
100
|
+
volume_type_valid_values,
|
101
|
+
)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
public
|
107
|
+
|
108
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/delete_volumes.html
|
109
|
+
def delete_volumes(volumes: [])
|
110
|
+
input = {
|
111
|
+
config: config,
|
112
|
+
properties: properties,
|
113
|
+
api_name: 'DeleteVolumes',
|
114
|
+
request_method: 'GET',
|
115
|
+
request_params: {
|
116
|
+
'volumes' => volumes,
|
117
|
+
},
|
118
|
+
}
|
119
|
+
|
120
|
+
delete_volumes_input_validate input
|
121
|
+
|
122
|
+
request = Request.new input
|
123
|
+
request.send
|
124
|
+
end
|
125
|
+
|
126
|
+
private
|
127
|
+
|
128
|
+
def delete_volumes_input_validate(input)
|
129
|
+
input.deep_stringify_keys!
|
130
|
+
|
131
|
+
unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
|
132
|
+
raise ParameterRequiredError.new('volumes', 'DeleteVolumesInput')
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
public
|
137
|
+
|
138
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/describe_volumes.html
|
139
|
+
def describe_volumes(limit: nil, offset: nil, search_word: '', status: [], tags: [], verbose: nil, volume_type: nil, volumes: [])
|
140
|
+
input = {
|
141
|
+
config: config,
|
142
|
+
properties: properties,
|
143
|
+
api_name: 'DescribeVolumes',
|
144
|
+
request_method: 'GET',
|
145
|
+
request_params: {
|
146
|
+
'limit' => limit,
|
147
|
+
'offset' => offset,
|
148
|
+
'search_word' => search_word,
|
149
|
+
'status' => status,
|
150
|
+
'tags' => tags,
|
151
|
+
'verbose' => verbose, # verbose's available values: 0, 1
|
152
|
+
'volume_type' => volume_type, # volume_type's available values: 0, 1, 2, 3
|
153
|
+
'volumes' => volumes,
|
154
|
+
},
|
155
|
+
}
|
156
|
+
|
157
|
+
describe_volumes_input_validate input
|
158
|
+
|
159
|
+
request = Request.new input
|
160
|
+
request.send
|
161
|
+
end
|
162
|
+
|
163
|
+
private
|
164
|
+
|
165
|
+
def describe_volumes_input_validate(input)
|
166
|
+
input.deep_stringify_keys!
|
167
|
+
|
168
|
+
if input['request_params']['verbose'] && !input['request_params']['verbose'].to_s.empty?
|
169
|
+
verbose_valid_values = %w(0 1)
|
170
|
+
unless verbose_valid_values.include? input['request_params']['verbose'].to_s
|
171
|
+
raise ParameterValueNotAllowedError.new(
|
172
|
+
'verbose',
|
173
|
+
input['request_params']['verbose'],
|
174
|
+
verbose_valid_values,
|
175
|
+
)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
if input['request_params']['volume_type'] && !input['request_params']['volume_type'].to_s.empty?
|
180
|
+
volume_type_valid_values = %w(0 1 2 3)
|
181
|
+
unless volume_type_valid_values.include? input['request_params']['volume_type'].to_s
|
182
|
+
raise ParameterValueNotAllowedError.new(
|
183
|
+
'volume_type',
|
184
|
+
input['request_params']['volume_type'],
|
185
|
+
volume_type_valid_values,
|
186
|
+
)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
public
|
192
|
+
|
193
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/detach_volumes.html
|
194
|
+
def detach_volumes(instance: '', volumes: [])
|
195
|
+
input = {
|
196
|
+
config: config,
|
197
|
+
properties: properties,
|
198
|
+
api_name: 'DetachVolumes',
|
199
|
+
request_method: 'GET',
|
200
|
+
request_params: {
|
201
|
+
'instance' => instance,
|
202
|
+
'volumes' => volumes,
|
203
|
+
},
|
204
|
+
}
|
205
|
+
|
206
|
+
detach_volumes_input_validate input
|
207
|
+
|
208
|
+
request = Request.new input
|
209
|
+
request.send
|
210
|
+
end
|
211
|
+
|
212
|
+
private
|
213
|
+
|
214
|
+
def detach_volumes_input_validate(input)
|
215
|
+
input.deep_stringify_keys!
|
216
|
+
|
217
|
+
unless !input['request_params']['instance'].nil? && !input['request_params']['instance'].to_s.empty?
|
218
|
+
raise ParameterRequiredError.new('instance', 'DetachVolumesInput')
|
219
|
+
end
|
220
|
+
|
221
|
+
unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
|
222
|
+
raise ParameterRequiredError.new('volumes', 'DetachVolumesInput')
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
public
|
227
|
+
|
228
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/modify_volume_attributes.html
|
229
|
+
def modify_volume_attributes(description: '', volume: '', volume_name: '')
|
230
|
+
input = {
|
231
|
+
config: config,
|
232
|
+
properties: properties,
|
233
|
+
api_name: 'ModifyVolumeAttributes',
|
234
|
+
request_method: 'GET',
|
235
|
+
request_params: {
|
236
|
+
'description' => description,
|
237
|
+
'volume' => volume,
|
238
|
+
'volume_name' => volume_name,
|
239
|
+
},
|
240
|
+
}
|
241
|
+
|
242
|
+
modify_volume_attributes_input_validate input
|
243
|
+
|
244
|
+
request = Request.new input
|
245
|
+
request.send
|
246
|
+
end
|
247
|
+
|
248
|
+
private
|
249
|
+
|
250
|
+
def modify_volume_attributes_input_validate(input)
|
251
|
+
input.deep_stringify_keys!
|
252
|
+
|
253
|
+
unless !input['request_params']['volume'].nil? && !input['request_params']['volume'].to_s.empty?
|
254
|
+
raise ParameterRequiredError.new('volume', 'ModifyVolumeAttributesInput')
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
public
|
259
|
+
|
260
|
+
# Documentation URL: https://docs.qingcloud.com/api/volume/resize_volumes.html
|
261
|
+
def resize_volumes(size: nil, volumes: [])
|
262
|
+
input = {
|
263
|
+
config: config,
|
264
|
+
properties: properties,
|
265
|
+
api_name: 'ResizeVolumes',
|
266
|
+
request_method: 'GET',
|
267
|
+
request_params: {
|
268
|
+
'size' => size,
|
269
|
+
'volumes' => volumes,
|
270
|
+
},
|
271
|
+
}
|
272
|
+
|
273
|
+
resize_volumes_input_validate input
|
274
|
+
|
275
|
+
request = Request.new input
|
276
|
+
request.send
|
277
|
+
end
|
278
|
+
|
279
|
+
private
|
280
|
+
|
281
|
+
def resize_volumes_input_validate(input)
|
282
|
+
input.deep_stringify_keys!
|
283
|
+
|
284
|
+
unless !input['request_params']['size'].nil? && !input['request_params']['size'].to_s.empty?
|
285
|
+
raise ParameterRequiredError.new('size', 'ResizeVolumesInput')
|
286
|
+
end
|
287
|
+
|
288
|
+
unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
|
289
|
+
raise ParameterRequiredError.new('volumes', 'ResizeVolumesInput')
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
public
|
294
|
+
end
|
295
|
+
end
|
296
|
+
end
|
@@ -0,0 +1,295 @@
|
|
1
|
+
# +-------------------------------------------------------------------------
|
2
|
+
# | Copyright (C) 2016 Yunify, Inc.
|
3
|
+
# +-------------------------------------------------------------------------
|
4
|
+
# | Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# | you may not use this work except in compliance with the License.
|
6
|
+
# | You may obtain a copy of the License in the LICENSE file, or at:
|
7
|
+
# |
|
8
|
+
# | http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
# |
|
10
|
+
# | Unless required by applicable law or agreed to in writing, software
|
11
|
+
# | distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# | See the License for the specific language governing permissions and
|
14
|
+
# | limitations under the License.
|
15
|
+
# +-------------------------------------------------------------------------
|
16
|
+
|
17
|
+
require 'active_support/core_ext/hash/keys'
|
18
|
+
|
19
|
+
module QingCloud
|
20
|
+
module SDK
|
21
|
+
class VxNetService
|
22
|
+
attr_accessor :config, :properties
|
23
|
+
|
24
|
+
def initialize(config, properties)
|
25
|
+
self.config = config
|
26
|
+
self.properties = properties.deep_symbolize_keys
|
27
|
+
end
|
28
|
+
|
29
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/create_vxnets.html
|
30
|
+
def create_vxnets(count: nil, vxnet_name: '', vxnet_type: nil)
|
31
|
+
input = {
|
32
|
+
config: config,
|
33
|
+
properties: properties,
|
34
|
+
api_name: 'CreateVxnets',
|
35
|
+
request_method: 'GET',
|
36
|
+
request_params: {
|
37
|
+
'count' => count,
|
38
|
+
'vxnet_name' => vxnet_name,
|
39
|
+
'vxnet_type' => vxnet_type, # vxnet_type's available values: 0, 1
|
40
|
+
},
|
41
|
+
}
|
42
|
+
|
43
|
+
create_vxnets_input_validate input
|
44
|
+
|
45
|
+
request = Request.new input
|
46
|
+
request.send
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def create_vxnets_input_validate(input)
|
52
|
+
input.deep_stringify_keys!
|
53
|
+
|
54
|
+
unless !input['request_params']['vxnet_type'].nil? && !input['request_params']['vxnet_type'].to_s.empty?
|
55
|
+
raise ParameterRequiredError.new('vxnet_type', 'CreateVxnetsInput')
|
56
|
+
end
|
57
|
+
|
58
|
+
if input['request_params']['vxnet_type'] && !input['request_params']['vxnet_type'].to_s.empty?
|
59
|
+
vxnet_type_valid_values = %w(0 1)
|
60
|
+
unless vxnet_type_valid_values.include? input['request_params']['vxnet_type'].to_s
|
61
|
+
raise ParameterValueNotAllowedError.new(
|
62
|
+
'vxnet_type',
|
63
|
+
input['request_params']['vxnet_type'],
|
64
|
+
vxnet_type_valid_values,
|
65
|
+
)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
public
|
71
|
+
|
72
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/delete_vxnets.html
|
73
|
+
def delete_vxnets(vxnets: [])
|
74
|
+
input = {
|
75
|
+
config: config,
|
76
|
+
properties: properties,
|
77
|
+
api_name: 'DeleteVxnets',
|
78
|
+
request_method: 'GET',
|
79
|
+
request_params: {
|
80
|
+
'vxnets' => vxnets,
|
81
|
+
},
|
82
|
+
}
|
83
|
+
|
84
|
+
delete_vxnets_input_validate input
|
85
|
+
|
86
|
+
request = Request.new input
|
87
|
+
request.send
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def delete_vxnets_input_validate(input)
|
93
|
+
input.deep_stringify_keys!
|
94
|
+
|
95
|
+
unless !input['request_params']['vxnets'].nil? && !input['request_params']['vxnets'].to_s.empty?
|
96
|
+
raise ParameterRequiredError.new('vxnets', 'DeleteVxnetsInput')
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
public
|
101
|
+
|
102
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/describe_vxnet_instances.html
|
103
|
+
def describe_vxnet_instances(image: '', instance_type: '', instances: [], limit: nil, offset: nil, status: '', vxnet: '')
|
104
|
+
input = {
|
105
|
+
config: config,
|
106
|
+
properties: properties,
|
107
|
+
api_name: 'DescribeVxnetInstances',
|
108
|
+
request_method: 'GET',
|
109
|
+
request_params: {
|
110
|
+
'image' => image,
|
111
|
+
'instance_type' => instance_type,
|
112
|
+
'instances' => instances,
|
113
|
+
'limit' => limit,
|
114
|
+
'offset' => offset,
|
115
|
+
'status' => status,
|
116
|
+
'vxnet' => vxnet,
|
117
|
+
},
|
118
|
+
}
|
119
|
+
|
120
|
+
describe_vxnet_instances_input_validate input
|
121
|
+
|
122
|
+
request = Request.new input
|
123
|
+
request.send
|
124
|
+
end
|
125
|
+
|
126
|
+
private
|
127
|
+
|
128
|
+
def describe_vxnet_instances_input_validate(input)
|
129
|
+
input.deep_stringify_keys!
|
130
|
+
|
131
|
+
unless !input['request_params']['vxnet'].nil? && !input['request_params']['vxnet'].to_s.empty?
|
132
|
+
raise ParameterRequiredError.new('vxnet', 'DescribeVxnetInstancesInput')
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
public
|
137
|
+
|
138
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/describe_vxnets.html
|
139
|
+
def describe_vxnets(limit: nil, offset: nil, search_word: '', tags: [], verbose: nil, vxnet_type: nil, vxnets: [])
|
140
|
+
input = {
|
141
|
+
config: config,
|
142
|
+
properties: properties,
|
143
|
+
api_name: 'DescribeVxnets',
|
144
|
+
request_method: 'GET',
|
145
|
+
request_params: {
|
146
|
+
'limit' => limit,
|
147
|
+
'offset' => offset,
|
148
|
+
'search_word' => search_word,
|
149
|
+
'tags' => tags,
|
150
|
+
'verbose' => verbose, # verbose's available values: 0, 1
|
151
|
+
'vxnet_type' => vxnet_type, # vxnet_type's available values: 0, 1
|
152
|
+
'vxnets' => vxnets,
|
153
|
+
},
|
154
|
+
}
|
155
|
+
|
156
|
+
describe_vxnets_input_validate input
|
157
|
+
|
158
|
+
request = Request.new input
|
159
|
+
request.send
|
160
|
+
end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
def describe_vxnets_input_validate(input)
|
165
|
+
input.deep_stringify_keys!
|
166
|
+
|
167
|
+
if input['request_params']['verbose'] && !input['request_params']['verbose'].to_s.empty?
|
168
|
+
verbose_valid_values = %w(0 1)
|
169
|
+
unless verbose_valid_values.include? input['request_params']['verbose'].to_s
|
170
|
+
raise ParameterValueNotAllowedError.new(
|
171
|
+
'verbose',
|
172
|
+
input['request_params']['verbose'],
|
173
|
+
verbose_valid_values,
|
174
|
+
)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
if input['request_params']['vxnet_type'] && !input['request_params']['vxnet_type'].to_s.empty?
|
179
|
+
vxnet_type_valid_values = %w(0 1)
|
180
|
+
unless vxnet_type_valid_values.include? input['request_params']['vxnet_type'].to_s
|
181
|
+
raise ParameterValueNotAllowedError.new(
|
182
|
+
'vxnet_type',
|
183
|
+
input['request_params']['vxnet_type'],
|
184
|
+
vxnet_type_valid_values,
|
185
|
+
)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
public
|
191
|
+
|
192
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/join_vxnet.html
|
193
|
+
def join_vxnet(instances: [], vxnet: '')
|
194
|
+
input = {
|
195
|
+
config: config,
|
196
|
+
properties: properties,
|
197
|
+
api_name: 'JoinVxnet',
|
198
|
+
request_method: 'GET',
|
199
|
+
request_params: {
|
200
|
+
'instances' => instances,
|
201
|
+
'vxnet' => vxnet,
|
202
|
+
},
|
203
|
+
}
|
204
|
+
|
205
|
+
join_vxnet_input_validate input
|
206
|
+
|
207
|
+
request = Request.new input
|
208
|
+
request.send
|
209
|
+
end
|
210
|
+
|
211
|
+
private
|
212
|
+
|
213
|
+
def join_vxnet_input_validate(input)
|
214
|
+
input.deep_stringify_keys!
|
215
|
+
|
216
|
+
unless !input['request_params']['instances'].nil? && !input['request_params']['instances'].to_s.empty?
|
217
|
+
raise ParameterRequiredError.new('instances', 'JoinVxnetInput')
|
218
|
+
end
|
219
|
+
|
220
|
+
unless !input['request_params']['vxnet'].nil? && !input['request_params']['vxnet'].to_s.empty?
|
221
|
+
raise ParameterRequiredError.new('vxnet', 'JoinVxnetInput')
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
public
|
226
|
+
|
227
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/leave_vxnet.html
|
228
|
+
def leave_vxnet(instances: [], vxnet: '')
|
229
|
+
input = {
|
230
|
+
config: config,
|
231
|
+
properties: properties,
|
232
|
+
api_name: 'LeaveVxnet',
|
233
|
+
request_method: 'GET',
|
234
|
+
request_params: {
|
235
|
+
'instances' => instances,
|
236
|
+
'vxnet' => vxnet,
|
237
|
+
},
|
238
|
+
}
|
239
|
+
|
240
|
+
leave_vxnet_input_validate input
|
241
|
+
|
242
|
+
request = Request.new input
|
243
|
+
request.send
|
244
|
+
end
|
245
|
+
|
246
|
+
private
|
247
|
+
|
248
|
+
def leave_vxnet_input_validate(input)
|
249
|
+
input.deep_stringify_keys!
|
250
|
+
|
251
|
+
unless !input['request_params']['instances'].nil? && !input['request_params']['instances'].to_s.empty?
|
252
|
+
raise ParameterRequiredError.new('instances', 'LeaveVxnetInput')
|
253
|
+
end
|
254
|
+
|
255
|
+
unless !input['request_params']['vxnet'].nil? && !input['request_params']['vxnet'].to_s.empty?
|
256
|
+
raise ParameterRequiredError.new('vxnet', 'LeaveVxnetInput')
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
public
|
261
|
+
|
262
|
+
# Documentation URL: https://docs.qingcloud.com/api/vxnet/modify_vxnet_attributes.html
|
263
|
+
def modify_vxnet_attributes(description: '', vxnet: '', vxnet_name: '')
|
264
|
+
input = {
|
265
|
+
config: config,
|
266
|
+
properties: properties,
|
267
|
+
api_name: 'ModifyVxnetAttributes',
|
268
|
+
request_method: 'GET',
|
269
|
+
request_params: {
|
270
|
+
'description' => description,
|
271
|
+
'vxnet' => vxnet,
|
272
|
+
'vxnet_name' => vxnet_name,
|
273
|
+
},
|
274
|
+
}
|
275
|
+
|
276
|
+
modify_vxnet_attributes_input_validate input
|
277
|
+
|
278
|
+
request = Request.new input
|
279
|
+
request.send
|
280
|
+
end
|
281
|
+
|
282
|
+
private
|
283
|
+
|
284
|
+
def modify_vxnet_attributes_input_validate(input)
|
285
|
+
input.deep_stringify_keys!
|
286
|
+
|
287
|
+
unless !input['request_params']['vxnet'].nil? && !input['request_params']['vxnet'].to_s.empty?
|
288
|
+
raise ParameterRequiredError.new('vxnet', 'ModifyVxnetAttributesInput')
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
public
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|