google-apis-assuredworkloads_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,588 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module AssuredworkloadsV1beta1
23
+ # Assured Workloads API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/assuredworkloads_v1beta1'
29
+ #
30
+ # Assuredworkloads = Google::Apis::AssuredworkloadsV1beta1 # Alias the module
31
+ # service = Assuredworkloads::AssuredworkloadsService.new
32
+ #
33
+ # @see https://cloud.google.com
34
+ class AssuredworkloadsService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://assuredworkloads.googleapis.com/', '',
47
+ client_name: 'google-apis-assuredworkloads_v1beta1',
48
+ client_version: Google::Apis::AssuredworkloadsV1beta1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets the latest state of a long-running operation. Clients can use this method
53
+ # to poll the operation result at intervals as recommended by the API service.
54
+ # @param [String] name
55
+ # The name of the operation resource.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def get_organization_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
75
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation::Representation
76
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation
77
+ command.params['name'] = name unless name.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ # Lists operations that match the specified filter in the request. If the server
84
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
85
+ # binding allows API services to override the binding to use different resource
86
+ # name schemes, such as `users/*/operations`. To override the binding, API
87
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
88
+ # service configuration. For backwards compatibility, the default name includes
89
+ # the operations collection id, however overriding users must ensure the name
90
+ # binding is the parent resource, without the operations collection id.
91
+ # @param [String] name
92
+ # The name of the operation's parent resource.
93
+ # @param [String] filter
94
+ # The standard list filter.
95
+ # @param [Fixnum] page_size
96
+ # The standard list page size.
97
+ # @param [String] page_token
98
+ # The standard list page token.
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningListOperationsResponse] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningListOperationsResponse]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def list_organization_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:get, 'v1beta1/{+name}/operations', options)
118
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningListOperationsResponse::Representation
119
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningListOperationsResponse
120
+ command.params['name'] = name unless name.nil?
121
+ command.query['filter'] = filter unless filter.nil?
122
+ command.query['pageSize'] = page_size unless page_size.nil?
123
+ command.query['pageToken'] = page_token unless page_token.nil?
124
+ command.query['fields'] = fields unless fields.nil?
125
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
126
+ execute_or_queue_command(command, &block)
127
+ end
128
+
129
+ # Creates Assured Workload.
130
+ # @param [String] parent
131
+ # Required. The resource name of the new Workload's parent. Must be of the form `
132
+ # organizations/`org_id`/locations/`location_id``.
133
+ # @param [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload] google_cloud_assuredworkloads_v1beta1_workload_object
134
+ # @param [String] external_id
135
+ # Optional. A identifier associated with the workload and underlying projects
136
+ # which allows for the break down of billing costs for a workload. The value
137
+ # provided for the identifier will add a label to the workload and contained
138
+ # projects with the identifier as the value.
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def create_organization_location_workload(parent, google_cloud_assuredworkloads_v1beta1_workload_object = nil, external_id: nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v1beta1/{+parent}/workloads', options)
158
+ command.request_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload::Representation
159
+ command.request_object = google_cloud_assuredworkloads_v1beta1_workload_object
160
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation::Representation
161
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleLongrunningOperation
162
+ command.params['parent'] = parent unless parent.nil?
163
+ command.query['externalId'] = external_id unless external_id.nil?
164
+ command.query['fields'] = fields unless fields.nil?
165
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
166
+ execute_or_queue_command(command, &block)
167
+ end
168
+
169
+ # Deletes the workload. Make sure that workload's direct children are already in
170
+ # a deleted state, otherwise the request will fail with a FAILED_PRECONDITION
171
+ # error. In addition to assuredworkloads.workload.delete permission, the user
172
+ # should also have orgpolicy.policy.set permission on the deleted folder to
173
+ # remove Assured Workloads OrgPolicies.
174
+ # @param [String] name
175
+ # Required. The `name` field is used to identify the workload. Format:
176
+ # organizations/`org_id`/locations/`location_id`/workloads/`workload_id`
177
+ # @param [String] etag
178
+ # Optional. The etag of the workload. If this is provided, it must match the
179
+ # server's etag.
180
+ # @param [String] fields
181
+ # Selector specifying which fields to include in a partial response.
182
+ # @param [String] quota_user
183
+ # Available to use for quota purposes for server-side applications. Can be any
184
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
185
+ # @param [Google::Apis::RequestOptions] options
186
+ # Request-specific options
187
+ #
188
+ # @yield [result, err] Result & error if block supplied
189
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleProtobufEmpty] parsed result object
190
+ # @yieldparam err [StandardError] error object if request failed
191
+ #
192
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleProtobufEmpty]
193
+ #
194
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
195
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
196
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
197
+ def delete_organization_location_workload(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
198
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
199
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleProtobufEmpty::Representation
200
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleProtobufEmpty
201
+ command.params['name'] = name unless name.nil?
202
+ command.query['etag'] = etag unless etag.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Gets Assured Workload associated with a CRM Node
209
+ # @param [String] name
210
+ # Required. The resource name of the Workload to fetch. This is the workloads's
211
+ # relative path in the API, formatted as "organizations/`organization_id`/
212
+ # locations/`location_id`/workloads/`workload_id`". For example, "organizations/
213
+ # 123/locations/us-east1/workloads/assured-workload-1".
214
+ # @param [String] fields
215
+ # Selector specifying which fields to include in a partial response.
216
+ # @param [String] quota_user
217
+ # Available to use for quota purposes for server-side applications. Can be any
218
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
219
+ # @param [Google::Apis::RequestOptions] options
220
+ # Request-specific options
221
+ #
222
+ # @yield [result, err] Result & error if block supplied
223
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload] parsed result object
224
+ # @yieldparam err [StandardError] error object if request failed
225
+ #
226
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload]
227
+ #
228
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
229
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
230
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
231
+ def get_organization_location_workload(name, fields: nil, quota_user: nil, options: nil, &block)
232
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
233
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload::Representation
234
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload
235
+ command.params['name'] = name unless name.nil?
236
+ command.query['fields'] = fields unless fields.nil?
237
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
238
+ execute_or_queue_command(command, &block)
239
+ end
240
+
241
+ # Lists Assured Workloads under a CRM Node.
242
+ # @param [String] parent
243
+ # Required. Parent Resource to list workloads from. Must be of the form `
244
+ # organizations/`org_id`/locations/`location``.
245
+ # @param [String] filter
246
+ # A custom filter for filtering by properties of a workload. At this time, only
247
+ # filtering by labels is supported.
248
+ # @param [Fixnum] page_size
249
+ # Page size.
250
+ # @param [String] page_token
251
+ # Page token returned from previous request. Page token contains context from
252
+ # previous request. Page token needs to be passed in the second and following
253
+ # requests.
254
+ # @param [String] fields
255
+ # Selector specifying which fields to include in a partial response.
256
+ # @param [String] quota_user
257
+ # Available to use for quota purposes for server-side applications. Can be any
258
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
259
+ # @param [Google::Apis::RequestOptions] options
260
+ # Request-specific options
261
+ #
262
+ # @yield [result, err] Result & error if block supplied
263
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListWorkloadsResponse] parsed result object
264
+ # @yieldparam err [StandardError] error object if request failed
265
+ #
266
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListWorkloadsResponse]
267
+ #
268
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
269
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
270
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
271
+ def list_organization_location_workloads(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
272
+ command = make_simple_command(:get, 'v1beta1/{+parent}/workloads', options)
273
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListWorkloadsResponse::Representation
274
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListWorkloadsResponse
275
+ command.params['parent'] = parent unless parent.nil?
276
+ command.query['filter'] = filter unless filter.nil?
277
+ command.query['pageSize'] = page_size unless page_size.nil?
278
+ command.query['pageToken'] = page_token unless page_token.nil?
279
+ command.query['fields'] = fields unless fields.nil?
280
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
281
+ execute_or_queue_command(command, &block)
282
+ end
283
+
284
+ # Updates an existing workload. Currently allows updating of workload
285
+ # display_name and labels. For force updates don't set etag field in the
286
+ # Workload. Only one update operation per workload can be in progress.
287
+ # @param [String] name
288
+ # Optional. The resource name of the workload. Format: organizations/`
289
+ # organization`/locations/`location`/workloads/`workload` Read-only.
290
+ # @param [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload] google_cloud_assuredworkloads_v1beta1_workload_object
291
+ # @param [String] update_mask
292
+ # Required. The list of fields to be updated.
293
+ # @param [String] fields
294
+ # Selector specifying which fields to include in a partial response.
295
+ # @param [String] quota_user
296
+ # Available to use for quota purposes for server-side applications. Can be any
297
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
298
+ # @param [Google::Apis::RequestOptions] options
299
+ # Request-specific options
300
+ #
301
+ # @yield [result, err] Result & error if block supplied
302
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload] parsed result object
303
+ # @yieldparam err [StandardError] error object if request failed
304
+ #
305
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload]
306
+ #
307
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
308
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
309
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
310
+ def patch_organization_location_workload(name, google_cloud_assuredworkloads_v1beta1_workload_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
311
+ command = make_simple_command(:patch, 'v1beta1/{+name}', options)
312
+ command.request_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload::Representation
313
+ command.request_object = google_cloud_assuredworkloads_v1beta1_workload_object
314
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload::Representation
315
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Workload
316
+ command.params['name'] = name unless name.nil?
317
+ command.query['updateMask'] = update_mask unless update_mask.nil?
318
+ command.query['fields'] = fields unless fields.nil?
319
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
320
+ execute_or_queue_command(command, &block)
321
+ end
322
+
323
+ # Restrict the list of resources allowed in the Workload environment. The
324
+ # current list of allowed products can be found at https://cloud.google.com/
325
+ # assured-workloads/docs/supported-products In addition to assuredworkloads.
326
+ # workload.update permission, the user should also have orgpolicy.policy.set
327
+ # permission on the folder resource to use this functionality.
328
+ # @param [String] name
329
+ # Required. The resource name of the Workload. This is the workloads's relative
330
+ # path in the API, formatted as "organizations/`organization_id`/locations/`
331
+ # location_id`/workloads/`workload_id`". For example, "organizations/123/
332
+ # locations/us-east1/workloads/assured-workload-1".
333
+ # @param [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesRequest] google_cloud_assuredworkloads_v1beta1_restrict_allowed_resources_request_object
334
+ # @param [String] fields
335
+ # Selector specifying which fields to include in a partial response.
336
+ # @param [String] quota_user
337
+ # Available to use for quota purposes for server-side applications. Can be any
338
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
339
+ # @param [Google::Apis::RequestOptions] options
340
+ # Request-specific options
341
+ #
342
+ # @yield [result, err] Result & error if block supplied
343
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesResponse] parsed result object
344
+ # @yieldparam err [StandardError] error object if request failed
345
+ #
346
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesResponse]
347
+ #
348
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
349
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
350
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
351
+ def restrict_organization_location_workload_allowed_resources(name, google_cloud_assuredworkloads_v1beta1_restrict_allowed_resources_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
352
+ command = make_simple_command(:post, 'v1beta1/{+name}:restrictAllowedResources', options)
353
+ command.request_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesRequest::Representation
354
+ command.request_object = google_cloud_assuredworkloads_v1beta1_restrict_allowed_resources_request_object
355
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesResponse::Representation
356
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1RestrictAllowedResourcesResponse
357
+ command.params['name'] = name unless name.nil?
358
+ command.query['fields'] = fields unless fields.nil?
359
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
360
+ execute_or_queue_command(command, &block)
361
+ end
362
+
363
+ # Analyzes a hypothetical move of a source project or project-based workload to
364
+ # a target (destination) folder-based workload.
365
+ # @param [String] source
366
+ # The source type is a project-based workload. Specify the workloads's relative
367
+ # resource name, formatted as: "organizations/`ORGANIZATION_ID`/locations/`
368
+ # LOCATION_ID`/workloads/`WORKLOAD_ID`" For example: "organizations/123/
369
+ # locations/us-east1/workloads/assured-workload-1"
370
+ # @param [String] target
371
+ # Required. The resource ID of the folder-based destination workload. This
372
+ # workload is where the source project will hypothetically be moved to. Specify
373
+ # the workload's relative resource name, formatted as: "organizations/`
374
+ # ORGANIZATION_ID`/locations/`LOCATION_ID`/workloads/`WORKLOAD_ID`" For example:
375
+ # "organizations/123/locations/us-east1/workloads/assured-workload-2"
376
+ # @param [String] project
377
+ # The source type is a project. Specify the project's relative resource name,
378
+ # formatted as either a project number or a project ID: "projects/`
379
+ # PROJECT_NUMBER`" or "projects/`PROJECT_ID`" For example: "projects/
380
+ # 951040570662" when specifying a project number, or "projects/my-project-123"
381
+ # when specifying a project ID.
382
+ # @param [String] fields
383
+ # Selector specifying which fields to include in a partial response.
384
+ # @param [String] quota_user
385
+ # Available to use for quota purposes for server-side applications. Can be any
386
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
387
+ # @param [Google::Apis::RequestOptions] options
388
+ # Request-specific options
389
+ #
390
+ # @yield [result, err] Result & error if block supplied
391
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse] parsed result object
392
+ # @yieldparam err [StandardError] error object if request failed
393
+ #
394
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse]
395
+ #
396
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
397
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
398
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
399
+ def analyze_organization_location_workload_organization_location_workload_workload_move(source, target, project: nil, fields: nil, quota_user: nil, options: nil, &block)
400
+ command = make_simple_command(:get, 'v1beta1/{+source}/{+target}:analyzeWorkloadMove', options)
401
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse::Representation
402
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse
403
+ command.params['source'] = source unless source.nil?
404
+ command.params['target'] = target unless target.nil?
405
+ command.query['project'] = project unless project.nil?
406
+ command.query['fields'] = fields unless fields.nil?
407
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
408
+ execute_or_queue_command(command, &block)
409
+ end
410
+
411
+ # Acknowledges an existing violation. By acknowledging a violation, users
412
+ # acknowledge the existence of a compliance violation in their workload and
413
+ # decide to ignore it due to a valid business justification. Acknowledgement is
414
+ # a permanent operation and it cannot be reverted.
415
+ # @param [String] name
416
+ # Required. The resource name of the Violation to acknowledge. Format:
417
+ # organizations/`organization`/locations/`location`/workloads/`workload`/
418
+ # violations/`violation`
419
+ # @param [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationRequest] google_cloud_assuredworkloads_v1beta1_acknowledge_violation_request_object
420
+ # @param [String] fields
421
+ # Selector specifying which fields to include in a partial response.
422
+ # @param [String] quota_user
423
+ # Available to use for quota purposes for server-side applications. Can be any
424
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
425
+ # @param [Google::Apis::RequestOptions] options
426
+ # Request-specific options
427
+ #
428
+ # @yield [result, err] Result & error if block supplied
429
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationResponse] parsed result object
430
+ # @yieldparam err [StandardError] error object if request failed
431
+ #
432
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationResponse]
433
+ #
434
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
435
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
436
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
437
+ def acknowledge_organization_location_workload_violation(name, google_cloud_assuredworkloads_v1beta1_acknowledge_violation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
438
+ command = make_simple_command(:post, 'v1beta1/{+name}:acknowledge', options)
439
+ command.request_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationRequest::Representation
440
+ command.request_object = google_cloud_assuredworkloads_v1beta1_acknowledge_violation_request_object
441
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationResponse::Representation
442
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AcknowledgeViolationResponse
443
+ command.params['name'] = name unless name.nil?
444
+ command.query['fields'] = fields unless fields.nil?
445
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
446
+ execute_or_queue_command(command, &block)
447
+ end
448
+
449
+ # Retrieves Assured Workload Violation based on ID.
450
+ # @param [String] name
451
+ # Required. The resource name of the Violation to fetch (ie. Violation.name).
452
+ # Format: organizations/`organization`/locations/`location`/workloads/`workload`/
453
+ # violations/`violation`
454
+ # @param [String] fields
455
+ # Selector specifying which fields to include in a partial response.
456
+ # @param [String] quota_user
457
+ # Available to use for quota purposes for server-side applications. Can be any
458
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
459
+ # @param [Google::Apis::RequestOptions] options
460
+ # Request-specific options
461
+ #
462
+ # @yield [result, err] Result & error if block supplied
463
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Violation] parsed result object
464
+ # @yieldparam err [StandardError] error object if request failed
465
+ #
466
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Violation]
467
+ #
468
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
469
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
470
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
471
+ def get_organization_location_workload_violation(name, fields: nil, quota_user: nil, options: nil, &block)
472
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
473
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Violation::Representation
474
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1Violation
475
+ command.params['name'] = name unless name.nil?
476
+ command.query['fields'] = fields unless fields.nil?
477
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
478
+ execute_or_queue_command(command, &block)
479
+ end
480
+
481
+ # Lists the Violations in the AssuredWorkload Environment. Callers may also
482
+ # choose to read across multiple Workloads as per [AIP-159](https://google.aip.
483
+ # dev/159) by using '-' (the hyphen or dash character) as a wildcard character
484
+ # instead of workload-id in the parent. Format `organizations/`org_id`/locations/
485
+ # `location`/workloads/-`
486
+ # @param [String] parent
487
+ # Required. The Workload name. Format `organizations/`org_id`/locations/`
488
+ # location`/workloads/`workload``.
489
+ # @param [String] filter
490
+ # Optional. A custom filter for filtering by the Violations properties.
491
+ # @param [String] interval_end_time
492
+ # The end of the time window.
493
+ # @param [String] interval_start_time
494
+ # The start of the time window.
495
+ # @param [Fixnum] page_size
496
+ # Optional. Page size.
497
+ # @param [String] page_token
498
+ # Optional. Page token returned from previous request.
499
+ # @param [String] fields
500
+ # Selector specifying which fields to include in a partial response.
501
+ # @param [String] quota_user
502
+ # Available to use for quota purposes for server-side applications. Can be any
503
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
504
+ # @param [Google::Apis::RequestOptions] options
505
+ # Request-specific options
506
+ #
507
+ # @yield [result, err] Result & error if block supplied
508
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListViolationsResponse] parsed result object
509
+ # @yieldparam err [StandardError] error object if request failed
510
+ #
511
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListViolationsResponse]
512
+ #
513
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
514
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
515
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
516
+ def list_organization_location_workload_violations(parent, filter: nil, interval_end_time: nil, interval_start_time: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
517
+ command = make_simple_command(:get, 'v1beta1/{+parent}/violations', options)
518
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListViolationsResponse::Representation
519
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1ListViolationsResponse
520
+ command.params['parent'] = parent unless parent.nil?
521
+ command.query['filter'] = filter unless filter.nil?
522
+ command.query['interval.endTime'] = interval_end_time unless interval_end_time.nil?
523
+ command.query['interval.startTime'] = interval_start_time unless interval_start_time.nil?
524
+ command.query['pageSize'] = page_size unless page_size.nil?
525
+ command.query['pageToken'] = page_token unless page_token.nil?
526
+ command.query['fields'] = fields unless fields.nil?
527
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
528
+ execute_or_queue_command(command, &block)
529
+ end
530
+
531
+ # Analyzes a hypothetical move of a source project or project-based workload to
532
+ # a target (destination) folder-based workload.
533
+ # @param [String] project
534
+ # The source type is a project. Specify the project's relative resource name,
535
+ # formatted as either a project number or a project ID: "projects/`
536
+ # PROJECT_NUMBER`" or "projects/`PROJECT_ID`" For example: "projects/
537
+ # 951040570662" when specifying a project number, or "projects/my-project-123"
538
+ # when specifying a project ID.
539
+ # @param [String] target
540
+ # Required. The resource ID of the folder-based destination workload. This
541
+ # workload is where the source project will hypothetically be moved to. Specify
542
+ # the workload's relative resource name, formatted as: "organizations/`
543
+ # ORGANIZATION_ID`/locations/`LOCATION_ID`/workloads/`WORKLOAD_ID`" For example:
544
+ # "organizations/123/locations/us-east1/workloads/assured-workload-2"
545
+ # @param [String] source
546
+ # The source type is a project-based workload. Specify the workloads's relative
547
+ # resource name, formatted as: "organizations/`ORGANIZATION_ID`/locations/`
548
+ # LOCATION_ID`/workloads/`WORKLOAD_ID`" For example: "organizations/123/
549
+ # locations/us-east1/workloads/assured-workload-1"
550
+ # @param [String] fields
551
+ # Selector specifying which fields to include in a partial response.
552
+ # @param [String] quota_user
553
+ # Available to use for quota purposes for server-side applications. Can be any
554
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
555
+ # @param [Google::Apis::RequestOptions] options
556
+ # Request-specific options
557
+ #
558
+ # @yield [result, err] Result & error if block supplied
559
+ # @yieldparam result [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse] parsed result object
560
+ # @yieldparam err [StandardError] error object if request failed
561
+ #
562
+ # @return [Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse]
563
+ #
564
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
565
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
566
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
567
+ def analyze_project_organization_location_workload_workload_move(project, target, source: nil, fields: nil, quota_user: nil, options: nil, &block)
568
+ command = make_simple_command(:get, 'v1beta1/{+project}/{+target}:analyzeWorkloadMove', options)
569
+ command.response_representation = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse::Representation
570
+ command.response_class = Google::Apis::AssuredworkloadsV1beta1::GoogleCloudAssuredworkloadsV1beta1AnalyzeWorkloadMoveResponse
571
+ command.params['project'] = project unless project.nil?
572
+ command.params['target'] = target unless target.nil?
573
+ command.query['source'] = source unless source.nil?
574
+ command.query['fields'] = fields unless fields.nil?
575
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
576
+ execute_or_queue_command(command, &block)
577
+ end
578
+
579
+ protected
580
+
581
+ def apply_command_defaults(command)
582
+ command.query['key'] = key unless key.nil?
583
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
584
+ end
585
+ end
586
+ end
587
+ end
588
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/assuredworkloads_v1beta1/service.rb'
16
+ require 'google/apis/assuredworkloads_v1beta1/classes.rb'
17
+ require 'google/apis/assuredworkloads_v1beta1/representations.rb'
18
+ require 'google/apis/assuredworkloads_v1beta1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Assured Workloads API
23
+ #
24
+ #
25
+ #
26
+ # @see https://cloud.google.com
27
+ module AssuredworkloadsV1beta1
28
+ # Version of the Assured Workloads API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V1beta1'
31
+
32
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/assuredworkloads_v1beta1"