gcloud-cli 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/gcloud/cli.rb +13 -3
- data/lib/gcloud/cli/version.rb +1 -1
- data/spec/cli_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjQyNjFmNWY2ZTAxNmE4OGEyM2Q1NDMwMGZjNzUzZmFhMDRlYzczMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGIyMjY5YWU5ZWFiZmIzZTgwMGQ4NzE3YTU1Mzc0Y2MzNTgzNDI2OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODAxZmQzNzg0MWJjOWFlYWNmMjc5YWVkODM4YzMxZTk1ZDUyNWY1YmVhMDcw
|
10
|
+
YWNhM2U0NWUxMDFlNjRkYzg1NDRmMGNlZmUxYTY0YzYwMGE2MDVkYzNiNWEz
|
11
|
+
N2EyYTMzNDhiYmFlNGNhM2E3YmQzM2NlZTBmMjM5MDhiMzBhMjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTA5OGVlZTE2ZGZjM2I0NmFmNDhhNWQ0Y2YxZDZmN2FjZDk4M2E4ODM4MzMy
|
14
|
+
ZjViYTkwN2VhMWRjNDMwZWNmYjYwNmY2MDU3MTU3YTYxODk0MDFkOTFjMDkz
|
15
|
+
N2I0YzE1MTE4NTMyMDhjMWJmYWM3NGFhYzMxYTQ1Y2EwYjg0Y2I=
|
data/lib/gcloud/cli.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'rest_client'
|
2
2
|
require 'gcloud/cli/version'
|
3
3
|
require 'gcloud/cli/config_repository'
|
4
|
+
require 'json'
|
4
5
|
|
5
6
|
module Gcloud
|
6
7
|
module Cli
|
7
|
-
|
8
|
+
extend self
|
8
9
|
|
9
|
-
def create_gorgon_cluster
|
10
|
+
def create_gorgon_cluster(grid_configuration_name)
|
10
11
|
config = ConfigRepository.find_or_create
|
11
|
-
result = JSON[
|
12
|
+
result = JSON[post_create_cluster(config, grid_configuration_name)]
|
12
13
|
|
13
14
|
{ cluster_id: result['cluster_id'] }
|
14
15
|
end
|
@@ -17,5 +18,14 @@ module Gcloud
|
|
17
18
|
config = ConfigRepository.find_or_create
|
18
19
|
RestClient.post(config.release_cluster_url(cluster_id), api_key: config.api_key)
|
19
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def post_create_cluster(config, grid_configuration_name)
|
25
|
+
RestClient.post(config.create_cluster_url,
|
26
|
+
api_key: config.api_key,
|
27
|
+
grid_configuration_name: grid_configuration_name
|
28
|
+
)
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
data/lib/gcloud/cli/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -7,11 +7,13 @@ module Gcloud::Cli
|
|
7
7
|
|
8
8
|
it "loads config and posts request" do
|
9
9
|
allow(ConfigRepository).to receive(:load).and_return(Config.new(url, api_key))
|
10
|
+
expect(RestClient).to receive(:post).
|
11
|
+
with("#{url}/clusters", api_key: api_key, grid_configuration_name: 'that_grid').
|
12
|
+
and_return(JSON[cluster_id: 'a-cluster-id'])
|
10
13
|
|
11
|
-
|
12
|
-
and_return(JSON[cluster_id: 'a-cluster-id'])
|
14
|
+
result = Gcloud::Cli.create_gorgon_cluster('that_grid')
|
13
15
|
|
14
|
-
expect(
|
16
|
+
expect(result).to eq({cluster_id: 'a-cluster-id'})
|
15
17
|
end
|
16
18
|
|
17
19
|
it "posts relases cluster request" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcloud-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arturo Pie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|