qingcloudserver 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a203e9b54e993bdb1cca50a554af2fc3b97f736
4
- data.tar.gz: 24821582b6e9448f26f1e01c876d118ed7c01f8c
3
+ metadata.gz: 681864bd01c5b179cce3e81d386f546d123aa2ea
4
+ data.tar.gz: 3f2b93ab9a729142e2353c41760c0478fb946179
5
5
  SHA512:
6
- metadata.gz: b103de89956954b9c35448b7ab42ccfbbd9a7bbd30982597b57a26a852ffb115bc04a5021f9e859c3c60997745cd1b0af204f72cf220c68720333db298cf3639
7
- data.tar.gz: 2effec80db67230dafbb0fdfe6da2ed6616929841bf3366ba18484eafdfcad0f8a479a8ee042b4e5de85ceb5c663b540f2ecfbbcf8ea42a8bb54a8ebae738abf
6
+ metadata.gz: 9f900d9008f9ddf4d203a1233d21f22b6b71d8c21951684be939400a1b32a667a81a14880aa800d74c25051632237780707d7a3f9e8554411ee49377a0ff9078
7
+ data.tar.gz: 4b2c5f3dbd437ea2e317eb2c0184f5dab4ca78efe888642d7ce0c496f8d5f3298bbf6a239d3f9fdaeaaa71c8f5f0303504fd3c4855ef88c9f74ed50d84af5806
@@ -14,6 +14,70 @@ module QingCloudServer
14
14
  zone:
15
15
  )eval(make_action_and_params)
16
16
  end
17
+
18
+ def run_instances(
19
+ image_id:,
20
+ instance_type: nil,
21
+ cpu: nil,
22
+ memory: nil,
23
+ count: 1,
24
+ instance_name: nil,
25
+ login_mode:,
26
+ login_pair: nil,
27
+ login_passwd: nil,
28
+ vxnets_N: [],
29
+ security_group: nil,
30
+ volumes_N: [],
31
+ need_newsid: nil,
32
+ need_userdata: nil,
33
+ user_data_type: nil,
34
+ user_data_value: nil,
35
+ user_data_path: nil,
36
+ user_data_file: nil,
37
+ zone:)eval(make_action_and_params)
38
+ end
39
+
40
+ def terminate_instances(
41
+ instances_N:,
42
+ zone:
43
+ )eval(make_action_and_params)
44
+ end
45
+
46
+ def start_instances(
47
+ instances_N:,
48
+ zone:
49
+ )eval(make_action_and_params)
50
+ end
51
+
52
+ def stop_instances(
53
+ instances_N:,
54
+ force: nil,
55
+ zone:
56
+ )eval(make_action_and_params)
57
+ end
58
+
59
+ def restart_instances(
60
+ instances_N:,
61
+ zone:
62
+ )eval(make_action_and_params)
63
+ end
64
+
65
+ def resize_instances(
66
+ instances_N:,
67
+ instance_type: nil,
68
+ cpu: nil,
69
+ memory: nil,
70
+ zone:
71
+ )eval(make_action_and_params)
72
+ end
73
+
74
+ def modify_instance_attributes(
75
+ instance:,
76
+ instance_name: nil,
77
+ description: nil,
78
+ zone:
79
+ )eval(make_action_and_params)
80
+ end
17
81
  end
18
82
  end
19
83
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module QingCloudServer
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,9 +1,7 @@
1
1
  lib = File.expand_path("../lib", __FILE__)
2
- puts lib
3
2
 
4
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
4
 
6
- puts __FILE__
7
5
  require 'version'
8
6
  Gem::Specification.new do |spec|
9
7
  spec.name = "qingcloudserver"
data/test/server_test.rb CHANGED
@@ -3,6 +3,29 @@ require_relative '../lib/qingcloud_server'
3
3
  connector = QingCloudServer::Client::Connector.init("NULYIYWTTUXRAGENKRQM", "SKw7I862utQqhH98jTsKaxyWMybe2jrY0cF8EgE0")
4
4
  service = QingCloudServer::Client::Service.new(connector)
5
5
 
6
- service.describe_instances(status_N: ["running"], zone:'pek2', offset: 10, limit: 100, verbose: 1)
6
+ # tj = status_N: ["running"]
7
+ # tj = instances_N: ["i-j7rdjua9"]
8
+ # service.describe_instances(status_N: ["running"], zone:'pek2', offset: 10, limit: 100, verbose: 1)
7
9
 
8
- puts service.response
10
+ # puts "response.class is {service.response.class}"
11
+ # puts service.response
12
+
13
+ # service.run_instances(image_id: "img-e9stua0m", login_mode: "passwd", login_passwd: "Sillyboy12$", zone: "pek2", cpu:1, memory: 1024)
14
+ # puts "run_instances #{service.response}"
15
+
16
+ # service.terminate_instances(instances_N:["i-29stv83u"], zone: "pek2")
17
+ # puts "terminate_instances #{service.response}"
18
+
19
+
20
+ # service.stop_instances(instances_N: ["i-j7rdjua9"], zone: "pek2")
21
+
22
+ # service.restart_instances(instances_N: ["i-j7rdjua9"], zone: "pek2")
23
+ # puts service.response
24
+
25
+ # service.resize_instances(instances_N: ["i-j7rdjua9"], cpu: 1, memory: 1024, zone: "pek2")
26
+ # puts service.response
27
+
28
+ # service.start_instances(instances_N: ["i-j7rdjua9"], zone: "pek2")
29
+ # puts service.response
30
+
31
+ service.modify_instance_attributes(instance: "i-j7rdjua9", instance_name: "centos_test_yuehua", zone: "pek2")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qingcloudserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - gao yuehua