google-apis-osconfig_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,383 @@
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 OsconfigV1
23
+ # OS Config API
24
+ #
25
+ # OS management tools that can be used for patch management, patch compliance,
26
+ # and configuration management on VM instances.
27
+ #
28
+ # @example
29
+ # require 'google/apis/osconfig_v1'
30
+ #
31
+ # Osconfig = Google::Apis::OsconfigV1 # Alias the module
32
+ # service = Osconfig::OSConfigService.new
33
+ #
34
+ # @see https://cloud.google.com/compute/docs/manage-os
35
+ class OSConfigService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://osconfig.googleapis.com/', '',
48
+ client_name: 'google-apis-osconfig_v1',
49
+ client_version: Google::Apis::OsconfigV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Create an OS Config patch deployment.
54
+ # @param [String] parent
55
+ # Required. The project to apply this patch deployment to in the form `projects/*
56
+ # `.
57
+ # @param [Google::Apis::OsconfigV1::PatchDeployment] patch_deployment_object
58
+ # @param [String] patch_deployment_id
59
+ # Required. A name for the patch deployment in the project. When creating a name
60
+ # the following rules apply: * Must contain only lowercase letters, numbers, and
61
+ # hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must
62
+ # end with a number or a letter. * Must be unique within the project.
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::OsconfigV1::PatchDeployment] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::OsconfigV1::PatchDeployment]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def create_project_patch_deployment(parent, patch_deployment_object = nil, patch_deployment_id: nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:post, 'v1/{+parent}/patchDeployments', options)
82
+ command.request_representation = Google::Apis::OsconfigV1::PatchDeployment::Representation
83
+ command.request_object = patch_deployment_object
84
+ command.response_representation = Google::Apis::OsconfigV1::PatchDeployment::Representation
85
+ command.response_class = Google::Apis::OsconfigV1::PatchDeployment
86
+ command.params['parent'] = parent unless parent.nil?
87
+ command.query['patchDeploymentId'] = patch_deployment_id unless patch_deployment_id.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Delete an OS Config patch deployment.
94
+ # @param [String] name
95
+ # Required. The resource name of the patch deployment in the form `projects/*/
96
+ # patchDeployments/*`.
97
+ # @param [String] fields
98
+ # Selector specifying which fields to include in a partial response.
99
+ # @param [String] quota_user
100
+ # Available to use for quota purposes for server-side applications. Can be any
101
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
102
+ # @param [Google::Apis::RequestOptions] options
103
+ # Request-specific options
104
+ #
105
+ # @yield [result, err] Result & error if block supplied
106
+ # @yieldparam result [Google::Apis::OsconfigV1::Empty] parsed result object
107
+ # @yieldparam err [StandardError] error object if request failed
108
+ #
109
+ # @return [Google::Apis::OsconfigV1::Empty]
110
+ #
111
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
112
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
113
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
114
+ def delete_project_patch_deployment(name, fields: nil, quota_user: nil, options: nil, &block)
115
+ command = make_simple_command(:delete, 'v1/{+name}', options)
116
+ command.response_representation = Google::Apis::OsconfigV1::Empty::Representation
117
+ command.response_class = Google::Apis::OsconfigV1::Empty
118
+ command.params['name'] = name unless name.nil?
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ execute_or_queue_command(command, &block)
122
+ end
123
+
124
+ # Get an OS Config patch deployment.
125
+ # @param [String] name
126
+ # Required. The resource name of the patch deployment in the form `projects/*/
127
+ # patchDeployments/*`.
128
+ # @param [String] fields
129
+ # Selector specifying which fields to include in a partial response.
130
+ # @param [String] quota_user
131
+ # Available to use for quota purposes for server-side applications. Can be any
132
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
133
+ # @param [Google::Apis::RequestOptions] options
134
+ # Request-specific options
135
+ #
136
+ # @yield [result, err] Result & error if block supplied
137
+ # @yieldparam result [Google::Apis::OsconfigV1::PatchDeployment] parsed result object
138
+ # @yieldparam err [StandardError] error object if request failed
139
+ #
140
+ # @return [Google::Apis::OsconfigV1::PatchDeployment]
141
+ #
142
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
143
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
144
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
145
+ def get_project_patch_deployment(name, fields: nil, quota_user: nil, options: nil, &block)
146
+ command = make_simple_command(:get, 'v1/{+name}', options)
147
+ command.response_representation = Google::Apis::OsconfigV1::PatchDeployment::Representation
148
+ command.response_class = Google::Apis::OsconfigV1::PatchDeployment
149
+ command.params['name'] = name unless name.nil?
150
+ command.query['fields'] = fields unless fields.nil?
151
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
152
+ execute_or_queue_command(command, &block)
153
+ end
154
+
155
+ # Get a page of OS Config patch deployments.
156
+ # @param [String] parent
157
+ # Required. The resource name of the parent in the form `projects/*`.
158
+ # @param [Fixnum] page_size
159
+ # Optional. The maximum number of patch deployments to return. Default is 100.
160
+ # @param [String] page_token
161
+ # Optional. A pagination token returned from a previous call to
162
+ # ListPatchDeployments that indicates where this listing should continue from.
163
+ # @param [String] fields
164
+ # Selector specifying which fields to include in a partial response.
165
+ # @param [String] quota_user
166
+ # Available to use for quota purposes for server-side applications. Can be any
167
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
168
+ # @param [Google::Apis::RequestOptions] options
169
+ # Request-specific options
170
+ #
171
+ # @yield [result, err] Result & error if block supplied
172
+ # @yieldparam result [Google::Apis::OsconfigV1::ListPatchDeploymentsResponse] parsed result object
173
+ # @yieldparam err [StandardError] error object if request failed
174
+ #
175
+ # @return [Google::Apis::OsconfigV1::ListPatchDeploymentsResponse]
176
+ #
177
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
180
+ def list_project_patch_deployments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
181
+ command = make_simple_command(:get, 'v1/{+parent}/patchDeployments', options)
182
+ command.response_representation = Google::Apis::OsconfigV1::ListPatchDeploymentsResponse::Representation
183
+ command.response_class = Google::Apis::OsconfigV1::ListPatchDeploymentsResponse
184
+ command.params['parent'] = parent unless parent.nil?
185
+ command.query['pageSize'] = page_size unless page_size.nil?
186
+ command.query['pageToken'] = page_token unless page_token.nil?
187
+ command.query['fields'] = fields unless fields.nil?
188
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
189
+ execute_or_queue_command(command, &block)
190
+ end
191
+
192
+ # Cancel a patch job. The patch job must be active. Canceled patch jobs cannot
193
+ # be restarted.
194
+ # @param [String] name
195
+ # Required. Name of the patch in the form `projects/*/patchJobs/*`
196
+ # @param [Google::Apis::OsconfigV1::CancelPatchJobRequest] cancel_patch_job_request_object
197
+ # @param [String] fields
198
+ # Selector specifying which fields to include in a partial response.
199
+ # @param [String] quota_user
200
+ # Available to use for quota purposes for server-side applications. Can be any
201
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
202
+ # @param [Google::Apis::RequestOptions] options
203
+ # Request-specific options
204
+ #
205
+ # @yield [result, err] Result & error if block supplied
206
+ # @yieldparam result [Google::Apis::OsconfigV1::PatchJob] parsed result object
207
+ # @yieldparam err [StandardError] error object if request failed
208
+ #
209
+ # @return [Google::Apis::OsconfigV1::PatchJob]
210
+ #
211
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
212
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
213
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
214
+ def cancel_patch_job(name, cancel_patch_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
215
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
216
+ command.request_representation = Google::Apis::OsconfigV1::CancelPatchJobRequest::Representation
217
+ command.request_object = cancel_patch_job_request_object
218
+ command.response_representation = Google::Apis::OsconfigV1::PatchJob::Representation
219
+ command.response_class = Google::Apis::OsconfigV1::PatchJob
220
+ command.params['name'] = name unless name.nil?
221
+ command.query['fields'] = fields unless fields.nil?
222
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
223
+ execute_or_queue_command(command, &block)
224
+ end
225
+
226
+ # Patch VM instances by creating and running a patch job.
227
+ # @param [String] parent
228
+ # Required. The project in which to run this patch in the form `projects/*`
229
+ # @param [Google::Apis::OsconfigV1::ExecutePatchJobRequest] execute_patch_job_request_object
230
+ # @param [String] fields
231
+ # Selector specifying which fields to include in a partial response.
232
+ # @param [String] quota_user
233
+ # Available to use for quota purposes for server-side applications. Can be any
234
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
235
+ # @param [Google::Apis::RequestOptions] options
236
+ # Request-specific options
237
+ #
238
+ # @yield [result, err] Result & error if block supplied
239
+ # @yieldparam result [Google::Apis::OsconfigV1::PatchJob] parsed result object
240
+ # @yieldparam err [StandardError] error object if request failed
241
+ #
242
+ # @return [Google::Apis::OsconfigV1::PatchJob]
243
+ #
244
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
245
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
246
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
247
+ def execute_patch_job(parent, execute_patch_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
248
+ command = make_simple_command(:post, 'v1/{+parent}/patchJobs:execute', options)
249
+ command.request_representation = Google::Apis::OsconfigV1::ExecutePatchJobRequest::Representation
250
+ command.request_object = execute_patch_job_request_object
251
+ command.response_representation = Google::Apis::OsconfigV1::PatchJob::Representation
252
+ command.response_class = Google::Apis::OsconfigV1::PatchJob
253
+ command.params['parent'] = parent unless parent.nil?
254
+ command.query['fields'] = fields unless fields.nil?
255
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
256
+ execute_or_queue_command(command, &block)
257
+ end
258
+
259
+ # Get the patch job. This can be used to track the progress of an ongoing patch
260
+ # job or review the details of completed jobs.
261
+ # @param [String] name
262
+ # Required. Name of the patch in the form `projects/*/patchJobs/*`
263
+ # @param [String] fields
264
+ # Selector specifying which fields to include in a partial response.
265
+ # @param [String] quota_user
266
+ # Available to use for quota purposes for server-side applications. Can be any
267
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
268
+ # @param [Google::Apis::RequestOptions] options
269
+ # Request-specific options
270
+ #
271
+ # @yield [result, err] Result & error if block supplied
272
+ # @yieldparam result [Google::Apis::OsconfigV1::PatchJob] parsed result object
273
+ # @yieldparam err [StandardError] error object if request failed
274
+ #
275
+ # @return [Google::Apis::OsconfigV1::PatchJob]
276
+ #
277
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
278
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
279
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
280
+ def get_project_patch_job(name, fields: nil, quota_user: nil, options: nil, &block)
281
+ command = make_simple_command(:get, 'v1/{+name}', options)
282
+ command.response_representation = Google::Apis::OsconfigV1::PatchJob::Representation
283
+ command.response_class = Google::Apis::OsconfigV1::PatchJob
284
+ command.params['name'] = name unless name.nil?
285
+ command.query['fields'] = fields unless fields.nil?
286
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
287
+ execute_or_queue_command(command, &block)
288
+ end
289
+
290
+ # Get a list of patch jobs.
291
+ # @param [String] parent
292
+ # Required. In the form of `projects/*`
293
+ # @param [String] filter
294
+ # If provided, this field specifies the criteria that must be met by patch jobs
295
+ # to be included in the response. Currently, filtering is only available on the
296
+ # patch_deployment field.
297
+ # @param [Fixnum] page_size
298
+ # The maximum number of instance status to return.
299
+ # @param [String] page_token
300
+ # A pagination token returned from a previous call that indicates where this
301
+ # listing should continue from.
302
+ # @param [String] fields
303
+ # Selector specifying which fields to include in a partial response.
304
+ # @param [String] quota_user
305
+ # Available to use for quota purposes for server-side applications. Can be any
306
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
307
+ # @param [Google::Apis::RequestOptions] options
308
+ # Request-specific options
309
+ #
310
+ # @yield [result, err] Result & error if block supplied
311
+ # @yieldparam result [Google::Apis::OsconfigV1::ListPatchJobsResponse] parsed result object
312
+ # @yieldparam err [StandardError] error object if request failed
313
+ #
314
+ # @return [Google::Apis::OsconfigV1::ListPatchJobsResponse]
315
+ #
316
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
317
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
318
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
319
+ def list_project_patch_jobs(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
320
+ command = make_simple_command(:get, 'v1/{+parent}/patchJobs', options)
321
+ command.response_representation = Google::Apis::OsconfigV1::ListPatchJobsResponse::Representation
322
+ command.response_class = Google::Apis::OsconfigV1::ListPatchJobsResponse
323
+ command.params['parent'] = parent unless parent.nil?
324
+ command.query['filter'] = filter unless filter.nil?
325
+ command.query['pageSize'] = page_size unless page_size.nil?
326
+ command.query['pageToken'] = page_token unless page_token.nil?
327
+ command.query['fields'] = fields unless fields.nil?
328
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
329
+ execute_or_queue_command(command, &block)
330
+ end
331
+
332
+ # Get a list of instance details for a given patch job.
333
+ # @param [String] parent
334
+ # Required. The parent for the instances are in the form of `projects/*/
335
+ # patchJobs/*`.
336
+ # @param [String] filter
337
+ # A filter expression that filters results listed in the response. This field
338
+ # supports filtering results by instance zone, name, state, or `failure_reason`.
339
+ # @param [Fixnum] page_size
340
+ # The maximum number of instance details records to return. Default is 100.
341
+ # @param [String] page_token
342
+ # A pagination token returned from a previous call that indicates where this
343
+ # listing should continue from.
344
+ # @param [String] fields
345
+ # Selector specifying which fields to include in a partial response.
346
+ # @param [String] quota_user
347
+ # Available to use for quota purposes for server-side applications. Can be any
348
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
349
+ # @param [Google::Apis::RequestOptions] options
350
+ # Request-specific options
351
+ #
352
+ # @yield [result, err] Result & error if block supplied
353
+ # @yieldparam result [Google::Apis::OsconfigV1::ListPatchJobInstanceDetailsResponse] parsed result object
354
+ # @yieldparam err [StandardError] error object if request failed
355
+ #
356
+ # @return [Google::Apis::OsconfigV1::ListPatchJobInstanceDetailsResponse]
357
+ #
358
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
359
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
360
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
361
+ def list_project_patch_job_instance_details(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
362
+ command = make_simple_command(:get, 'v1/{+parent}/instanceDetails', options)
363
+ command.response_representation = Google::Apis::OsconfigV1::ListPatchJobInstanceDetailsResponse::Representation
364
+ command.response_class = Google::Apis::OsconfigV1::ListPatchJobInstanceDetailsResponse
365
+ command.params['parent'] = parent unless parent.nil?
366
+ command.query['filter'] = filter unless filter.nil?
367
+ command.query['pageSize'] = page_size unless page_size.nil?
368
+ command.query['pageToken'] = page_token unless page_token.nil?
369
+ command.query['fields'] = fields unless fields.nil?
370
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
371
+ execute_or_queue_command(command, &block)
372
+ end
373
+
374
+ protected
375
+
376
+ def apply_command_defaults(command)
377
+ command.query['key'] = key unless key.nil?
378
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-osconfig_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for OS Config API V1. Simple REST clients
28
+ are Ruby client libraries that provide access to Google services via their HTTP
29
+ REST API endpoints. These libraries are generated and updated automatically based
30
+ on the discovery documents published by the service, and they handle most concerns
31
+ such as authentication, pagination, retry, timeouts, and logging. You can use this
32
+ client to access the OS Config API, but note that some services may provide a separate
33
+ modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-osconfig_v1.rb
44
+ - lib/google/apis/osconfig_v1.rb
45
+ - lib/google/apis/osconfig_v1/classes.rb
46
+ - lib/google/apis/osconfig_v1/gem_version.rb
47
+ - lib/google/apis/osconfig_v1/representations.rb
48
+ - lib/google/apis/osconfig_v1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-osconfig_v1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-osconfig_v1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-osconfig_v1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for OS Config API V1
76
+ test_files: []