conoha 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6fb2275c7b8a0ad745c9a58c098a54aa154d9fc
4
- data.tar.gz: f25a49bee97f120f50f2da13e05e6b65aa649553
3
+ metadata.gz: 3f5266895c3c98745e194b4e17f7476f6d6ca4b6
4
+ data.tar.gz: 5f82c4aa52832bc8565a8b70508e4e08abfc7973
5
5
  SHA512:
6
- metadata.gz: 1b472e30ac3f1d4ffe7976a9afe6f03b3b67d98f0069c82fc43c150512c5ac3aa248b60841c0175af6e1f2eb1e5bf58e9d4ff8cb9e16264511c36e75bca66c2f
7
- data.tar.gz: 817669cbe7475fb4bb447b86315b02f574eea2f96831c78c0195f6240c62ef5c9713d95e9e9a3b68e324742c121432465a51db2501d690a93c7325348bfae5d6
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.9.2"
2
+ ITSELF = "0.9.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conoha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka