fog-google 1.7.1 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +0 -3
- data/CHANGELOG.md +45 -1
- data/CONTRIBUTING.md +11 -5
- data/README.md +0 -2
- data/fog-google.gemspec +4 -5
- data/lib/fog/bin/google.rb +4 -0
- data/lib/fog/compute/google/models/addresses.rb +9 -3
- data/lib/fog/compute/google/models/backend_services.rb +3 -2
- data/lib/fog/compute/google/models/disk_types.rb +5 -6
- data/lib/fog/compute/google/models/disks.rb +10 -4
- data/lib/fog/compute/google/models/firewalls.rb +3 -2
- data/lib/fog/compute/google/models/forwarding_rules.rb +8 -12
- data/lib/fog/compute/google/models/global_addresses.rb +3 -2
- data/lib/fog/compute/google/models/global_forwarding_rules.rb +3 -2
- data/lib/fog/compute/google/models/http_health_checks.rb +4 -3
- data/lib/fog/compute/google/models/images.rb +23 -12
- data/lib/fog/compute/google/models/instance_group_managers.rb +10 -7
- data/lib/fog/compute/google/models/instance_groups.rb +21 -15
- data/lib/fog/compute/google/models/instance_templates.rb +3 -2
- data/lib/fog/compute/google/models/machine_types.rb +13 -4
- data/lib/fog/compute/google/models/networks.rb +3 -2
- data/lib/fog/compute/google/models/operations.rb +8 -8
- data/lib/fog/compute/google/models/projects.rb +3 -2
- data/lib/fog/compute/google/models/regions.rb +3 -2
- data/lib/fog/compute/google/models/routes.rb +3 -2
- data/lib/fog/compute/google/models/servers.rb +7 -7
- data/lib/fog/compute/google/models/snapshots.rb +5 -4
- data/lib/fog/compute/google/models/ssl_certificates.rb +4 -3
- data/lib/fog/compute/google/models/subnetworks.rb +13 -7
- data/lib/fog/compute/google/models/target_http_proxies.rb +3 -2
- data/lib/fog/compute/google/models/target_https_proxies.rb +3 -2
- data/lib/fog/compute/google/models/target_instances.rb +8 -8
- data/lib/fog/compute/google/models/target_pools.rb +7 -10
- data/lib/fog/compute/google/models/url_maps.rb +3 -2
- data/lib/fog/compute/google/models/zones.rb +4 -2
- data/lib/fog/compute/google/real.rb +2 -0
- data/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +1 -2
- data/lib/fog/dns/google/real.rb +1 -0
- data/lib/fog/google/models/sql/instances.rb +4 -1
- data/lib/fog/google/monitoring/real.rb +1 -0
- data/lib/fog/google/pubsub/real.rb +1 -0
- data/lib/fog/google/shared.rb +15 -1
- data/lib/fog/google/sql/real.rb +1 -0
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json/real.rb +2 -0
- data/test/helpers/integration_test_helper.rb +2 -0
- data/test/helpers/test_collection.rb +26 -3
- data/test/integration/compute/core_compute/test_client_options.rb +12 -0
- data/test/integration/compute/core_compute/test_disk_types.rb +9 -0
- data/test/integration/compute/core_compute/test_images.rb +21 -0
- data/test/integration/compute/core_compute/test_machine_types.rb +13 -0
- data/test/integration/compute/core_compute/test_operations.rb +19 -1
- data/test/integration/compute/instance_groups/test_instance_group_managers.rb +1 -1
- data/test/integration/factories/addresses_factory.rb +4 -0
- data/test/integration/factories/collection_factory.rb +1 -1
- data/test/integration/factories/disks_factory.rb +4 -0
- data/test/integration/factories/forwarding_rules_factory.rb +4 -0
- data/test/integration/factories/images_factory.rb +4 -0
- data/test/integration/factories/instance_group_manager_factory.rb +8 -0
- data/test/integration/factories/instance_groups_factory.rb +4 -0
- data/test/integration/factories/servers_factory.rb +8 -0
- data/test/integration/factories/subnetworks_factory.rb +4 -0
- data/test/integration/factories/target_instances_factory.rb +4 -0
- data/test/integration/factories/target_pools_factory.rb +4 -0
- data/test/unit/compute/test_common_collections.rb +19 -8
- data/test/unit/compute/test_common_models.rb +10 -11
- data/test/unit/compute/test_server.rb +2 -1
- data/test/unit/dns/test_common_collections.rb +43 -0
- data/test/unit/monitoring/test_comon_collections.rb +44 -0
- data/test/unit/pubsub/test_common_collections.rb +35 -0
- data/test/unit/sql/test_common_collections.rb +46 -0
- data/test/unit/storage/test_common_json_collections.rb +38 -0
- data/test/unit/storage/test_common_xml_collections.rb +39 -0
- metadata +33 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c56136ffcc21e614018a5157077bcaf6315c740f
|
4
|
+
data.tar.gz: b9da25d90e07d29a3b1645d98776e7897206155a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 855a091e79a21628ce05c763310ea92b2bf1eb281316fedca9cb6cd6a166097064d2c9d7795f04950201e0c6478d7bd0ba4461215770b72b4e786e0fef380370
|
7
|
+
data.tar.gz: 95925fcea76bdec54634581318827e87c7d03b98acea750bedfed767437dbd0a03e5f520ac7e635177fcc9ff7d286a2e8443d8578646e94583dcf840d3976915
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,50 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
|
-
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
3
|
+
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
4
|
+
|
5
|
+
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## 1.8.0
|
8
|
+
|
9
|
+
### User-facing
|
10
|
+
|
11
|
+
#### Added
|
12
|
+
- \#418 Reintroduce client options for proxy support, etc. [AlexanderZagaynov]
|
13
|
+
|
14
|
+
#### Fixed
|
15
|
+
|
16
|
+
- \#419 Locked down fog upstream dependencies to alleviate deprecation warnings
|
17
|
+
until they can be properly dealt with. [temikus]
|
18
|
+
- \#400 Small `%Collection%.get` and `%Collection%.all` behaviour fixes [temikus]
|
19
|
+
- `Fog::Google::SQL::Instances.get(nil)` no longer returns an invalid
|
20
|
+
`sql#instancesList` object.
|
21
|
+
- `Fog::Compute::Google::InstanceGroups.get` and `.all` methods now support
|
22
|
+
more than just `:filter` option, fixed `.all` output without `zone` option.
|
23
|
+
- Fix a typo causing `Operations.get(region:REGION)` to fail.
|
24
|
+
- `Fog::Compute::Google::Images.get(IMAGE, PROJECT)`, now returns `nil` if
|
25
|
+
image is not found rather than throwing `Google::Apis::ClientError`.
|
26
|
+
|
27
|
+
### Development changes
|
28
|
+
|
29
|
+
#### Added
|
30
|
+
|
31
|
+
- \#400 Additional test coverage [temikus]
|
32
|
+
- Expanded tests for `%Collection%.get` behavior - scoped requests
|
33
|
+
(e.g. `get(zone:ZONE)`) and their corresponding code paths are now also
|
34
|
+
properly tested.
|
35
|
+
- Increase `Fog::Compute::Google::Images` integration test coverage.
|
36
|
+
- Unit tests now work without a `~/.fog` config file set up.
|
37
|
+
- Expanded unit test coverage.
|
38
|
+
- \#424 Add simple integration tests to check client proxy options being
|
39
|
+
applied.
|
40
|
+
|
41
|
+
#### Changed
|
42
|
+
|
43
|
+
- \#400 Refactored most compute `get()` and `all()` methods to common format. [temikus]
|
44
|
+
|
45
|
+
#### Fixed
|
46
|
+
|
47
|
+
- \#400 Removed the Travis Ruby 2.5 workaround. [temikus]
|
4
48
|
|
5
49
|
## 1.7.1
|
6
50
|
|
data/CONTRIBUTING.md
CHANGED
@@ -101,20 +101,26 @@ test:
|
|
101
101
|
Then you can run all the live tests:
|
102
102
|
|
103
103
|
```shell
|
104
|
-
$ rake test
|
104
|
+
$ bundle exec rake test
|
105
105
|
```
|
106
106
|
|
107
107
|
or just one API:
|
108
108
|
|
109
109
|
```
|
110
|
-
$ rake test:compute
|
110
|
+
$ bundle exec rake test:compute
|
111
111
|
```
|
112
112
|
(See `rake -T` for all available tasks)
|
113
113
|
|
114
|
-
or just one
|
114
|
+
or just one test:
|
115
115
|
|
116
116
|
```shell
|
117
|
-
$ rake test
|
117
|
+
$ bundle exec rake test TESTOPTS="--name=TestServers#test_bootstrap_ssh_destroy"
|
118
|
+
```
|
119
|
+
|
120
|
+
or a series of tests by name:
|
121
|
+
|
122
|
+
```
|
123
|
+
$ bundle exec rake test TESTOPTS="--name=/test_nil_get/"
|
118
124
|
```
|
119
125
|
|
120
126
|
#### Unit tests
|
@@ -133,7 +139,7 @@ We're in progress of extending the library with more unit tests and contribution
|
|
133
139
|
#### The transition from `shindo` to Minitest
|
134
140
|
|
135
141
|
Previously, [shindo](https://github.com/geemus/shindo) was the primary testing framework.
|
136
|
-
We've
|
142
|
+
We've moved away from it, and to Minitest, but some artifacts may remain.
|
137
143
|
|
138
144
|
For more information on transition, read [#50](https://github.com/fog/fog-google/issues/50).
|
139
145
|
|
data/README.md
CHANGED
@@ -42,8 +42,6 @@ We are always looking for people to improve our code and test coverage, so pleas
|
|
42
42
|
|
43
43
|
## Pubsub
|
44
44
|
|
45
|
-
Note: You **must** have a version of google-api-client > 0.8.5 to use the Pub/Sub API; previous versions will not work.
|
46
|
-
|
47
45
|
Fog mostly implements [v1](https://cloud.google.com/pubsub/docs/reference/rest/) of the Google Cloud Pub/Sub API; however some less common API methods are missing. Pull requests for additions would be greatly appreciated.
|
48
46
|
|
49
47
|
## Installation
|
data/fog-google.gemspec
CHANGED
@@ -20,15 +20,14 @@ Gem::Specification.new do |spec|
|
|
20
20
|
# As of 0.1.1
|
21
21
|
spec.required_ruby_version = "~> 2.0"
|
22
22
|
|
23
|
-
|
24
|
-
spec.add_dependency "fog-
|
25
|
-
spec.add_dependency "fog-
|
23
|
+
# Locked until https://github.com/fog/fog-google/issues/417 is resolved
|
24
|
+
spec.add_dependency "fog-core", ">= 2.0", "<= 2.1.0"
|
25
|
+
spec.add_dependency "fog-json", "~> 1.2.0"
|
26
|
+
spec.add_dependency "fog-xml", "~> 0.1.0"
|
26
27
|
|
27
28
|
# Hard Requirement as of 1.0
|
28
29
|
spec.add_dependency "google-api-client", "~> 0.23.0"
|
29
30
|
|
30
|
-
spec.add_development_dependency "mime-types"
|
31
|
-
|
32
31
|
# Debugger
|
33
32
|
spec.add_development_dependency "pry"
|
34
33
|
spec.add_development_dependency "pry-byebug"
|
data/lib/fog/bin/google.rb
CHANGED
@@ -15,6 +15,8 @@ module Google
|
|
15
15
|
Fog::Storage::Google
|
16
16
|
when :sql
|
17
17
|
Fog::Google::SQL
|
18
|
+
when :pubsub
|
19
|
+
Fog::Google::Pubsub
|
18
20
|
else
|
19
21
|
raise ArgumentError, "Unsupported #{self} service: #{key}"
|
20
22
|
end
|
@@ -33,6 +35,8 @@ module Google
|
|
33
35
|
Fog::Google::Monitoring.new
|
34
36
|
when :sql
|
35
37
|
Fog::Google::SQL.new
|
38
|
+
when :pubsub
|
39
|
+
Fog::Google::Pubsub.new
|
36
40
|
when :storage
|
37
41
|
Fog::Logger.warning("Google[:storage] is not recommended, use Storage[:google] for portability")
|
38
42
|
Fog::Storage.new(:provider => "Google")
|
@@ -23,9 +23,15 @@ module Fog
|
|
23
23
|
load(data.map(&:to_h))
|
24
24
|
end
|
25
25
|
|
26
|
-
def get(identity, region)
|
27
|
-
if
|
28
|
-
|
26
|
+
def get(identity, region = nil)
|
27
|
+
if region
|
28
|
+
address = service.get_address(identity, region).to_h
|
29
|
+
return new(address)
|
30
|
+
elsif identity
|
31
|
+
response = all(:filter => "name eq #{identity}",
|
32
|
+
:max_results => 1)
|
33
|
+
address = response.first unless response.empty?
|
34
|
+
return address
|
29
35
|
end
|
30
36
|
rescue ::Google::Apis::ClientError => e
|
31
37
|
raise e unless e.status_code == 404
|
@@ -10,8 +10,9 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(identity)
|
13
|
-
if
|
14
|
-
|
13
|
+
if identity
|
14
|
+
backend_service = service.get_backend_service(identity).to_h
|
15
|
+
return new(backend_service)
|
15
16
|
end
|
16
17
|
rescue ::Google::Apis::ClientError => e
|
17
18
|
raise e unless e.status_code == 404
|
@@ -24,15 +24,14 @@ module Fog
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def get(identity, zone = nil)
|
27
|
-
response = nil
|
28
27
|
if zone
|
29
|
-
|
28
|
+
disk_type = service.get_disk_type(identity, zone).to_h
|
29
|
+
return new(disk_type)
|
30
30
|
else
|
31
|
-
|
32
|
-
|
31
|
+
response = all(:filter => "name eq .*#{identity}")
|
32
|
+
disk_type = response.first unless response.empty?
|
33
|
+
return disk_type
|
33
34
|
end
|
34
|
-
return nil if response.nil?
|
35
|
-
new(response)
|
36
35
|
rescue ::Google::Apis::ClientError => e
|
37
36
|
raise e unless e.status_code == 404
|
38
37
|
nil
|
@@ -23,10 +23,16 @@ module Fog
|
|
23
23
|
load(data.map(&:to_h))
|
24
24
|
end
|
25
25
|
|
26
|
-
def get(identity, zone)
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
def get(identity, zone = nil)
|
27
|
+
if zone
|
28
|
+
disk = service.get_disk(identity, zone).to_h
|
29
|
+
return new(disk)
|
30
|
+
elsif identity
|
31
|
+
response = all(:filter => "name eq #{identity}",
|
32
|
+
:max_results => 1)
|
33
|
+
disk = response.first unless response.empty?
|
34
|
+
return disk
|
35
|
+
end
|
30
36
|
rescue ::Google::Apis::ClientError => e
|
31
37
|
raise e unless e.status_code == 404
|
32
38
|
nil
|
@@ -10,8 +10,9 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(identity)
|
13
|
-
if
|
14
|
-
|
13
|
+
if identity
|
14
|
+
firewall = service.get_firewall(identity).to_h
|
15
|
+
return new(firewall)
|
15
16
|
end
|
16
17
|
rescue ::Google::Apis::ClientError => e
|
17
18
|
raise e unless e.status_code == 404
|
@@ -4,9 +4,7 @@ module Fog
|
|
4
4
|
class ForwardingRules < Fog::Collection
|
5
5
|
model Fog::Compute::Google::ForwardingRule
|
6
6
|
|
7
|
-
def all(region: nil, filter: nil, max_results: nil,
|
8
|
-
order_by: nil, page_token: nil)
|
9
|
-
|
7
|
+
def all(region: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil)
|
10
8
|
opts = {
|
11
9
|
:filter => filter,
|
12
10
|
:max_results => max_results,
|
@@ -15,7 +13,7 @@ module Fog
|
|
15
13
|
}
|
16
14
|
|
17
15
|
if region
|
18
|
-
data = service.list_forwarding_rules(region, opts).items
|
16
|
+
data = service.list_forwarding_rules(region, opts).items || []
|
19
17
|
else
|
20
18
|
data = []
|
21
19
|
service.list_aggregated_forwarding_rules(opts).items
|
@@ -29,18 +27,16 @@ module Fog
|
|
29
27
|
end
|
30
28
|
|
31
29
|
def get(identity, region = nil)
|
32
|
-
response = nil
|
33
30
|
if region
|
34
|
-
|
35
|
-
|
31
|
+
forwarding_rule = service.get_forwarding_rule(identity, region).to_h
|
32
|
+
return new(forwarding_rule)
|
33
|
+
elsif identity
|
36
34
|
response = all(
|
37
35
|
:filter => "name eq #{identity}", :max_results => 1
|
38
|
-
)
|
39
|
-
|
36
|
+
)
|
37
|
+
forwarding_rule = response.first unless response.empty?
|
38
|
+
return forwarding_rule
|
40
39
|
end
|
41
|
-
|
42
|
-
return nil if response.nil?
|
43
|
-
new(response)
|
44
40
|
end
|
45
41
|
end
|
46
42
|
end
|
@@ -10,8 +10,9 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(identity)
|
13
|
-
if
|
14
|
-
|
13
|
+
if identity
|
14
|
+
address = service.get_global_address(identity).to_h
|
15
|
+
return new(address)
|
15
16
|
end
|
16
17
|
rescue ::Google::Apis::ClientError => e
|
17
18
|
raise e unless e.status_code == 404
|
@@ -10,8 +10,9 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(identity)
|
13
|
-
if
|
14
|
-
|
13
|
+
if identity
|
14
|
+
rule = service.get_global_forwarding_rule(identity).to_h
|
15
|
+
return new(rule)
|
15
16
|
end
|
16
17
|
rescue ::Google::Apis::ClientError => e
|
17
18
|
raise e unless e.status_code == 404
|
@@ -10,9 +10,10 @@ module Fog
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def get(identity)
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if identity
|
14
|
+
http_health_check = service.get_http_health_check(identity).to_h
|
15
|
+
return new(http_health_check)
|
16
|
+
end
|
16
17
|
rescue ::Google::Apis::ClientError => e
|
17
18
|
raise e unless e.status_code == 404
|
18
19
|
nil
|
@@ -46,22 +46,33 @@ module Fog
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def get(identity, project = nil)
|
49
|
-
|
50
|
-
data = nil
|
51
|
-
projects.each do |proj|
|
49
|
+
if project
|
52
50
|
begin
|
53
|
-
|
54
|
-
|
51
|
+
image = service.get_image(identity, project).to_h
|
52
|
+
# TODO: Remove response modification - see #405
|
53
|
+
image[:project] = project
|
54
|
+
return new(image)
|
55
55
|
rescue ::Google::Apis::ClientError => e
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
raise e unless e.status_code == 404
|
57
|
+
nil
|
58
|
+
end
|
59
|
+
elsif identity
|
60
|
+
projects = all_projects
|
61
|
+
projects.each do |proj|
|
62
|
+
begin
|
63
|
+
response = service.get_image(identity, proj).to_h
|
64
|
+
# TODO: Remove response modification - see #405
|
65
|
+
response[:project] = proj
|
66
|
+
image = response
|
67
|
+
return new(image)
|
68
|
+
rescue ::Google::Apis::ClientError => e
|
69
|
+
next if e.status_code == 404
|
70
|
+
break
|
71
|
+
end
|
60
72
|
end
|
73
|
+
# If nothing is found - return nil
|
74
|
+
nil
|
61
75
|
end
|
62
|
-
|
63
|
-
return nil if data.nil?
|
64
|
-
new(data)
|
65
76
|
end
|
66
77
|
|
67
78
|
def get_from_family(family, project = nil)
|
@@ -12,10 +12,11 @@ module Fog
|
|
12
12
|
:order_by => order_by,
|
13
13
|
:page_token => page_token
|
14
14
|
}
|
15
|
-
|
15
|
+
|
16
16
|
if zone
|
17
|
-
data
|
17
|
+
data = service.list_instance_group_managers(zone, opts).items || []
|
18
18
|
else
|
19
|
+
data = []
|
19
20
|
service.list_aggregated_instance_group_managers(opts).items.each_value do |group|
|
20
21
|
data.concat(group.instance_group_managers) if group.instance_group_managers
|
21
22
|
end
|
@@ -26,11 +27,13 @@ module Fog
|
|
26
27
|
|
27
28
|
def get(identity, zone = nil)
|
28
29
|
if zone
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
instance_group_manager = service.get_instance_group_manager(identity, zone).to_h
|
31
|
+
return new(instance_group_manager)
|
32
|
+
elsif identity
|
33
|
+
response = all(:filter => "name eq .*#{identity}",
|
34
|
+
:max_results => 1)
|
35
|
+
instance_group_manager = response.first unless response.empty?
|
36
|
+
return instance_group_manager
|
34
37
|
end
|
35
38
|
rescue ::Google::Apis::ClientError => e
|
36
39
|
raise e unless e.status_code == 404
|
@@ -4,13 +4,20 @@ module Fog
|
|
4
4
|
class InstanceGroups < Fog::Collection
|
5
5
|
model Fog::Compute::Google::InstanceGroup
|
6
6
|
|
7
|
-
def all(
|
8
|
-
|
9
|
-
|
7
|
+
def all(zone: nil, filter: nil, max_results: nil, order_by: nil, page_token: nil)
|
8
|
+
opts = {
|
9
|
+
:filter => filter,
|
10
|
+
:max_results => max_results,
|
11
|
+
:order_by => order_by,
|
12
|
+
:page_token => page_token
|
13
|
+
}
|
14
|
+
|
15
|
+
if zone
|
16
|
+
data = service.list_instance_groups(zone).items || []
|
10
17
|
else
|
11
18
|
data = []
|
12
|
-
service.list_aggregated_instance_groups.items.each_value do |group|
|
13
|
-
data.concat(group.instance_groups) if group.instance_groups
|
19
|
+
service.list_aggregated_instance_groups(opts).items.each_value do |group|
|
20
|
+
data.concat(group.instance_groups) if group && group.instance_groups
|
14
21
|
end
|
15
22
|
end
|
16
23
|
|
@@ -18,19 +25,18 @@ module Fog
|
|
18
25
|
end
|
19
26
|
|
20
27
|
def get(identity, zone = nil)
|
21
|
-
if zone
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if instance_group = service.get_instance_group(identity, zone)
|
30
|
-
new(instance_group.to_h)
|
28
|
+
if zone
|
29
|
+
instance_group = service.get_instance_group(identity, zone).to_h
|
30
|
+
new(instance_group)
|
31
|
+
elsif identity
|
32
|
+
response = all(:filter => "name eq #{identity}",
|
33
|
+
:max_results => 1)
|
34
|
+
instance_group = response.first unless response.empty?
|
35
|
+
return instance_group
|
31
36
|
end
|
32
37
|
rescue ::Google::Apis::ClientError => e
|
33
38
|
raise e unless e.status_code == 404
|
39
|
+
|
34
40
|
nil
|
35
41
|
end
|
36
42
|
|