gclouder 0.3.3 → 0.3.4

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: a3d5b7fc191f80a8781d50968f36e2e2d12158e6
4
- data.tar.gz: 3edbc8c7847aa6f1c8e838c9e09fc6ca38597bc6
3
+ metadata.gz: b8e46cb82d233980a2b308eec883bb71d3e3a02f
4
+ data.tar.gz: 47b7bbc60e71464fcc02b8bb414a1e9181c224f3
5
5
  SHA512:
6
- metadata.gz: 589f26c1eb2aac42cedac86f65597dcab009fa0411cfac0d0d3c8ee6af7f52fd4763a466a62a1197b394eb0c8dbd193cc04e82f7649e21c9347e8ac4686581ad
7
- data.tar.gz: 3201256c58043d96d6bde5ae2a14d30c3576873cf7d8569b71b86b15a650b1cbb9ede0185bad7fdbdf4b2480111496303fe962f495486351956bcaa810382796
6
+ metadata.gz: e282a5a64a3630e34ad1bf65a1dfb49688a474ddbc9a34985c07b36afa4dc2deebfb11feddd7b6773c46e048dd156b33c234d57a77597b1f7de4db0cc097fbec
7
+ data.tar.gz: 2e87c04b249c6d299435fd7dae95f1220ff0a2b3b7a1110ade613bfa4bb1a929b92921b01a9e1e55ef1e7f68fd94e7f8d178348afceb4f53d5aad048a1462d2f
@@ -33,14 +33,14 @@ module GClouder
33
33
  gcloud "#{resource} describe #{name} #{args}", force: force, failure: failure, silent: silent, project_id: project_id
34
34
  end
35
35
 
36
- def self.ensure(resource, name, args = nil, project_id: nil, extra_info: nil, silent: false, indent: 3, filter_key: "name")
37
- return if resource?(resource, name, project_id: project_id, extra_info: extra_info, silent: silent, indent: indent, filter_key: filter_key)
36
+ def self.ensure(resource, name, args = nil, project_id: nil, extra_info: nil, silent: false, indent: 3, filter_key: "name", filter: nil)
37
+ return if resource?(resource, name, project_id: project_id, extra_info: extra_info, silent: silent, indent: indent, filter_key: filter_key, filter: filter)
38
38
  feedback("add", resource, name, extra_info: extra_info, indent: indent, silent: silent)
39
39
  gcloud "#{resource} create #{name} #{args}", project_id: project_id, silent: silent
40
40
  end
41
41
 
42
- def self.purge(resource, name, args = nil, project_id: nil, silent: false, indent: 3)
43
- return unless resource?(resource, name, project_id: project_id, silent: true, indent: indent)
42
+ def self.purge(resource, name, args = nil, project_id: nil, silent: false, indent: 3, filter: nil)
43
+ return unless resource?(resource, name, project_id: project_id, silent: true, indent: indent, filter: filter)
44
44
  extra_info = "[skipped] (--purge not specified)" unless cli_args[:purge]
45
45
  feedback("remove", resource, name, extra_info: extra_info, indent: indent, silent: silent)
46
46
  gcloud "#{resource} delete #{name} #{args}", project_id: project_id if cli_args[:purge]
@@ -21,7 +21,7 @@ module GClouder
21
21
  info region, indent: 2, heading: true
22
22
  info
23
23
  subscriptions.each do |subscription|
24
- Subscription.ensure(subscription)
24
+ Subscription.ensure(subscription['name'])
25
25
  end
26
26
  end
27
27
  end
@@ -87,11 +87,11 @@ module GClouder
87
87
  end
88
88
 
89
89
  def self.ensure(subscription)
90
- Resource.ensure :"beta pubsub subscriptions", subscription["name"], args(subscription), filter_key: "subscriptionId", indent: 3
90
+ Resource.ensure :"beta pubsub subscriptions", subscription["name"], args(subscription), filter: "name ~ ^.*\/#{subscription}$", indent: 3
91
91
  end
92
92
 
93
93
  def self.purge(subscription)
94
- Resource.purge :"beta pubsub subscriptions", subscription["name"]
94
+ Resource.purge :"beta pubsub subscriptions", subscription["name"], filter: "name ~ ^.*\/#{subscription}$"
95
95
  end
96
96
  end
97
97
  end
@@ -82,11 +82,11 @@ module GClouder
82
82
  include GClouder::GCloud
83
83
 
84
84
  def self.ensure(topic)
85
- Resource.ensure :"beta pubsub topics", topic, filter_key: "topicId"
85
+ Resource.ensure :"beta pubsub topics", topic, filter: "name ~ ^.*\/#{topic}$"
86
86
  end
87
87
 
88
88
  def self.purge(topic)
89
- Resource.purge :"beta pubsub topics", topic
89
+ Resource.purge :"beta pubsub topics", topic, filter: "name ~ ^.*\/#{topic}$"
90
90
  end
91
91
  end
92
92
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module GClouder
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gclouder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Wilson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-24 00:00:00.000000000 Z
12
+ date: 2018-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: trollop