conoha 0.9.2 → 0.9.3
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 +4 -4
- data/README.md +4 -0
- data/lib/conoha.rb +7 -1
- data/lib/conoha/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f5266895c3c98745e194b4e17f7476f6d6ca4b6
|
4
|
+
data.tar.gz: 5f82c4aa52832bc8565a8b70508e4e08abfc7973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1625910c7dae949bc98ab1a1d5cc2548ebb1e1cb4aa93831a03f38c0f72f38f7e41aa06cba5dfc97f1c16c8aaa7c483f7de683303cd7c60c6805e8a820d9abc
|
7
|
+
data.tar.gz: 57ca23cf8570d4c53855d32bad45ffe48e9f4c1583f7df57600e2faf54a788cecc7289638f48ba664f3d2149a8e8d655f1a73ce567efd20f23ec504c36ebd0ce
|
data/README.md
CHANGED
@@ -60,6 +60,7 @@ conoha create ubuntu g-1gb
|
|
60
60
|
# Create VPSs with other options
|
61
61
|
conoha create centos72 g-2gb
|
62
62
|
conoha create arch g-4gb
|
63
|
+
conoha create ubuntu g-1gb nametagasyoulike
|
63
64
|
|
64
65
|
# You can check VPS UUIDs
|
65
66
|
conoha vpslist
|
@@ -120,6 +121,9 @@ conoha dump 01234567-89ab-cdef-0123-456789abcdef something-backup
|
|
120
121
|
|
121
122
|
# Restore VPS (just a synonym of "createfromimage")
|
122
123
|
conoha restore something-backup
|
124
|
+
|
125
|
+
# Get name tag
|
126
|
+
conoha nametag 01234567-89ab-cdef-0123-456789abcdef
|
123
127
|
```
|
124
128
|
|
125
129
|
## Test
|
data/lib/conoha.rb
CHANGED
@@ -91,10 +91,13 @@ class Conoha
|
|
91
91
|
servers.map { |e| e["id"] }
|
92
92
|
end
|
93
93
|
|
94
|
+
# @param [String] os
|
95
|
+
# @param [String] ram
|
96
|
+
# @param [String] name_tag (default: nil)
|
94
97
|
# @raise [StandardError]
|
95
98
|
# when "os" doesn't exist in image_tag_dictionary
|
96
99
|
# when "image_tag" doesn't exist in images
|
97
|
-
def self.create(os, ram)
|
100
|
+
def self.create(os, ram, name_tag = nil)
|
98
101
|
image_ref = image_ref_from_image_tag(image_tag_dictionary(os))
|
99
102
|
uri = "https://compute.#{region}.conoha.io/v2/#{tenant_id}/servers"
|
100
103
|
payload = {
|
@@ -106,6 +109,9 @@ class Conoha
|
|
106
109
|
security_groups: [{name: 'default'}, {name: 'gncs-ipv4-all'}],
|
107
110
|
}
|
108
111
|
}
|
112
|
+
if name_tag
|
113
|
+
payload[:server].merge!({metadata: {instance_name_tag: name_tag}})
|
114
|
+
end
|
109
115
|
res = https_post uri, payload, authtoken
|
110
116
|
JSON.parse(res.body)["server"]["id"]
|
111
117
|
end
|
data/lib/conoha/version.rb
CHANGED