google-cloud-org_policy-v2 0.2.2 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/cloud/org_policy/v2/org_policy/client.rb +202 -64
- data/lib/google/cloud/org_policy/v2/version.rb +1 -1
- data/lib/google/cloud/orgpolicy/v2/constraint_pb.rb +2 -2
- data/lib/google/cloud/orgpolicy/v2/orgpolicy_pb.rb +2 -2
- data/lib/google/cloud/orgpolicy/v2/orgpolicy_services_pb.rb +1 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/orgpolicy/v2/constraint.rb +5 -5
- data/proto_docs/google/cloud/orgpolicy/v2/orgpolicy.rb +9 -9
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be2800365a3c71827c305a5c1599a5ebee221e1fd86a3cc63a4a617ca6df38ca
|
4
|
+
data.tar.gz: 7361703073bea9cf27615c3dee2cf42f773ccdf6893bdbb23421a1687d1f003b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3e41c8c65b162466dddf11966486ac28c8a60e9787ef03ef16fdd4845efed07ecc3ee65cee5f61c0a8b834833f64a0e12077370306e509cfa7810b1c0e87f1
|
7
|
+
data.tar.gz: 501c207d22d3e927350c1f10d7b04037abf4a7021ffda5a30deec407089d74b54835cdef691dc1a273ede7bb5b608a9c9dacb7a62f5f7e59a3ce9df296d6dce0
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new # (request
|
|
37
37
|
response = client.list_constraints request
|
38
38
|
```
|
39
39
|
|
40
|
-
View the [Client Library Documentation](https://
|
40
|
+
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-org_policy-v2/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/resource-manager/docs/organization-policy/overview)
|
@@ -60,13 +60,12 @@ module Google
|
|
60
60
|
# See {::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client::Configuration}
|
61
61
|
# for a description of the configuration fields.
|
62
62
|
#
|
63
|
-
#
|
63
|
+
# @example
|
64
64
|
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# end
|
65
|
+
# # Modify the configuration for all OrgPolicy clients
|
66
|
+
# ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
|
67
|
+
# config.timeout = 10.0
|
68
|
+
# end
|
70
69
|
#
|
71
70
|
# @yield [config] Configure the Client client.
|
72
71
|
# @yieldparam config [Client::Configuration]
|
@@ -148,19 +147,15 @@ module Google
|
|
148
147
|
##
|
149
148
|
# Create a new OrgPolicy client object.
|
150
149
|
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
# To create a new OrgPolicy client with the default
|
154
|
-
# configuration:
|
150
|
+
# @example
|
155
151
|
#
|
156
|
-
#
|
152
|
+
# # Create a client using the default configuration
|
153
|
+
# client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
157
154
|
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
# config.timeout = 10.0
|
163
|
-
# end
|
155
|
+
# # Create a client using a custom configuration
|
156
|
+
# client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
|
157
|
+
# config.timeout = 10.0
|
158
|
+
# end
|
164
159
|
#
|
165
160
|
# @yield [config] Configure the OrgPolicy client.
|
166
161
|
# @yieldparam config [Client::Configuration]
|
@@ -180,10 +175,9 @@ module Google
|
|
180
175
|
|
181
176
|
# Create credentials
|
182
177
|
credentials = @config.credentials
|
183
|
-
# Use self-signed JWT if the
|
178
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
184
179
|
# but only if the default endpoint does not have a region prefix.
|
185
|
-
enable_self_signed_jwt = @config.
|
186
|
-
@config.endpoint == Client.configure.endpoint &&
|
180
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
187
181
|
!@config.endpoint.split(".").first.include?("-")
|
188
182
|
credentials ||= Credentials.default scope: @config.scope,
|
189
183
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -245,6 +239,27 @@ module Google
|
|
245
239
|
#
|
246
240
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
247
241
|
#
|
242
|
+
# @example Basic example
|
243
|
+
# require "google/cloud/org_policy/v2"
|
244
|
+
#
|
245
|
+
# # Create a client object. The client can be reused for multiple calls.
|
246
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
247
|
+
#
|
248
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
249
|
+
# request = Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new
|
250
|
+
#
|
251
|
+
# # Call the list_constraints method.
|
252
|
+
# result = client.list_constraints request
|
253
|
+
#
|
254
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
255
|
+
# # iterate over all elements by calling #each, and the enumerable
|
256
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
257
|
+
# # methods are also available for managing paging directly.
|
258
|
+
# result.each do |response|
|
259
|
+
# # Each element is of type ::Google::Cloud::OrgPolicy::V2::Constraint.
|
260
|
+
# p response
|
261
|
+
# end
|
262
|
+
#
|
248
263
|
def list_constraints request, options = nil
|
249
264
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
250
265
|
|
@@ -262,16 +277,20 @@ module Google
|
|
262
277
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
263
278
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
264
279
|
|
265
|
-
header_params = {
|
266
|
-
|
267
|
-
|
280
|
+
header_params = {}
|
281
|
+
if request.parent
|
282
|
+
header_params["parent"] = request.parent
|
283
|
+
end
|
284
|
+
|
268
285
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
269
286
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
270
287
|
|
271
288
|
options.apply_defaults timeout: @config.rpcs.list_constraints.timeout,
|
272
289
|
metadata: metadata,
|
273
290
|
retry_policy: @config.rpcs.list_constraints.retry_policy
|
274
|
-
|
291
|
+
|
292
|
+
options.apply_defaults timeout: @config.timeout,
|
293
|
+
metadata: @config.metadata,
|
275
294
|
retry_policy: @config.retry_policy
|
276
295
|
|
277
296
|
@org_policy_stub.call_rpc :list_constraints, request, options: options do |response, operation|
|
@@ -325,6 +344,27 @@ module Google
|
|
325
344
|
#
|
326
345
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
327
346
|
#
|
347
|
+
# @example Basic example
|
348
|
+
# require "google/cloud/org_policy/v2"
|
349
|
+
#
|
350
|
+
# # Create a client object. The client can be reused for multiple calls.
|
351
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
352
|
+
#
|
353
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
354
|
+
# request = Google::Cloud::OrgPolicy::V2::ListPoliciesRequest.new
|
355
|
+
#
|
356
|
+
# # Call the list_policies method.
|
357
|
+
# result = client.list_policies request
|
358
|
+
#
|
359
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
360
|
+
# # iterate over all elements by calling #each, and the enumerable
|
361
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
362
|
+
# # methods are also available for managing paging directly.
|
363
|
+
# result.each do |response|
|
364
|
+
# # Each element is of type ::Google::Cloud::OrgPolicy::V2::Policy.
|
365
|
+
# p response
|
366
|
+
# end
|
367
|
+
#
|
328
368
|
def list_policies request, options = nil
|
329
369
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
330
370
|
|
@@ -342,16 +382,20 @@ module Google
|
|
342
382
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
343
383
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
344
384
|
|
345
|
-
header_params = {
|
346
|
-
|
347
|
-
|
385
|
+
header_params = {}
|
386
|
+
if request.parent
|
387
|
+
header_params["parent"] = request.parent
|
388
|
+
end
|
389
|
+
|
348
390
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
349
391
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
350
392
|
|
351
393
|
options.apply_defaults timeout: @config.rpcs.list_policies.timeout,
|
352
394
|
metadata: metadata,
|
353
395
|
retry_policy: @config.rpcs.list_policies.retry_policy
|
354
|
-
|
396
|
+
|
397
|
+
options.apply_defaults timeout: @config.timeout,
|
398
|
+
metadata: @config.metadata,
|
355
399
|
retry_policy: @config.retry_policy
|
356
400
|
|
357
401
|
@org_policy_stub.call_rpc :list_policies, request, options: options do |response, operation|
|
@@ -396,6 +440,21 @@ module Google
|
|
396
440
|
#
|
397
441
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
398
442
|
#
|
443
|
+
# @example Basic example
|
444
|
+
# require "google/cloud/org_policy/v2"
|
445
|
+
#
|
446
|
+
# # Create a client object. The client can be reused for multiple calls.
|
447
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
448
|
+
#
|
449
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
450
|
+
# request = Google::Cloud::OrgPolicy::V2::GetPolicyRequest.new
|
451
|
+
#
|
452
|
+
# # Call the get_policy method.
|
453
|
+
# result = client.get_policy request
|
454
|
+
#
|
455
|
+
# # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
|
456
|
+
# p result
|
457
|
+
#
|
399
458
|
def get_policy request, options = nil
|
400
459
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
401
460
|
|
@@ -413,16 +472,20 @@ module Google
|
|
413
472
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
414
473
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
415
474
|
|
416
|
-
header_params = {
|
417
|
-
|
418
|
-
|
475
|
+
header_params = {}
|
476
|
+
if request.name
|
477
|
+
header_params["name"] = request.name
|
478
|
+
end
|
479
|
+
|
419
480
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
420
481
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
421
482
|
|
422
483
|
options.apply_defaults timeout: @config.rpcs.get_policy.timeout,
|
423
484
|
metadata: metadata,
|
424
485
|
retry_policy: @config.rpcs.get_policy.retry_policy
|
425
|
-
|
486
|
+
|
487
|
+
options.apply_defaults timeout: @config.timeout,
|
488
|
+
metadata: @config.metadata,
|
426
489
|
retry_policy: @config.retry_policy
|
427
490
|
|
428
491
|
@org_policy_stub.call_rpc :get_policy, request, options: options do |response, operation|
|
@@ -467,6 +530,21 @@ module Google
|
|
467
530
|
#
|
468
531
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
469
532
|
#
|
533
|
+
# @example Basic example
|
534
|
+
# require "google/cloud/org_policy/v2"
|
535
|
+
#
|
536
|
+
# # Create a client object. The client can be reused for multiple calls.
|
537
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
538
|
+
#
|
539
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
540
|
+
# request = Google::Cloud::OrgPolicy::V2::GetEffectivePolicyRequest.new
|
541
|
+
#
|
542
|
+
# # Call the get_effective_policy method.
|
543
|
+
# result = client.get_effective_policy request
|
544
|
+
#
|
545
|
+
# # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
|
546
|
+
# p result
|
547
|
+
#
|
470
548
|
def get_effective_policy request, options = nil
|
471
549
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
472
550
|
|
@@ -484,16 +562,20 @@ module Google
|
|
484
562
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
485
563
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
486
564
|
|
487
|
-
header_params = {
|
488
|
-
|
489
|
-
|
565
|
+
header_params = {}
|
566
|
+
if request.name
|
567
|
+
header_params["name"] = request.name
|
568
|
+
end
|
569
|
+
|
490
570
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
491
571
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
492
572
|
|
493
573
|
options.apply_defaults timeout: @config.rpcs.get_effective_policy.timeout,
|
494
574
|
metadata: metadata,
|
495
575
|
retry_policy: @config.rpcs.get_effective_policy.retry_policy
|
496
|
-
|
576
|
+
|
577
|
+
options.apply_defaults timeout: @config.timeout,
|
578
|
+
metadata: @config.metadata,
|
497
579
|
retry_policy: @config.retry_policy
|
498
580
|
|
499
581
|
@org_policy_stub.call_rpc :get_effective_policy, request, options: options do |response, operation|
|
@@ -545,6 +627,21 @@ module Google
|
|
545
627
|
#
|
546
628
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
547
629
|
#
|
630
|
+
# @example Basic example
|
631
|
+
# require "google/cloud/org_policy/v2"
|
632
|
+
#
|
633
|
+
# # Create a client object. The client can be reused for multiple calls.
|
634
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
635
|
+
#
|
636
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
637
|
+
# request = Google::Cloud::OrgPolicy::V2::CreatePolicyRequest.new
|
638
|
+
#
|
639
|
+
# # Call the create_policy method.
|
640
|
+
# result = client.create_policy request
|
641
|
+
#
|
642
|
+
# # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
|
643
|
+
# p result
|
644
|
+
#
|
548
645
|
def create_policy request, options = nil
|
549
646
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
550
647
|
|
@@ -562,16 +659,20 @@ module Google
|
|
562
659
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
563
660
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
564
661
|
|
565
|
-
header_params = {
|
566
|
-
|
567
|
-
|
662
|
+
header_params = {}
|
663
|
+
if request.parent
|
664
|
+
header_params["parent"] = request.parent
|
665
|
+
end
|
666
|
+
|
568
667
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
569
668
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
570
669
|
|
571
670
|
options.apply_defaults timeout: @config.rpcs.create_policy.timeout,
|
572
671
|
metadata: metadata,
|
573
672
|
retry_policy: @config.rpcs.create_policy.retry_policy
|
574
|
-
|
673
|
+
|
674
|
+
options.apply_defaults timeout: @config.timeout,
|
675
|
+
metadata: @config.metadata,
|
575
676
|
retry_policy: @config.retry_policy
|
576
677
|
|
577
678
|
@org_policy_stub.call_rpc :create_policy, request, options: options do |response, operation|
|
@@ -619,6 +720,21 @@ module Google
|
|
619
720
|
#
|
620
721
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
621
722
|
#
|
723
|
+
# @example Basic example
|
724
|
+
# require "google/cloud/org_policy/v2"
|
725
|
+
#
|
726
|
+
# # Create a client object. The client can be reused for multiple calls.
|
727
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
728
|
+
#
|
729
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
730
|
+
# request = Google::Cloud::OrgPolicy::V2::UpdatePolicyRequest.new
|
731
|
+
#
|
732
|
+
# # Call the update_policy method.
|
733
|
+
# result = client.update_policy request
|
734
|
+
#
|
735
|
+
# # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy.
|
736
|
+
# p result
|
737
|
+
#
|
622
738
|
def update_policy request, options = nil
|
623
739
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
624
740
|
|
@@ -636,16 +752,20 @@ module Google
|
|
636
752
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
637
753
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
638
754
|
|
639
|
-
header_params = {
|
640
|
-
|
641
|
-
|
755
|
+
header_params = {}
|
756
|
+
if request.policy&.name
|
757
|
+
header_params["policy.name"] = request.policy.name
|
758
|
+
end
|
759
|
+
|
642
760
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
643
761
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
644
762
|
|
645
763
|
options.apply_defaults timeout: @config.rpcs.update_policy.timeout,
|
646
764
|
metadata: metadata,
|
647
765
|
retry_policy: @config.rpcs.update_policy.retry_policy
|
648
|
-
|
766
|
+
|
767
|
+
options.apply_defaults timeout: @config.timeout,
|
768
|
+
metadata: @config.metadata,
|
649
769
|
retry_policy: @config.retry_policy
|
650
770
|
|
651
771
|
@org_policy_stub.call_rpc :update_policy, request, options: options do |response, operation|
|
@@ -689,6 +809,21 @@ module Google
|
|
689
809
|
#
|
690
810
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
691
811
|
#
|
812
|
+
# @example Basic example
|
813
|
+
# require "google/cloud/org_policy/v2"
|
814
|
+
#
|
815
|
+
# # Create a client object. The client can be reused for multiple calls.
|
816
|
+
# client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new
|
817
|
+
#
|
818
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
819
|
+
# request = Google::Cloud::OrgPolicy::V2::DeletePolicyRequest.new
|
820
|
+
#
|
821
|
+
# # Call the delete_policy method.
|
822
|
+
# result = client.delete_policy request
|
823
|
+
#
|
824
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
825
|
+
# p result
|
826
|
+
#
|
692
827
|
def delete_policy request, options = nil
|
693
828
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
694
829
|
|
@@ -706,16 +841,20 @@ module Google
|
|
706
841
|
gapic_version: ::Google::Cloud::OrgPolicy::V2::VERSION
|
707
842
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
708
843
|
|
709
|
-
header_params = {
|
710
|
-
|
711
|
-
|
844
|
+
header_params = {}
|
845
|
+
if request.name
|
846
|
+
header_params["name"] = request.name
|
847
|
+
end
|
848
|
+
|
712
849
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
713
850
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
714
851
|
|
715
852
|
options.apply_defaults timeout: @config.rpcs.delete_policy.timeout,
|
716
853
|
metadata: metadata,
|
717
854
|
retry_policy: @config.rpcs.delete_policy.retry_policy
|
718
|
-
|
855
|
+
|
856
|
+
options.apply_defaults timeout: @config.timeout,
|
857
|
+
metadata: @config.metadata,
|
719
858
|
retry_policy: @config.retry_policy
|
720
859
|
|
721
860
|
@org_policy_stub.call_rpc :delete_policy, request, options: options do |response, operation|
|
@@ -739,22 +878,21 @@ module Google
|
|
739
878
|
# Configuration can be applied globally to all clients, or to a single client
|
740
879
|
# on construction.
|
741
880
|
#
|
742
|
-
#
|
743
|
-
#
|
744
|
-
#
|
745
|
-
# to 20 seconds,
|
746
|
-
#
|
747
|
-
#
|
748
|
-
#
|
749
|
-
#
|
750
|
-
#
|
751
|
-
#
|
752
|
-
#
|
753
|
-
#
|
754
|
-
#
|
755
|
-
#
|
756
|
-
#
|
757
|
-
# end
|
881
|
+
# @example
|
882
|
+
#
|
883
|
+
# # Modify the global config, setting the timeout for
|
884
|
+
# # list_constraints to 20 seconds,
|
885
|
+
# # and all remaining timeouts to 10 seconds.
|
886
|
+
# ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.configure do |config|
|
887
|
+
# config.timeout = 10.0
|
888
|
+
# config.rpcs.list_constraints.timeout = 20.0
|
889
|
+
# end
|
890
|
+
#
|
891
|
+
# # Apply the above configuration only to a new client.
|
892
|
+
# client = ::Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new do |config|
|
893
|
+
# config.timeout = 10.0
|
894
|
+
# config.rpcs.list_constraints.timeout = 20.0
|
895
|
+
# end
|
758
896
|
#
|
759
897
|
# @!attribute [rw] endpoint
|
760
898
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/orgpolicy/v2/constraint.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/field_behavior_pb'
|
7
5
|
require 'google/api/resource_pb'
|
6
|
+
require 'google/protobuf'
|
7
|
+
|
8
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
9
|
add_file("google/cloud/orgpolicy/v2/constraint.proto", :syntax => :proto3) do
|
10
10
|
add_message "google.cloud.orgpolicy.v2.Constraint" do
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/orgpolicy/v2/orgpolicy.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -11,6 +9,8 @@ require 'google/cloud/orgpolicy/v2/constraint_pb'
|
|
11
9
|
require 'google/protobuf/empty_pb'
|
12
10
|
require 'google/protobuf/timestamp_pb'
|
13
11
|
require 'google/type/expr_pb'
|
12
|
+
require 'google/protobuf'
|
13
|
+
|
14
14
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
15
15
|
add_file("google/cloud/orgpolicy/v2/orgpolicy.proto", :syntax => :proto3) do
|
16
16
|
add_message "google.cloud.orgpolicy.v2.Policy" do
|
@@ -33,11 +33,7 @@ module Google
|
|
33
33
|
# // For Kubernetes resources, the format is {api group}/{kind}.
|
34
34
|
# option (google.api.resource) = {
|
35
35
|
# type: "pubsub.googleapis.com/Topic"
|
36
|
-
#
|
37
|
-
# pattern: "projects/{project}/topics/{topic}"
|
38
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
39
|
-
# parent_name_extractor: "projects/{project}"
|
40
|
-
# }
|
36
|
+
# pattern: "projects/{project}/topics/{topic}"
|
41
37
|
# };
|
42
38
|
# }
|
43
39
|
#
|
@@ -45,10 +41,7 @@ module Google
|
|
45
41
|
#
|
46
42
|
# resources:
|
47
43
|
# - type: "pubsub.googleapis.com/Topic"
|
48
|
-
#
|
49
|
-
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
-
# parent_name_extractor: "projects/{project}"
|
44
|
+
# pattern: "projects/{project}/topics/{topic}"
|
52
45
|
#
|
53
46
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
47
|
# live under multiple parents.
|
@@ -58,26 +51,10 @@ module Google
|
|
58
51
|
# message LogEntry {
|
59
52
|
# option (google.api.resource) = {
|
60
53
|
# type: "logging.googleapis.com/LogEntry"
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# }
|
66
|
-
# name_descriptor: {
|
67
|
-
# pattern: "folders/{folder}/logs/{log}"
|
68
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
69
|
-
# parent_name_extractor: "folders/{folder}"
|
70
|
-
# }
|
71
|
-
# name_descriptor: {
|
72
|
-
# pattern: "organizations/{organization}/logs/{log}"
|
73
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
74
|
-
# parent_name_extractor: "organizations/{organization}"
|
75
|
-
# }
|
76
|
-
# name_descriptor: {
|
77
|
-
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
78
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
79
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
80
|
-
# }
|
54
|
+
# pattern: "projects/{project}/logs/{log}"
|
55
|
+
# pattern: "folders/{folder}/logs/{log}"
|
56
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
57
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
81
58
|
# };
|
82
59
|
# }
|
83
60
|
#
|
@@ -85,48 +62,10 @@ module Google
|
|
85
62
|
#
|
86
63
|
# resources:
|
87
64
|
# - type: 'logging.googleapis.com/LogEntry'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# - pattern: "folders/{folder}/logs/{log}"
|
93
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
94
|
-
# parent_name_extractor: "folders/{folder}"
|
95
|
-
# - pattern: "organizations/{organization}/logs/{log}"
|
96
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
97
|
-
# parent_name_extractor: "organizations/{organization}"
|
98
|
-
# - pattern: "billingAccounts/{billing_account}/logs/{log}"
|
99
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
100
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
101
|
-
#
|
102
|
-
# For flexible resources, the resource name doesn't contain parent names, but
|
103
|
-
# the resource itself has parents for policy evaluation.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
#
|
107
|
-
# message Shelf {
|
108
|
-
# option (google.api.resource) = {
|
109
|
-
# type: "library.googleapis.com/Shelf"
|
110
|
-
# name_descriptor: {
|
111
|
-
# pattern: "shelves/{shelf}"
|
112
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
113
|
-
# }
|
114
|
-
# name_descriptor: {
|
115
|
-
# pattern: "shelves/{shelf}"
|
116
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
117
|
-
# }
|
118
|
-
# };
|
119
|
-
# }
|
120
|
-
#
|
121
|
-
# The ResourceDescriptor Yaml config will look like:
|
122
|
-
#
|
123
|
-
# resources:
|
124
|
-
# - type: 'library.googleapis.com/Shelf'
|
125
|
-
# name_descriptor:
|
126
|
-
# - pattern: "shelves/{shelf}"
|
127
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
128
|
-
# - pattern: "shelves/{shelf}"
|
129
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
65
|
+
# pattern: "projects/{project}/logs/{log}"
|
66
|
+
# pattern: "folders/{folder}/logs/{log}"
|
67
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
68
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
130
69
|
# @!attribute [rw] type
|
131
70
|
# @return [::String]
|
132
71
|
# The resource type. It must be in the format of
|
@@ -25,11 +25,11 @@ module Google
|
|
25
25
|
# example, you could enforce a constraint that controls which cloud services
|
26
26
|
# can be activated across an organization, or whether a Compute Engine instance
|
27
27
|
# can have serial port connections established. `Constraints` can be configured
|
28
|
-
# by the organization's policy
|
29
|
-
# by setting a `policy` that includes `constraints` at different
|
30
|
-
# the organization's resource hierarchy. Policies are inherited
|
31
|
-
# resource hierarchy from higher levels, but can also be overridden.
|
32
|
-
# details about the inheritance rules please read about
|
28
|
+
# by the organization's policy administrator to fit the needs of the
|
29
|
+
# organization by setting a `policy` that includes `constraints` at different
|
30
|
+
# locations in the organization's resource hierarchy. Policies are inherited
|
31
|
+
# down the resource hierarchy from higher levels, but can also be overridden.
|
32
|
+
# For details about the inheritance rules please read about
|
33
33
|
# [`policies`][google.cloud.OrgPolicy.v2.Policy].
|
34
34
|
#
|
35
35
|
# `Constraints` have a default behavior determined by the `constraint_default`
|
@@ -42,10 +42,7 @@ module Google
|
|
42
42
|
# Basic information about the Organization Policy.
|
43
43
|
# @!attribute [rw] alternate
|
44
44
|
# @return [::Google::Cloud::OrgPolicy::V2::AlternatePolicySpec]
|
45
|
-
#
|
46
|
-
# policy configurations as determined by the launch.
|
47
|
-
# Currently the only way the launch can trigger the alternate configuration
|
48
|
-
# is via dry-run/darklaunch.
|
45
|
+
# Deprecated.
|
49
46
|
class Policy
|
50
47
|
include ::Google::Protobuf::MessageExts
|
51
48
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -141,11 +138,14 @@ module Google
|
|
141
138
|
# in the evaluation of the policy. When set, the `expression` field in
|
142
139
|
# the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
|
143
140
|
# or "&&" operators. Each subexpression must be of the form
|
144
|
-
# "resource.
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
141
|
+
# "resource.matchTag('<ORG_ID>/tag_key_short_name,
|
142
|
+
# 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id',
|
143
|
+
# 'tagValues/value_id')". where key_name and value_name are the resource
|
144
|
+
# names for Label Keys and Values. These names are available from the Tag
|
145
|
+
# Manager Service. An example expression is:
|
146
|
+
# "resource.matchTag('123456789/environment,
|
147
|
+
# 'prod')". or "resource.matchTagId('tagKeys/123',
|
148
|
+
# 'tagValues/456')".
|
149
149
|
class PolicyRule
|
150
150
|
include ::Google::Protobuf::MessageExts
|
151
151
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-org_policy-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
|
-
rubygems_version: 3.
|
210
|
+
rubygems_version: 3.3.5
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: API Client library for the Organization Policy V2 API
|