google-cloud-resource_manager 0.33.2 → 0.36.1
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/CHANGELOG.md +30 -0
- data/CONTRIBUTING.md +4 -5
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google-cloud-resource_manager.rb +1 -0
- data/lib/google/cloud/resource_manager.rb +1 -1
- data/lib/google/cloud/resource_manager/credentials.rb +11 -12
- data/lib/google/cloud/resource_manager/policy.rb +6 -5
- data/lib/google/cloud/resource_manager/project.rb +4 -4
- data/lib/google/cloud/resource_manager/project/list.rb +3 -3
- data/lib/google/cloud/resource_manager/project/updater.rb +5 -11
- data/lib/google/cloud/resource_manager/service.rb +3 -2
- data/lib/google/cloud/resource_manager/version.rb +1 -1
- metadata +23 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dbe1df5de6105e9c7cbfb1fc7d8a0aa6b0513ff362454d30bae89ea4fd7e1dc
|
4
|
+
data.tar.gz: f7ca2eb4dd3ce34de7b3f47e3615b513140d9942ca3bfa8e39e7008d9e794a12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 471ee4fde3389f3b3e3b28c06b2108a44f9cdfc741ca13e1557982c4260a4a280acf31fae06f18188cf33fb709258a91f0cbe93baa639720c7f377191c30a494
|
7
|
+
data.tar.gz: a3fe8cdfc0034d48d0be70ae4b52ab4f1df8ca11a205127345c01e079b6d7d8df629371bdcb9f608452c2c9fb7f52b8dbb4d42dc3c71189a8f4821fb4f7433a1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,35 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.36.1 / 2021-06-17
|
4
|
+
|
5
|
+
#### Bug Fixes
|
6
|
+
|
7
|
+
* Expand googleauth dependency to support future 1.x versions
|
8
|
+
|
9
|
+
### 0.36.0 / 2021-03-10
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* Drop support for Ruby 2.4 and add support for Ruby 3.0
|
14
|
+
|
15
|
+
### 0.35.0 / 2021-01-13
|
16
|
+
|
17
|
+
#### Features
|
18
|
+
|
19
|
+
* Replace google-api-client with google-apis-cloudresourcemanager_v1
|
20
|
+
|
21
|
+
### 0.34.0 / 2020-09-16
|
22
|
+
|
23
|
+
#### Features
|
24
|
+
|
25
|
+
* quota_project can be set via library configuration
|
26
|
+
|
27
|
+
### 0.33.3 / 2020-05-28
|
28
|
+
|
29
|
+
#### Documentation
|
30
|
+
|
31
|
+
* Fix a few broken links
|
32
|
+
|
3
33
|
### 0.33.2 / 2020-04-01
|
4
34
|
|
5
35
|
#### Documentation
|
data/CONTRIBUTING.md
CHANGED
@@ -24,7 +24,7 @@ be able to accept your pull requests.
|
|
24
24
|
In order to use the google-cloud-resource_manager console and run the project's
|
25
25
|
tests, there is a small amount of setup:
|
26
26
|
|
27
|
-
1. Install Ruby. google-cloud-resource_manager requires Ruby 2.
|
27
|
+
1. Install Ruby. google-cloud-resource_manager requires Ruby 2.5+. You may
|
28
28
|
choose to manage your Ruby and gem installations with [RVM](https://rvm.io/),
|
29
29
|
[rbenv](https://github.com/rbenv/rbenv), or
|
30
30
|
[chruby](https://github.com/postmodern/chruby).
|
@@ -45,7 +45,7 @@ tests, there is a small amount of setup:
|
|
45
45
|
|
46
46
|
```sh
|
47
47
|
$ cd google-cloud-resource_manager/
|
48
|
-
$ bundle
|
48
|
+
$ bundle install
|
49
49
|
```
|
50
50
|
|
51
51
|
## Console
|
@@ -120,7 +120,7 @@ If you alter an example's title, you may encounter breaking tests.
|
|
120
120
|
### Resource Manager Acceptance Tests
|
121
121
|
|
122
122
|
The Resource Manager acceptance tests interact with the live service API. Follow
|
123
|
-
the instructions in the {file:AUTHENTICATION.md Authentication
|
123
|
+
the instructions in the {file:AUTHENTICATION.md Authentication Guide} for
|
124
124
|
enabling the Resource Manager API. Occasionally, some API features may not yet
|
125
125
|
be generally available, making it difficult for some contributors to
|
126
126
|
successfully run the entire acceptance test suite. However, please ensure that
|
@@ -128,8 +128,7 @@ you do successfully run acceptance tests for any code areas covered by your pull
|
|
128
128
|
request.
|
129
129
|
|
130
130
|
To run the acceptance tests, first create and configure a project in the Google
|
131
|
-
Developers Console, as described in the {file:AUTHENTICATION.md Authentication
|
132
|
-
guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
131
|
+
Developers Console, as described in the {file:AUTHENTICATION.md Authentication Guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
133
132
|
the KEYFILE location on your system.
|
134
133
|
|
135
134
|
Before you can run the Resource Manager acceptance tests, you must first create
|
data/TROUBLESHOOTING.md
CHANGED
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
|
|
24
24
|
|
25
25
|
- [New issue][gh-ruby]
|
26
26
|
|
27
|
-
Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
|
28
|
-
can use the "ruby" channel for general Ruby questions, or use the
|
29
|
-
"google-cloud-ruby" channel if you have questions about this gem in particular.
|
30
|
-
|
31
27
|
[so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+resourcemanager
|
32
28
|
|
33
|
-
[gh-search-ruby]: https://github.com/
|
34
|
-
|
35
|
-
[gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
|
29
|
+
[gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+resource+manager%22
|
36
30
|
|
37
|
-
[
|
31
|
+
[gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
|
@@ -125,6 +125,7 @@ Google::Cloud.configure.add_config! :resource_manager do |config|
|
|
125
125
|
allow_nil: true
|
126
126
|
config.add_alias! :keyfile, :credentials
|
127
127
|
config.add_field! :scope, nil, match: [String, Array]
|
128
|
+
config.add_field! :quota_project, nil, match: String
|
128
129
|
config.add_field! :retries, nil, match: Integer
|
129
130
|
config.add_field! :timeout, nil, match: Integer
|
130
131
|
config.add_field! :endpoint, nil, match: String
|
@@ -80,7 +80,7 @@ module Google
|
|
80
80
|
|
81
81
|
ResourceManager::Manager.new(
|
82
82
|
ResourceManager::Service.new(
|
83
|
-
credentials, retries: retries, timeout: timeout, host: endpoint
|
83
|
+
credentials, retries: retries, timeout: timeout, host: endpoint, quota_project: configure.quota_project
|
84
84
|
)
|
85
85
|
)
|
86
86
|
end
|
@@ -36,18 +36,17 @@ module Google
|
|
36
36
|
#
|
37
37
|
class Credentials < Google::Auth::Credentials
|
38
38
|
SCOPE = ["https://www.googleapis.com/auth/cloud-platform"].freeze
|
39
|
-
PATH_ENV_VARS =
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
JSON_ENV_VARS =
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
DEFAULT_PATHS =
|
50
|
-
["~/.config/gcloud/application_default_credentials.json"].freeze
|
39
|
+
PATH_ENV_VARS = ["RESOURCE_MANAGER_CREDENTIALS",
|
40
|
+
"RESOURCE_MANAGER_KEYFILE",
|
41
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
42
|
+
"GOOGLE_CLOUD_KEYFILE",
|
43
|
+
"GCLOUD_KEYFILE"].freeze
|
44
|
+
JSON_ENV_VARS = ["RESOURCE_MANAGER_CREDENTIALS_JSON",
|
45
|
+
"RESOURCE_MANAGER_KEYFILE_JSON",
|
46
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
47
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
48
|
+
"GCLOUD_KEYFILE_JSON"].freeze
|
49
|
+
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"].freeze
|
51
50
|
end
|
52
51
|
end
|
53
52
|
end
|
@@ -53,7 +53,7 @@ module Google
|
|
53
53
|
# roles with an array of members. See [Understanding
|
54
54
|
# Roles](https://cloud.google.com/iam/docs/understanding-roles) for a
|
55
55
|
# listing of primitive and curated roles. See
|
56
|
-
# [Binding](https://cloud.google.com/resource-manager/reference/
|
56
|
+
# [Binding](https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding)
|
57
57
|
# for a listing of values and patterns for members.
|
58
58
|
#
|
59
59
|
# @example
|
@@ -73,7 +73,8 @@ module Google
|
|
73
73
|
# Alias to the Google Client API module
|
74
74
|
API = Google::Apis::CloudresourcemanagerV1
|
75
75
|
|
76
|
-
attr_reader :etag
|
76
|
+
attr_reader :etag
|
77
|
+
attr_reader :roles
|
77
78
|
|
78
79
|
##
|
79
80
|
# @private Creates a Policy object.
|
@@ -87,7 +88,7 @@ module Google
|
|
87
88
|
# See [Understanding
|
88
89
|
# Roles](https://cloud.google.com/iam/docs/understanding-roles) for a
|
89
90
|
# listing of primitive and curated roles. See
|
90
|
-
# [Binding](https://cloud.google.com/resource-manager/reference/
|
91
|
+
# [Binding](https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding)
|
91
92
|
# for a listing of values and patterns for members.
|
92
93
|
#
|
93
94
|
# @param [String] role_name A Cloud IAM role, such as `"roles/owner"`.
|
@@ -113,7 +114,7 @@ module Google
|
|
113
114
|
# policy. See [Understanding
|
114
115
|
# Roles](https://cloud.google.com/iam/docs/understanding-roles) for a
|
115
116
|
# listing of primitive and curated roles. See
|
116
|
-
# [Binding](https://cloud.google.com/resource-manager/reference/
|
117
|
+
# [Binding](https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding)
|
117
118
|
# for a listing of values and patterns for members.
|
118
119
|
#
|
119
120
|
# @param [String] role_name A Cloud IAM role, such as `"roles/owner"`.
|
@@ -140,7 +141,7 @@ module Google
|
|
140
141
|
# {#roles}. See [Understanding
|
141
142
|
# Roles](https://cloud.google.com/iam/docs/understanding-roles) for a
|
142
143
|
# listing of primitive and curated roles. See
|
143
|
-
# [Binding](https://cloud.google.com/resource-manager/reference/
|
144
|
+
# [Binding](https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Binding)
|
144
145
|
# for a listing of values and patterns for members.
|
145
146
|
#
|
146
147
|
# @return [Array<String>] The members strings, or an empty array.
|
@@ -102,10 +102,10 @@ module Google
|
|
102
102
|
# The labels associated with this project.
|
103
103
|
#
|
104
104
|
# Label keys must be between 1 and 63 characters long and must conform
|
105
|
-
# to the regular expression
|
105
|
+
# to the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`.
|
106
106
|
#
|
107
107
|
# Label values must be between 0 and 63 characters long and must conform
|
108
|
-
# to the regular expression
|
108
|
+
# to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
|
109
109
|
#
|
110
110
|
# No more than 256 labels can be associated with a given resource.
|
111
111
|
# (`Hash`)
|
@@ -144,10 +144,10 @@ module Google
|
|
144
144
|
# Updates the labels associated with this project.
|
145
145
|
#
|
146
146
|
# Label keys must be between 1 and 63 characters long and must conform
|
147
|
-
# to the regular expression
|
147
|
+
# to the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`.
|
148
148
|
#
|
149
149
|
# Label values must be between 0 and 63 characters long and must conform
|
150
|
-
# to the regular expression
|
150
|
+
# to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
|
151
151
|
#
|
152
152
|
# No more than 256 labels can be associated with a given resource.
|
153
153
|
# (`Hash`)
|
@@ -122,17 +122,17 @@ module Google
|
|
122
122
|
# puts project.project_id
|
123
123
|
# end
|
124
124
|
#
|
125
|
-
def all request_limit: nil
|
125
|
+
def all request_limit: nil, &block
|
126
126
|
request_limit = request_limit.to_i if request_limit
|
127
127
|
unless block_given?
|
128
128
|
return enum_for :all, request_limit: request_limit
|
129
129
|
end
|
130
130
|
results = self
|
131
131
|
loop do
|
132
|
-
results.each
|
132
|
+
results.each(&block)
|
133
133
|
if request_limit
|
134
134
|
request_limit -= 1
|
135
|
-
break if request_limit
|
135
|
+
break if request_limit.negative?
|
136
136
|
end
|
137
137
|
break unless results.next?
|
138
138
|
results = results.next
|
@@ -37,12 +37,6 @@ module Google
|
|
37
37
|
# end
|
38
38
|
#
|
39
39
|
class Updater < DelegateClass(Project)
|
40
|
-
##
|
41
|
-
# @private Create an Updater object.
|
42
|
-
def initialize project
|
43
|
-
super project
|
44
|
-
end
|
45
|
-
|
46
40
|
##
|
47
41
|
# Updates the user-assigned name of the project. This field is
|
48
42
|
# optional and can remain unset.
|
@@ -68,11 +62,11 @@ module Google
|
|
68
62
|
#
|
69
63
|
# Label keys must be between 1 and 63 characters long and must conform
|
70
64
|
# to the following regular expression:
|
71
|
-
#
|
65
|
+
# `[a-z]([-a-z0-9]*[a-z0-9])?`.
|
72
66
|
#
|
73
67
|
# Label values must be between 0 and 63 characters long and must
|
74
68
|
# conform to the regular expression
|
75
|
-
#
|
69
|
+
# `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
|
76
70
|
#
|
77
71
|
# No more than 256 labels can be associated with a given resource.
|
78
72
|
# (`Hash`)
|
@@ -95,11 +89,11 @@ module Google
|
|
95
89
|
#
|
96
90
|
# Label keys must be between 1 and 63 characters long and must conform
|
97
91
|
# to the following regular expression:
|
98
|
-
#
|
92
|
+
# `[a-z]([-a-z0-9]*[a-z0-9])?`.
|
99
93
|
#
|
100
94
|
# Label values must be between 0 and 63 characters long and must
|
101
95
|
# conform to the regular expression
|
102
|
-
#
|
96
|
+
# `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
|
103
97
|
#
|
104
98
|
# No more than 256 labels can be associated with a given resource.
|
105
99
|
# (`Hash`)
|
@@ -146,7 +140,7 @@ module Google
|
|
146
140
|
##
|
147
141
|
# @private Create an Updater object.
|
148
142
|
def self.from_project project
|
149
|
-
dupe_gapi = project.gapi.class.new
|
143
|
+
dupe_gapi = project.gapi.class.new(**project.gapi.to_h)
|
150
144
|
dupe_project = Project.from_gapi dupe_gapi, nil # no way to update
|
151
145
|
Updater.new dupe_project
|
152
146
|
end
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
|
34
34
|
##
|
35
35
|
# Creates a new Service instance.
|
36
|
-
def initialize credentials, retries: nil, timeout: nil, host: nil
|
36
|
+
def initialize credentials, retries: nil, timeout: nil, host: nil, quota_project: nil
|
37
37
|
@credentials = credentials
|
38
38
|
@service = API::CloudResourceManagerService.new
|
39
39
|
@service.client_options.application_name = \
|
@@ -48,6 +48,7 @@ module Google
|
|
48
48
|
@service.request_options.header["x-goog-api-client"] = \
|
49
49
|
"gl-ruby/#{RUBY_VERSION} " \
|
50
50
|
"gccl/#{Google::Cloud::ResourceManager::VERSION}"
|
51
|
+
@service.request_options.quota_project = quota_project if quota_project
|
51
52
|
@service.authorization = @credentials.client
|
52
53
|
@service.root_url = host if host
|
53
54
|
end
|
@@ -80,7 +81,7 @@ module Google
|
|
80
81
|
project_attrs = {
|
81
82
|
project_id: project_id, name: name, labels: labels, parent: parent
|
82
83
|
}.delete_if { |_, v| v.nil? }
|
83
|
-
execute { service.create_project API::Project.new(project_attrs) }
|
84
|
+
execute { service.create_project API::Project.new(**project_attrs) }
|
84
85
|
end
|
85
86
|
|
86
87
|
##
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-resource_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.36.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -17,70 +17,76 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '1.
|
20
|
+
version: '1.6'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '1.
|
27
|
+
version: '1.6'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name: google-
|
29
|
+
name: google-apis-cloudresourcemanager_v1
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '0.
|
34
|
+
version: '0.1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '0.
|
41
|
+
version: '0.1'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: googleauth
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 0.16.2
|
49
|
+
- - "<"
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 2.a
|
49
52
|
type: :runtime
|
50
53
|
prerelease: false
|
51
54
|
version_requirements: !ruby/object:Gem::Requirement
|
52
55
|
requirements:
|
53
|
-
- - "
|
56
|
+
- - ">="
|
54
57
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
58
|
+
version: 0.16.2
|
59
|
+
- - "<"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.a
|
56
62
|
- !ruby/object:Gem::Dependency
|
57
63
|
name: google-style
|
58
64
|
requirement: !ruby/object:Gem::Requirement
|
59
65
|
requirements:
|
60
66
|
- - "~>"
|
61
67
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.
|
68
|
+
version: 1.25.1
|
63
69
|
type: :development
|
64
70
|
prerelease: false
|
65
71
|
version_requirements: !ruby/object:Gem::Requirement
|
66
72
|
requirements:
|
67
73
|
- - "~>"
|
68
74
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.
|
75
|
+
version: 1.25.1
|
70
76
|
- !ruby/object:Gem::Dependency
|
71
77
|
name: minitest
|
72
78
|
requirement: !ruby/object:Gem::Requirement
|
73
79
|
requirements:
|
74
80
|
- - "~>"
|
75
81
|
- !ruby/object:Gem::Version
|
76
|
-
version: '5.
|
82
|
+
version: '5.14'
|
77
83
|
type: :development
|
78
84
|
prerelease: false
|
79
85
|
version_requirements: !ruby/object:Gem::Requirement
|
80
86
|
requirements:
|
81
87
|
- - "~>"
|
82
88
|
- !ruby/object:Gem::Version
|
83
|
-
version: '5.
|
89
|
+
version: '5.14'
|
84
90
|
- !ruby/object:Gem::Dependency
|
85
91
|
name: minitest-autotest
|
86
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,14 +240,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
240
|
requirements:
|
235
241
|
- - ">="
|
236
242
|
- !ruby/object:Gem::Version
|
237
|
-
version: '2.
|
243
|
+
version: '2.5'
|
238
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
245
|
requirements:
|
240
246
|
- - ">="
|
241
247
|
- !ruby/object:Gem::Version
|
242
248
|
version: '0'
|
243
249
|
requirements: []
|
244
|
-
rubygems_version: 3.
|
250
|
+
rubygems_version: 3.2.17
|
245
251
|
signing_key:
|
246
252
|
specification_version: 4
|
247
253
|
summary: API Client library for Google Cloud Resource Manager
|