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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +201 -21
  3. data/README.md +141 -61
  4. data/bin/console +3 -3
  5. data/lib/qingcloud/sdk.rb +16 -14
  6. data/lib/qingcloud/sdk/general/config.rb +70 -0
  7. data/lib/qingcloud/sdk/general/contract.rb +28 -17
  8. data/lib/qingcloud/sdk/general/default/config.yaml +13 -0
  9. data/lib/qingcloud/sdk/general/error.rb +41 -32
  10. data/lib/qingcloud/sdk/general/logger.rb +54 -0
  11. data/lib/qingcloud/sdk/request/preprocessor.rb +81 -0
  12. data/lib/qingcloud/sdk/request/request.rb +80 -0
  13. data/lib/qingcloud/sdk/request/signer.rb +53 -0
  14. data/lib/qingcloud/sdk/service/cache.rb +1005 -0
  15. data/lib/qingcloud/sdk/service/dns_alias.rb +150 -0
  16. data/lib/qingcloud/sdk/service/eip.rb +389 -0
  17. data/lib/qingcloud/sdk/service/image.rb +304 -0
  18. data/lib/qingcloud/sdk/service/instance.rb +585 -0
  19. data/lib/qingcloud/sdk/service/job.rb +71 -0
  20. data/lib/qingcloud/sdk/service/key_pair.rb +257 -0
  21. data/lib/qingcloud/sdk/service/load_balancer.rb +1119 -0
  22. data/lib/qingcloud/sdk/service/mongo.rb +566 -0
  23. data/lib/qingcloud/sdk/service/qingcloud.rb +185 -0
  24. data/lib/qingcloud/sdk/service/rdb.rb +751 -0
  25. data/lib/qingcloud/sdk/service/router.rb +778 -0
  26. data/lib/qingcloud/sdk/service/security_group.rb +645 -0
  27. data/lib/qingcloud/sdk/service/shared_storage.rb +666 -0
  28. data/lib/qingcloud/sdk/service/snapshot.rb +283 -0
  29. data/lib/qingcloud/sdk/service/tag.rb +227 -0
  30. data/lib/qingcloud/sdk/service/user_data.rb +61 -0
  31. data/lib/qingcloud/sdk/service/volume.rb +296 -0
  32. data/lib/qingcloud/sdk/service/vxnet.rb +295 -0
  33. data/lib/qingcloud/sdk/version.rb +19 -5
  34. metadata +98 -29
  35. data/.gitignore +0 -13
  36. data/.rspec +0 -2
  37. data/.travis.yml +0 -3
  38. data/Rakefile +0 -6
  39. data/lib/qingcloud/sdk/iaas/connector.rb +0 -99
  40. data/lib/qingcloud/sdk/iaas/foundation.rb +0 -73
  41. data/lib/qingcloud/sdk/iaas/service.rb +0 -1274
  42. data/lib/qingcloud/sdk/template/config.json +0 -4
  43. data/lib/qingcloud/sdk/utility/file_manager.rb +0 -43
  44. data/lib/qingcloud/sdk/utility/json_parser.rb +0 -41
  45. data/lib/qingcloud/sdk/utility/logger.rb +0 -19
  46. data/qingcloud-sdk.gemspec +0 -31
@@ -0,0 +1,666 @@
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 SharedStorageService
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/vsan/attach_to_s2_shared_target.html
30
+ def attach_to_s2_shared_target(shared_target: '', volumes: [])
31
+ input = {
32
+ config: config,
33
+ properties: properties,
34
+ api_name: 'AttachToS2SharedTarget',
35
+ request_method: 'GET',
36
+ request_params: {
37
+ 'shared_target' => shared_target,
38
+ 'volumes' => volumes,
39
+ },
40
+ }
41
+
42
+ attach_to_s2_shared_target_input_validate input
43
+
44
+ request = Request.new input
45
+ request.send
46
+ end
47
+
48
+ private
49
+
50
+ def attach_to_s2_shared_target_input_validate(input)
51
+ input.deep_stringify_keys!
52
+
53
+ unless !input['request_params']['shared_target'].nil? && !input['request_params']['shared_target'].to_s.empty?
54
+ raise ParameterRequiredError.new('shared_target', 'AttachToS2SharedTargetInput')
55
+ end
56
+
57
+ unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
58
+ raise ParameterRequiredError.new('volumes', 'AttachToS2SharedTargetInput')
59
+ end
60
+ end
61
+
62
+ public
63
+
64
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/change_s2_server_vxnet.html
65
+ def change_s2_server_vxnet(private_ip: '', s2_server: '', vxnet: '')
66
+ input = {
67
+ config: config,
68
+ properties: properties,
69
+ api_name: 'ChangeS2ServerVxnet',
70
+ request_method: 'GET',
71
+ request_params: {
72
+ 'private_ip' => private_ip,
73
+ 's2_server' => s2_server,
74
+ 'vxnet' => vxnet,
75
+ },
76
+ }
77
+
78
+ change_s2_server_vxnet_input_validate input
79
+
80
+ request = Request.new input
81
+ request.send
82
+ end
83
+
84
+ private
85
+
86
+ def change_s2_server_vxnet_input_validate(input)
87
+ input.deep_stringify_keys!
88
+
89
+ unless !input['request_params']['s2_server'].nil? && !input['request_params']['s2_server'].to_s.empty?
90
+ raise ParameterRequiredError.new('s2_server', 'ChangeS2ServerVxnetInput')
91
+ end
92
+
93
+ unless !input['request_params']['vxnet'].nil? && !input['request_params']['vxnet'].to_s.empty?
94
+ raise ParameterRequiredError.new('vxnet', 'ChangeS2ServerVxnetInput')
95
+ end
96
+ end
97
+
98
+ public
99
+
100
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/create_s2_server.html
101
+ def create_s2_server(description: '', private_ip: '', s2_class: nil, s2_server_name: '', service_type: '', vxnet: '')
102
+ input = {
103
+ config: config,
104
+ properties: properties,
105
+ api_name: 'CreateS2Server',
106
+ request_method: 'GET',
107
+ request_params: {
108
+ 'description' => description,
109
+ 'private_ip' => private_ip,
110
+ 's2_class' => s2_class, # s2_class's available values: 0, 1
111
+ 's2_server_name' => s2_server_name,
112
+ 'service_type' => service_type,
113
+ 'vxnet' => vxnet,
114
+ },
115
+ }
116
+
117
+ create_s2_server_input_validate input
118
+
119
+ request = Request.new input
120
+ request.send
121
+ end
122
+
123
+ private
124
+
125
+ def create_s2_server_input_validate(input)
126
+ input.deep_stringify_keys!
127
+
128
+ if input['request_params']['s2_class'] && !input['request_params']['s2_class'].to_s.empty?
129
+ s2_class_valid_values = %w(0 1)
130
+ unless s2_class_valid_values.include? input['request_params']['s2_class'].to_s
131
+ raise ParameterValueNotAllowedError.new(
132
+ 's2_class',
133
+ input['request_params']['s2_class'],
134
+ s2_class_valid_values,
135
+ )
136
+ end
137
+ end
138
+ end
139
+
140
+ public
141
+
142
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/create_s2_shared_target.html
143
+ def create_s2_shared_target(description: '', export_name: '', export_name_nfs: '', initiator_names: [], s2_group: '', s2_server_id: '', target_type: '', volumes: [])
144
+ input = {
145
+ config: config,
146
+ properties: properties,
147
+ api_name: 'CreateS2SharedTarget',
148
+ request_method: 'GET',
149
+ request_params: {
150
+ 'description' => description,
151
+ 'export_name' => export_name,
152
+ 'export_name_nfs' => export_name_nfs,
153
+ 'initiator_names' => initiator_names,
154
+ 's2_group' => s2_group,
155
+ 's2_server_id' => s2_server_id,
156
+ 'target_type' => target_type, # target_type's available values: ISCSI, NFS
157
+ 'volumes' => volumes,
158
+ },
159
+ }
160
+
161
+ create_s2_shared_target_input_validate input
162
+
163
+ request = Request.new input
164
+ request.send
165
+ end
166
+
167
+ private
168
+
169
+ def create_s2_shared_target_input_validate(input)
170
+ input.deep_stringify_keys!
171
+
172
+ unless !input['request_params']['export_name'].nil? && !input['request_params']['export_name'].to_s.empty?
173
+ raise ParameterRequiredError.new('export_name', 'CreateS2SharedTargetInput')
174
+ end
175
+
176
+ unless !input['request_params']['s2_server_id'].nil? && !input['request_params']['s2_server_id'].to_s.empty?
177
+ raise ParameterRequiredError.new('s2_server_id', 'CreateS2SharedTargetInput')
178
+ end
179
+
180
+ unless !input['request_params']['target_type'].nil? && !input['request_params']['target_type'].to_s.empty?
181
+ raise ParameterRequiredError.new('target_type', 'CreateS2SharedTargetInput')
182
+ end
183
+
184
+ if input['request_params']['target_type'] && !input['request_params']['target_type'].to_s.empty?
185
+ target_type_valid_values = %w(ISCSI NFS)
186
+ unless target_type_valid_values.include? input['request_params']['target_type'].to_s
187
+ raise ParameterValueNotAllowedError.new(
188
+ 'target_type',
189
+ input['request_params']['target_type'],
190
+ target_type_valid_values,
191
+ )
192
+ end
193
+ end
194
+ end
195
+
196
+ public
197
+
198
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/delete_s2_servers.html
199
+ def delete_s2_servers(s2_servers: [])
200
+ input = {
201
+ config: config,
202
+ properties: properties,
203
+ api_name: 'DeleteS2Servers',
204
+ request_method: 'GET',
205
+ request_params: {
206
+ 's2_servers' => s2_servers,
207
+ },
208
+ }
209
+
210
+ delete_s2_servers_input_validate input
211
+
212
+ request = Request.new input
213
+ request.send
214
+ end
215
+
216
+ private
217
+
218
+ def delete_s2_servers_input_validate(input)
219
+ input.deep_stringify_keys!
220
+
221
+ unless !input['request_params']['s2_servers'].nil? && !input['request_params']['s2_servers'].to_s.empty?
222
+ raise ParameterRequiredError.new('s2_servers', 'DeleteS2ServersInput')
223
+ end
224
+ end
225
+
226
+ public
227
+
228
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/delete_s2_shared_targets.html
229
+ def delete_s2_shared_targets(shared_targets: [])
230
+ input = {
231
+ config: config,
232
+ properties: properties,
233
+ api_name: 'DeleteS2SharedTargets',
234
+ request_method: 'GET',
235
+ request_params: {
236
+ 'shared_targets' => shared_targets,
237
+ },
238
+ }
239
+
240
+ delete_s2_shared_targets_input_validate input
241
+
242
+ request = Request.new input
243
+ request.send
244
+ end
245
+
246
+ private
247
+
248
+ def delete_s2_shared_targets_input_validate(input)
249
+ input.deep_stringify_keys!
250
+
251
+ unless !input['request_params']['shared_targets'].nil? && !input['request_params']['shared_targets'].to_s.empty?
252
+ raise ParameterRequiredError.new('shared_targets', 'DeleteS2SharedTargetsInput')
253
+ end
254
+ end
255
+
256
+ public
257
+
258
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/describle_s2_default_parameters.html
259
+ def describe_s2_default_parameters(limit: nil, offset: nil, service_type: '', target_type: '')
260
+ input = {
261
+ config: config,
262
+ properties: properties,
263
+ api_name: 'DescribeS2DefaultParameters',
264
+ request_method: 'GET',
265
+ request_params: {
266
+ 'limit' => limit,
267
+ 'offset' => offset,
268
+ 'service_type' => service_type, # service_type's available values: vsan
269
+ 'target_type' => target_type, # target_type's available values: ISCSI
270
+ },
271
+ }
272
+
273
+ describe_s2_default_parameters_input_validate input
274
+
275
+ request = Request.new input
276
+ request.send
277
+ end
278
+
279
+ private
280
+
281
+ def describe_s2_default_parameters_input_validate(input)
282
+ input.deep_stringify_keys!
283
+
284
+ if input['request_params']['service_type'] && !input['request_params']['service_type'].to_s.empty?
285
+ service_type_valid_values = ['vsan']
286
+ unless service_type_valid_values.include? input['request_params']['service_type'].to_s
287
+ raise ParameterValueNotAllowedError.new(
288
+ 'service_type',
289
+ input['request_params']['service_type'],
290
+ service_type_valid_values,
291
+ )
292
+ end
293
+ end
294
+
295
+ if input['request_params']['target_type'] && !input['request_params']['target_type'].to_s.empty?
296
+ target_type_valid_values = ['ISCSI']
297
+ unless target_type_valid_values.include? input['request_params']['target_type'].to_s
298
+ raise ParameterValueNotAllowedError.new(
299
+ 'target_type',
300
+ input['request_params']['target_type'],
301
+ target_type_valid_values,
302
+ )
303
+ end
304
+ end
305
+ end
306
+
307
+ public
308
+
309
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/describe_s2_servers.html
310
+ def describe_s2_servers(limit: nil, offset: nil, s2_servers: [], search_word: '', status: [], tags: [], verbose: nil)
311
+ input = {
312
+ config: config,
313
+ properties: properties,
314
+ api_name: 'DescribeS2Servers',
315
+ request_method: 'GET',
316
+ request_params: {
317
+ 'limit' => limit,
318
+ 'offset' => offset,
319
+ 's2_servers' => s2_servers,
320
+ 'search_word' => search_word,
321
+ 'status' => status,
322
+ 'tags' => tags,
323
+ 'verbose' => verbose,
324
+ },
325
+ }
326
+
327
+ describe_s2_servers_input_validate input
328
+
329
+ request = Request.new input
330
+ request.send
331
+ end
332
+
333
+ private
334
+
335
+ def describe_s2_servers_input_validate(input)
336
+ input.deep_stringify_keys!
337
+ end
338
+
339
+ public
340
+
341
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/describe_s2_shared_targets.html
342
+ def describe_s2_shared_targets(limit: nil, offset: nil, s2_server_id: '', search_word: '', shared_targets: [], verbose: nil)
343
+ input = {
344
+ config: config,
345
+ properties: properties,
346
+ api_name: 'DescribeS2SharedTargets',
347
+ request_method: 'GET',
348
+ request_params: {
349
+ 'limit' => limit,
350
+ 'offset' => offset,
351
+ 's2_server_id' => s2_server_id,
352
+ 'search_word' => search_word,
353
+ 'shared_targets' => shared_targets,
354
+ 'verbose' => verbose,
355
+ },
356
+ }
357
+
358
+ describe_s2_shared_targets_input_validate input
359
+
360
+ request = Request.new input
361
+ request.send
362
+ end
363
+
364
+ private
365
+
366
+ def describe_s2_shared_targets_input_validate(input)
367
+ input.deep_stringify_keys!
368
+ end
369
+
370
+ public
371
+
372
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/detach_from_s2_shared_target.html
373
+ def detach_from_s2_shared_target(shared_target: '', volumes: [])
374
+ input = {
375
+ config: config,
376
+ properties: properties,
377
+ api_name: 'DetachFromS2SharedTarget',
378
+ request_method: 'GET',
379
+ request_params: {
380
+ 'shared_target' => shared_target,
381
+ 'volumes' => volumes,
382
+ },
383
+ }
384
+
385
+ detach_from_s2_shared_target_input_validate input
386
+
387
+ request = Request.new input
388
+ request.send
389
+ end
390
+
391
+ private
392
+
393
+ def detach_from_s2_shared_target_input_validate(input)
394
+ input.deep_stringify_keys!
395
+
396
+ unless !input['request_params']['shared_target'].nil? && !input['request_params']['shared_target'].to_s.empty?
397
+ raise ParameterRequiredError.new('shared_target', 'DetachFromS2SharedTargetInput')
398
+ end
399
+
400
+ unless !input['request_params']['volumes'].nil? && !input['request_params']['volumes'].to_s.empty?
401
+ raise ParameterRequiredError.new('volumes', 'DetachFromS2SharedTargetInput')
402
+ end
403
+ end
404
+
405
+ public
406
+
407
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/disable_s2_shared_targets.html
408
+ def disable_s2_shared_targets(shared_targets: [])
409
+ input = {
410
+ config: config,
411
+ properties: properties,
412
+ api_name: 'DisableS2SharedTargets',
413
+ request_method: 'GET',
414
+ request_params: {
415
+ 'shared_targets' => shared_targets,
416
+ },
417
+ }
418
+
419
+ disable_s2_shared_targets_input_validate input
420
+
421
+ request = Request.new input
422
+ request.send
423
+ end
424
+
425
+ private
426
+
427
+ def disable_s2_shared_targets_input_validate(input)
428
+ input.deep_stringify_keys!
429
+
430
+ unless !input['request_params']['shared_targets'].nil? && !input['request_params']['shared_targets'].to_s.empty?
431
+ raise ParameterRequiredError.new('shared_targets', 'DisableS2SharedTargetsInput')
432
+ end
433
+ end
434
+
435
+ public
436
+
437
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/enable_s2_shared_targets.html
438
+ def enable_s2_shared_targets(shared_targets: [])
439
+ input = {
440
+ config: config,
441
+ properties: properties,
442
+ api_name: 'EnableS2SharedTargets',
443
+ request_method: 'GET',
444
+ request_params: {
445
+ 'shared_targets' => shared_targets,
446
+ },
447
+ }
448
+
449
+ enable_s2_shared_targets_input_validate input
450
+
451
+ request = Request.new input
452
+ request.send
453
+ end
454
+
455
+ private
456
+
457
+ def enable_s2_shared_targets_input_validate(input)
458
+ input.deep_stringify_keys!
459
+
460
+ unless !input['request_params']['shared_targets'].nil? && !input['request_params']['shared_targets'].to_s.empty?
461
+ raise ParameterRequiredError.new('shared_targets', 'EnableS2SharedTargetsInput')
462
+ end
463
+ end
464
+
465
+ public
466
+
467
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/modify_s2_server.html
468
+ def modify_s2_server(description: '', s2_server: '', s2_server_name: '')
469
+ input = {
470
+ config: config,
471
+ properties: properties,
472
+ api_name: 'ModifyS2Server',
473
+ request_method: 'GET',
474
+ request_params: {
475
+ 'description' => description,
476
+ 's2_server' => s2_server,
477
+ 's2_server_name' => s2_server_name,
478
+ },
479
+ }
480
+
481
+ modify_s2_server_input_validate input
482
+
483
+ request = Request.new input
484
+ request.send
485
+ end
486
+
487
+ private
488
+
489
+ def modify_s2_server_input_validate(input)
490
+ input.deep_stringify_keys!
491
+
492
+ unless !input['request_params']['s2_server'].nil? && !input['request_params']['s2_server'].to_s.empty?
493
+ raise ParameterRequiredError.new('s2_server', 'ModifyS2ServerInput')
494
+ end
495
+ end
496
+
497
+ public
498
+
499
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/modify_s2_shared_target.html
500
+ def modify_s2_shared_targets(initiator_names: [], operation: '', parameters: [], shared_targets: [])
501
+ input = {
502
+ config: config,
503
+ properties: properties,
504
+ api_name: 'ModifyS2SharedTargets',
505
+ request_method: 'GET',
506
+ request_params: {
507
+ 'initiator_names' => initiator_names,
508
+ 'operation' => operation,
509
+ 'parameters' => parameters,
510
+ 'shared_targets' => shared_targets,
511
+ },
512
+ }
513
+
514
+ modify_s2_shared_targets_input_validate input
515
+
516
+ request = Request.new input
517
+ request.send
518
+ end
519
+
520
+ private
521
+
522
+ def modify_s2_shared_targets_input_validate(input)
523
+ input.deep_stringify_keys!
524
+
525
+ unless !input['request_params']['operation'].nil? && !input['request_params']['operation'].to_s.empty?
526
+ raise ParameterRequiredError.new('operation', 'ModifyS2SharedTargetsInput')
527
+ end
528
+
529
+ unless !input['request_params']['parameters'].nil? && !input['request_params']['parameters'].to_s.empty?
530
+ raise ParameterRequiredError.new('parameters', 'ModifyS2SharedTargetsInput')
531
+ end
532
+
533
+ unless !input['request_params']['shared_targets'].nil? && !input['request_params']['shared_targets'].to_s.empty?
534
+ raise ParameterRequiredError.new('shared_targets', 'ModifyS2SharedTargetsInput')
535
+ end
536
+ end
537
+
538
+ public
539
+
540
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/poweroff_s2_servers.html
541
+ def power_off_s2_servers(s2_servers: '')
542
+ input = {
543
+ config: config,
544
+ properties: properties,
545
+ api_name: 'PowerOffS2Servers',
546
+ request_method: 'GET',
547
+ request_params: {
548
+ 's2_servers' => s2_servers,
549
+ },
550
+ }
551
+
552
+ power_off_s2_servers_input_validate input
553
+
554
+ request = Request.new input
555
+ request.send
556
+ end
557
+
558
+ private
559
+
560
+ def power_off_s2_servers_input_validate(input)
561
+ input.deep_stringify_keys!
562
+
563
+ unless !input['request_params']['s2_servers'].nil? && !input['request_params']['s2_servers'].to_s.empty?
564
+ raise ParameterRequiredError.new('s2_servers', 'PowerOffS2ServersInput')
565
+ end
566
+ end
567
+
568
+ public
569
+
570
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/poweron_s2_servers.html
571
+ def power_on_s2_servers(s2_servers: [])
572
+ input = {
573
+ config: config,
574
+ properties: properties,
575
+ api_name: 'PowerOnS2Servers',
576
+ request_method: 'GET',
577
+ request_params: {
578
+ 's2_servers' => s2_servers,
579
+ },
580
+ }
581
+
582
+ power_on_s2_servers_input_validate input
583
+
584
+ request = Request.new input
585
+ request.send
586
+ end
587
+
588
+ private
589
+
590
+ def power_on_s2_servers_input_validate(input)
591
+ input.deep_stringify_keys!
592
+
593
+ unless !input['request_params']['s2_servers'].nil? && !input['request_params']['s2_servers'].to_s.empty?
594
+ raise ParameterRequiredError.new('s2_servers', 'PowerOnS2ServersInput')
595
+ end
596
+ end
597
+
598
+ public
599
+
600
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/resize_s2_servers.html
601
+ def resize_s2_servers(s2_server: '', s2_server_type: nil)
602
+ input = {
603
+ config: config,
604
+ properties: properties,
605
+ api_name: 'ResizeS2Servers',
606
+ request_method: 'GET',
607
+ request_params: {
608
+ 's2_server' => s2_server,
609
+ 's2_server_type' => s2_server_type,
610
+ },
611
+ }
612
+
613
+ resize_s2_servers_input_validate input
614
+
615
+ request = Request.new input
616
+ request.send
617
+ end
618
+
619
+ private
620
+
621
+ def resize_s2_servers_input_validate(input)
622
+ input.deep_stringify_keys!
623
+
624
+ unless !input['request_params']['s2_server'].nil? && !input['request_params']['s2_server'].to_s.empty?
625
+ raise ParameterRequiredError.new('s2_server', 'ResizeS2ServersInput')
626
+ end
627
+
628
+ unless !input['request_params']['s2_server_type'].nil? && !input['request_params']['s2_server_type'].to_s.empty?
629
+ raise ParameterRequiredError.new('s2_server_type', 'ResizeS2ServersInput')
630
+ end
631
+ end
632
+
633
+ public
634
+
635
+ # Documentation URL: https://docs.qingcloud.com/api/vsan/update_s2_servers.html
636
+ def update_s2_servers(s2_servers: [])
637
+ input = {
638
+ config: config,
639
+ properties: properties,
640
+ api_name: 'UpdateS2Servers',
641
+ request_method: 'GET',
642
+ request_params: {
643
+ 's2_servers' => s2_servers,
644
+ },
645
+ }
646
+
647
+ update_s2_servers_input_validate input
648
+
649
+ request = Request.new input
650
+ request.send
651
+ end
652
+
653
+ private
654
+
655
+ def update_s2_servers_input_validate(input)
656
+ input.deep_stringify_keys!
657
+
658
+ unless !input['request_params']['s2_servers'].nil? && !input['request_params']['s2_servers'].to_s.empty?
659
+ raise ParameterRequiredError.new('s2_servers', 'UpdateS2ServersInput')
660
+ end
661
+ end
662
+
663
+ public
664
+ end
665
+ end
666
+ end