google-apis-orgpolicy_v2 0.8.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/OVERVIEW.md +3 -3
- data/lib/google/apis/orgpolicy_v2/classes.rb +98 -0
- data/lib/google/apis/orgpolicy_v2/gem_version.rb +2 -2
- data/lib/google/apis/orgpolicy_v2/representations.rb +36 -0
- data/lib/google/apis/orgpolicy_v2/service.rb +39 -1
- data/lib/google/apis/orgpolicy_v2.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f63c0eebe65aa8a12f09eb1b46b57ec920f340b5b13cc6bac3ceecba00aac589
|
4
|
+
data.tar.gz: '096770bc86f9fa2136ca0d03944705ff059d2b25a9c8a3811e0a850eaa6d9460'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e8331ebedd0e889c55214474ee5d8d22641f07765610684d10d3dc1c19872380704c9214ec781d6c63d0d9c9e312c9171d4f6006e1e12db9e9e6546b70d5e30
|
7
|
+
data.tar.gz: 5dc5936e4689d08f0e2beba036c271d58c7b2b67dce22ecea4d2e47f78684f232fd210453bf87e88c778e6bcb5cc86a8e67aa04cc538cb77f4a0f366c2d21f39
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Release history for google-apis-orgpolicy_v2
|
2
2
|
|
3
|
+
### v0.12.0 (2022-01-11)
|
4
|
+
|
5
|
+
* Regenerated from discovery document revision 20220107
|
6
|
+
|
7
|
+
### v0.11.0 (2021-12-14)
|
8
|
+
|
9
|
+
* Unspecified changes
|
10
|
+
|
11
|
+
### v0.10.0 (2021-12-02)
|
12
|
+
|
13
|
+
* Regenerated from discovery document revision 20211130
|
14
|
+
|
15
|
+
### v0.9.0 (2021-10-21)
|
16
|
+
|
17
|
+
* Unspecified changes
|
18
|
+
|
3
19
|
### v0.8.0 (2021-10-08)
|
4
20
|
|
5
21
|
* Regenerated from discovery document revision 20211006
|
data/OVERVIEW.md
CHANGED
@@ -51,7 +51,7 @@ require "google/apis/orgpolicy_v2"
|
|
51
51
|
client = Google::Apis::OrgpolicyV2::OrgPolicyAPIService.new
|
52
52
|
|
53
53
|
# Authenticate calls
|
54
|
-
client.
|
54
|
+
client.authorization = # ... use the googleauth gem to create credentials
|
55
55
|
```
|
56
56
|
|
57
57
|
See the class reference docs for information on the methods you can call from a client.
|
@@ -60,8 +60,8 @@ See the class reference docs for information on the methods you can call from a
|
|
60
60
|
|
61
61
|
More detailed descriptions of the Google simple REST clients are available in two documents.
|
62
62
|
|
63
|
-
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/
|
64
|
-
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/
|
63
|
+
* The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
|
64
|
+
* The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
|
65
65
|
|
66
66
|
(Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Orgpolicy service in particular.)
|
67
67
|
|
@@ -22,6 +22,34 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module OrgpolicyV2
|
24
24
|
|
25
|
+
# Similar to PolicySpec but with an extra 'launch' field for launch reference.
|
26
|
+
# The PolicySpec here is specific for dry-run/darklaunch.
|
27
|
+
class GoogleCloudOrgpolicyV2AlternatePolicySpec
|
28
|
+
include Google::Apis::Core::Hashable
|
29
|
+
|
30
|
+
# Reference to the launch that will be used while audit logging and to control
|
31
|
+
# the launch. Should be set only in the alternate policy.
|
32
|
+
# Corresponds to the JSON property `launch`
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :launch
|
35
|
+
|
36
|
+
# Defines a Cloud Organization `PolicySpec` which is used to specify `
|
37
|
+
# Constraints` for configurations of Cloud Platform resources.
|
38
|
+
# Corresponds to the JSON property `spec`
|
39
|
+
# @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2PolicySpec]
|
40
|
+
attr_accessor :spec
|
41
|
+
|
42
|
+
def initialize(**args)
|
43
|
+
update!(**args)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Update properties of this object
|
47
|
+
def update!(**args)
|
48
|
+
@launch = args[:launch] if args.key?(:launch)
|
49
|
+
@spec = args[:spec] if args.key?(:spec)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
25
53
|
# A `constraint` describes a way to restrict resource's configuration. For
|
26
54
|
# example, you could enforce a constraint that controls which cloud services can
|
27
55
|
# be activated across an organization, or whether a Compute Engine instance can
|
@@ -137,6 +165,69 @@ module Google
|
|
137
165
|
end
|
138
166
|
end
|
139
167
|
|
168
|
+
# A custom constraint defined by customers which can *only* be applied to the
|
169
|
+
# given resource types and organization. By creating a custom constraint,
|
170
|
+
# customers can applied policies of this custom constraint. *Creating a custom
|
171
|
+
# constraint itself does NOT apply any policy enforcement*.
|
172
|
+
class GoogleCloudOrgpolicyV2CustomConstraint
|
173
|
+
include Google::Apis::Core::Hashable
|
174
|
+
|
175
|
+
# Allow or deny type.
|
176
|
+
# Corresponds to the JSON property `actionType`
|
177
|
+
# @return [String]
|
178
|
+
attr_accessor :action_type
|
179
|
+
|
180
|
+
# Org policy condition/expression. For example: `resource.instanceName.matches("[
|
181
|
+
# production|test]_.*_(\d)+")'` or, `resource.management.auto_upgrade == true`
|
182
|
+
# Corresponds to the JSON property `condition`
|
183
|
+
# @return [String]
|
184
|
+
attr_accessor :condition
|
185
|
+
|
186
|
+
# Detailed information about this custom policy constraint.
|
187
|
+
# Corresponds to the JSON property `description`
|
188
|
+
# @return [String]
|
189
|
+
attr_accessor :description
|
190
|
+
|
191
|
+
# One line display name for the UI.
|
192
|
+
# Corresponds to the JSON property `displayName`
|
193
|
+
# @return [String]
|
194
|
+
attr_accessor :display_name
|
195
|
+
|
196
|
+
# All the operations being applied for this constraint.
|
197
|
+
# Corresponds to the JSON property `methodTypes`
|
198
|
+
# @return [Array<String>]
|
199
|
+
attr_accessor :method_types
|
200
|
+
|
201
|
+
# Immutable. Name of the constraint. This is unique within the organization.
|
202
|
+
# Format of the name should be * `organizations/`organization_id`/
|
203
|
+
# customConstraints/`custom_constraint_id`` Example : "organizations/123/
|
204
|
+
# customConstraints/custom.createOnlyE2TypeVms"
|
205
|
+
# Corresponds to the JSON property `name`
|
206
|
+
# @return [String]
|
207
|
+
attr_accessor :name
|
208
|
+
|
209
|
+
# Immutable. The Resource Instance type on which this policy applies to. Format
|
210
|
+
# will be of the form : "/" Example: * `compute.googleapis.com/Instance`.
|
211
|
+
# Corresponds to the JSON property `resourceTypes`
|
212
|
+
# @return [Array<String>]
|
213
|
+
attr_accessor :resource_types
|
214
|
+
|
215
|
+
def initialize(**args)
|
216
|
+
update!(**args)
|
217
|
+
end
|
218
|
+
|
219
|
+
# Update properties of this object
|
220
|
+
def update!(**args)
|
221
|
+
@action_type = args[:action_type] if args.key?(:action_type)
|
222
|
+
@condition = args[:condition] if args.key?(:condition)
|
223
|
+
@description = args[:description] if args.key?(:description)
|
224
|
+
@display_name = args[:display_name] if args.key?(:display_name)
|
225
|
+
@method_types = args[:method_types] if args.key?(:method_types)
|
226
|
+
@name = args[:name] if args.key?(:name)
|
227
|
+
@resource_types = args[:resource_types] if args.key?(:resource_types)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
140
231
|
# The response returned from the ListConstraints method.
|
141
232
|
class GoogleCloudOrgpolicyV2ListConstraintsResponse
|
142
233
|
include Google::Apis::Core::Hashable
|
@@ -195,6 +286,12 @@ module Google
|
|
195
286
|
class GoogleCloudOrgpolicyV2Policy
|
196
287
|
include Google::Apis::Core::Hashable
|
197
288
|
|
289
|
+
# Similar to PolicySpec but with an extra 'launch' field for launch reference.
|
290
|
+
# The PolicySpec here is specific for dry-run/darklaunch.
|
291
|
+
# Corresponds to the JSON property `alternate`
|
292
|
+
# @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2AlternatePolicySpec]
|
293
|
+
attr_accessor :alternate
|
294
|
+
|
198
295
|
# Immutable. The resource name of the Policy. Must be one of the following forms,
|
199
296
|
# where constraint_name is the name of the constraint which this Policy
|
200
297
|
# configures: * `projects/`project_number`/policies/`constraint_name`` * `
|
@@ -219,6 +316,7 @@ module Google
|
|
219
316
|
|
220
317
|
# Update properties of this object
|
221
318
|
def update!(**args)
|
319
|
+
@alternate = args[:alternate] if args.key?(:alternate)
|
222
320
|
@name = args[:name] if args.key?(:name)
|
223
321
|
@spec = args[:spec] if args.key?(:spec)
|
224
322
|
end
|
@@ -16,13 +16,13 @@ module Google
|
|
16
16
|
module Apis
|
17
17
|
module OrgpolicyV2
|
18
18
|
# Version of the google-apis-orgpolicy_v2 gem
|
19
|
-
GEM_VERSION = "0.
|
19
|
+
GEM_VERSION = "0.12.0"
|
20
20
|
|
21
21
|
# Version of the code generator used to generate this client
|
22
22
|
GENERATOR_VERSION = "0.4.0"
|
23
23
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
25
|
-
REVISION = "
|
25
|
+
REVISION = "20220107"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -22,6 +22,12 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module OrgpolicyV2
|
24
24
|
|
25
|
+
class GoogleCloudOrgpolicyV2AlternatePolicySpec
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
25
31
|
class GoogleCloudOrgpolicyV2Constraint
|
26
32
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
33
|
|
@@ -40,6 +46,12 @@ module Google
|
|
40
46
|
include Google::Apis::Core::JsonObjectSupport
|
41
47
|
end
|
42
48
|
|
49
|
+
class GoogleCloudOrgpolicyV2CustomConstraint
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
43
55
|
class GoogleCloudOrgpolicyV2ListConstraintsResponse
|
44
56
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
57
|
|
@@ -88,6 +100,15 @@ module Google
|
|
88
100
|
include Google::Apis::Core::JsonObjectSupport
|
89
101
|
end
|
90
102
|
|
103
|
+
class GoogleCloudOrgpolicyV2AlternatePolicySpec
|
104
|
+
# @private
|
105
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
106
|
+
property :launch, as: 'launch'
|
107
|
+
property :spec, as: 'spec', class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2PolicySpec, decorator: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2PolicySpec::Representation
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
91
112
|
class GoogleCloudOrgpolicyV2Constraint
|
92
113
|
# @private
|
93
114
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -116,6 +137,19 @@ module Google
|
|
116
137
|
end
|
117
138
|
end
|
118
139
|
|
140
|
+
class GoogleCloudOrgpolicyV2CustomConstraint
|
141
|
+
# @private
|
142
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
143
|
+
property :action_type, as: 'actionType'
|
144
|
+
property :condition, as: 'condition'
|
145
|
+
property :description, as: 'description'
|
146
|
+
property :display_name, as: 'displayName'
|
147
|
+
collection :method_types, as: 'methodTypes'
|
148
|
+
property :name, as: 'name'
|
149
|
+
collection :resource_types, as: 'resourceTypes'
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
119
153
|
class GoogleCloudOrgpolicyV2ListConstraintsResponse
|
120
154
|
# @private
|
121
155
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -137,6 +171,8 @@ module Google
|
|
137
171
|
class GoogleCloudOrgpolicyV2Policy
|
138
172
|
# @private
|
139
173
|
class Representation < Google::Apis::Core::JsonRepresentation
|
174
|
+
property :alternate, as: 'alternate', class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2AlternatePolicySpec, decorator: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2AlternatePolicySpec::Representation
|
175
|
+
|
140
176
|
property :name, as: 'name'
|
141
177
|
property :spec, as: 'spec', class: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2PolicySpec, decorator: Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2PolicySpec::Representation
|
142
178
|
|
@@ -22,7 +22,7 @@ module Google
|
|
22
22
|
module OrgpolicyV2
|
23
23
|
# Organization Policy API
|
24
24
|
#
|
25
|
-
# The Org Policy API allows users to configure governance
|
25
|
+
# The Org Policy API allows users to configure governance rules on their GCP
|
26
26
|
# resources across the Cloud Resource Hierarchy.
|
27
27
|
#
|
28
28
|
# @example
|
@@ -350,6 +350,44 @@ module Google
|
|
350
350
|
execute_or_queue_command(command, &block)
|
351
351
|
end
|
352
352
|
|
353
|
+
# Updates a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.
|
354
|
+
# Code.NOT_FOUND` if the constraint does not exist. Note: the supplied policy
|
355
|
+
# will perform a full overwrite of all fields.
|
356
|
+
# @param [String] name
|
357
|
+
# Immutable. Name of the constraint. This is unique within the organization.
|
358
|
+
# Format of the name should be * `organizations/`organization_id`/
|
359
|
+
# customConstraints/`custom_constraint_id`` Example : "organizations/123/
|
360
|
+
# customConstraints/custom.createOnlyE2TypeVms"
|
361
|
+
# @param [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] google_cloud_orgpolicy_v2_custom_constraint_object
|
362
|
+
# @param [String] fields
|
363
|
+
# Selector specifying which fields to include in a partial response.
|
364
|
+
# @param [String] quota_user
|
365
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
366
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
367
|
+
# @param [Google::Apis::RequestOptions] options
|
368
|
+
# Request-specific options
|
369
|
+
#
|
370
|
+
# @yield [result, err] Result & error if block supplied
|
371
|
+
# @yieldparam result [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint] parsed result object
|
372
|
+
# @yieldparam err [StandardError] error object if request failed
|
373
|
+
#
|
374
|
+
# @return [Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint]
|
375
|
+
#
|
376
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
377
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
378
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
379
|
+
def patch_organization_custom_constraint(name, google_cloud_orgpolicy_v2_custom_constraint_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
380
|
+
command = make_simple_command(:patch, 'v2/{+name}', options)
|
381
|
+
command.request_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
|
382
|
+
command.request_object = google_cloud_orgpolicy_v2_custom_constraint_object
|
383
|
+
command.response_representation = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint::Representation
|
384
|
+
command.response_class = Google::Apis::OrgpolicyV2::GoogleCloudOrgpolicyV2CustomConstraint
|
385
|
+
command.params['name'] = name unless name.nil?
|
386
|
+
command.query['fields'] = fields unless fields.nil?
|
387
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
388
|
+
execute_or_queue_command(command, &block)
|
389
|
+
end
|
390
|
+
|
353
391
|
# Creates a Policy. Returns a `google.rpc.Status` with `google.rpc.Code.
|
354
392
|
# NOT_FOUND` if the constraint does not exist. Returns a `google.rpc.Status`
|
355
393
|
# with `google.rpc.Code.ALREADY_EXISTS` if the policy already exists on the
|
@@ -21,7 +21,7 @@ module Google
|
|
21
21
|
module Apis
|
22
22
|
# Organization Policy API
|
23
23
|
#
|
24
|
-
# The Org Policy API allows users to configure governance
|
24
|
+
# The Org Policy API allows users to configure governance rules on their GCP
|
25
25
|
# resources across the Cloud Resource Hierarchy.
|
26
26
|
#
|
27
27
|
# @see https://cloud.google.com/orgpolicy/docs/reference/rest/index.html
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-orgpolicy_v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
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-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-apis-core
|
@@ -57,9 +57,9 @@ licenses:
|
|
57
57
|
- Apache-2.0
|
58
58
|
metadata:
|
59
59
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
60
|
-
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/
|
61
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-orgpolicy_v2/v0.
|
62
|
-
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/
|
60
|
+
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-orgpolicy_v2/CHANGELOG.md
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-orgpolicy_v2/v0.12.0
|
62
|
+
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-orgpolicy_v2
|
63
63
|
post_install_message:
|
64
64
|
rdoc_options: []
|
65
65
|
require_paths:
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.
|
78
|
+
rubygems_version: 3.3.5
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Simple REST client for Organization Policy API V2
|