google-cloud-os_config-v1 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/os_config/v1/os_config_service/client.rb +18 -22
  5. data/lib/google/cloud/os_config/v1/os_config_service/rest/client.rb +1183 -0
  6. data/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb +762 -0
  7. data/lib/google/cloud/os_config/v1/os_config_service/rest.rb +55 -0
  8. data/lib/google/cloud/os_config/v1/os_config_service.rb +7 -1
  9. data/lib/google/cloud/os_config/v1/os_config_zonal_service/client.rb +38 -46
  10. data/lib/google/cloud/os_config/v1/os_config_zonal_service/operations.rb +17 -17
  11. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/client.rb +1284 -0
  12. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/operations.rb +795 -0
  13. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb +758 -0
  14. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest.rb +56 -0
  15. data/lib/google/cloud/os_config/v1/os_config_zonal_service.rb +7 -1
  16. data/lib/google/cloud/os_config/v1/rest.rb +38 -0
  17. data/lib/google/cloud/os_config/v1/version.rb +1 -1
  18. data/lib/google/cloud/os_config/v1.rb +7 -2
  19. data/lib/google/cloud/osconfig/v1/inventory_pb.rb +26 -109
  20. data/lib/google/cloud/osconfig/v1/os_policy_assignment_reports_pb.rb +25 -61
  21. data/lib/google/cloud/osconfig/v1/os_policy_assignments_pb.rb +29 -93
  22. data/lib/google/cloud/osconfig/v1/os_policy_pb.rb +24 -158
  23. data/lib/google/cloud/osconfig/v1/osconfig_common_pb.rb +24 -7
  24. data/lib/google/cloud/osconfig/v1/osconfig_service_pb.rb +25 -2
  25. data/lib/google/cloud/osconfig/v1/osconfig_zonal_service_pb.rb +25 -2
  26. data/lib/google/cloud/osconfig/v1/patch_deployments_pb.rb +30 -88
  27. data/lib/google/cloud/osconfig/v1/patch_jobs_pb.rb +27 -209
  28. data/lib/google/cloud/osconfig/v1/vulnerability_pb.rb +25 -92
  29. data/proto_docs/google/api/client.rb +381 -0
  30. data/proto_docs/google/api/launch_stage.rb +71 -0
  31. data/proto_docs/google/protobuf/any.rb +7 -4
  32. data/proto_docs/google/protobuf/empty.rb +0 -2
  33. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  34. data/proto_docs/google/rpc/status.rb +4 -2
  35. metadata +19 -8
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/os_config/v1/version"
24
+
25
+ require "google/cloud/os_config/v1/os_config_service/credentials"
26
+ require "google/cloud/os_config/v1/os_config_service/paths"
27
+ require "google/cloud/os_config/v1/os_config_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module OsConfig
32
+ module V1
33
+ ##
34
+ # OS Config API
35
+ #
36
+ # The OS Config service is a server-side component that you can use to
37
+ # manage package installations and patch jobs for virtual machine instances.
38
+ #
39
+ # To load this service and instantiate a REST client:
40
+ #
41
+ # require "google/cloud/os_config/v1/os_config_service/rest"
42
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Rest::Client.new
43
+ #
44
+ module OsConfigService
45
+ # Client for the REST transport
46
+ module Rest
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
55
+ require "google/cloud/os_config/v1/os_config_service/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/os_config/v1/version"
25
25
  require "google/cloud/os_config/v1/os_config_service/credentials"
26
26
  require "google/cloud/os_config/v1/os_config_service/paths"
27
27
  require "google/cloud/os_config/v1/os_config_service/client"
28
+ require "google/cloud/os_config/v1/os_config_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -36,11 +37,16 @@ module Google
36
37
  # The OS Config service is a server-side component that you can use to
37
38
  # manage package installations and patch jobs for virtual machine instances.
38
39
  #
39
- # To load this service and instantiate a client:
40
+ # @example Load this service and instantiate a gRPC client
40
41
  #
41
42
  # require "google/cloud/os_config/v1/os_config_service"
42
43
  # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Client.new
43
44
  #
45
+ # @example Load this service and instantiate a REST client
46
+ #
47
+ # require "google/cloud/os_config/v1/os_config_service/rest"
48
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigService::Rest::Client.new
49
+ #
44
50
  module OsConfigService
45
51
  end
46
52
  end
@@ -131,7 +131,7 @@ module Google
131
131
  credentials = @config.credentials
132
132
  # Use self-signed JWT if the endpoint is unchanged from default,
133
133
  # but only if the default endpoint does not have a region prefix.
134
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
134
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
135
135
  !@config.endpoint.split(".").first.include?("-")
136
136
  credentials ||= Credentials.default scope: @config.scope,
137
137
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -226,14 +226,14 @@ module Google
226
226
  # # Call the create_os_policy_assignment method.
227
227
  # result = client.create_os_policy_assignment request
228
228
  #
229
- # # The returned object is of type Gapic::Operation. You can use this
230
- # # object to check the status of an operation, cancel it, or wait
231
- # # for results. Here is how to block until completion:
229
+ # # The returned object is of type Gapic::Operation. You can use it to
230
+ # # check the status of an operation, cancel it, or wait for results.
231
+ # # Here is how to wait for a response.
232
232
  # result.wait_until_done! timeout: 60
233
233
  # if result.response?
234
234
  # p result.response
235
235
  # else
236
- # puts "Error!"
236
+ # puts "No response received."
237
237
  # end
238
238
  #
239
239
  def create_os_policy_assignment request, options = nil
@@ -330,14 +330,14 @@ module Google
330
330
  # # Call the update_os_policy_assignment method.
331
331
  # result = client.update_os_policy_assignment request
332
332
  #
333
- # # The returned object is of type Gapic::Operation. You can use this
334
- # # object to check the status of an operation, cancel it, or wait
335
- # # for results. Here is how to block until completion:
333
+ # # The returned object is of type Gapic::Operation. You can use it to
334
+ # # check the status of an operation, cancel it, or wait for results.
335
+ # # Here is how to wait for a response.
336
336
  # result.wait_until_done! timeout: 60
337
337
  # if result.response?
338
338
  # p result.response
339
339
  # else
340
- # puts "Error!"
340
+ # puts "No response received."
341
341
  # end
342
342
  #
343
343
  def update_os_policy_assignment request, options = nil
@@ -523,13 +523,11 @@ module Google
523
523
  # # Call the list_os_policy_assignments method.
524
524
  # result = client.list_os_policy_assignments request
525
525
  #
526
- # # The returned object is of type Gapic::PagedEnumerable. You can
527
- # # iterate over all elements by calling #each, and the enumerable
528
- # # will lazily make API calls to fetch subsequent pages. Other
529
- # # methods are also available for managing paging directly.
530
- # result.each do |response|
526
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
527
+ # # over elements, and API calls will be issued to fetch pages as needed.
528
+ # result.each do |item|
531
529
  # # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
532
- # p response
530
+ # p item
533
531
  # end
534
532
  #
535
533
  def list_os_policy_assignments request, options = nil
@@ -621,13 +619,11 @@ module Google
621
619
  # # Call the list_os_policy_assignment_revisions method.
622
620
  # result = client.list_os_policy_assignment_revisions request
623
621
  #
624
- # # The returned object is of type Gapic::PagedEnumerable. You can
625
- # # iterate over all elements by calling #each, and the enumerable
626
- # # will lazily make API calls to fetch subsequent pages. Other
627
- # # methods are also available for managing paging directly.
628
- # result.each do |response|
622
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
623
+ # # over elements, and API calls will be issued to fetch pages as needed.
624
+ # result.each do |item|
629
625
  # # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
630
- # p response
626
+ # p item
631
627
  # end
632
628
  #
633
629
  def list_os_policy_assignment_revisions request, options = nil
@@ -724,14 +720,14 @@ module Google
724
720
  # # Call the delete_os_policy_assignment method.
725
721
  # result = client.delete_os_policy_assignment request
726
722
  #
727
- # # The returned object is of type Gapic::Operation. You can use this
728
- # # object to check the status of an operation, cancel it, or wait
729
- # # for results. Here is how to block until completion:
723
+ # # The returned object is of type Gapic::Operation. You can use it to
724
+ # # check the status of an operation, cancel it, or wait for results.
725
+ # # Here is how to wait for a response.
730
726
  # result.wait_until_done! timeout: 60
731
727
  # if result.response?
732
728
  # p result.response
733
729
  # else
734
- # puts "Error!"
730
+ # puts "No response received."
735
731
  # end
736
732
  #
737
733
  def delete_os_policy_assignment request, options = nil
@@ -941,13 +937,11 @@ module Google
941
937
  # # Call the list_os_policy_assignment_reports method.
942
938
  # result = client.list_os_policy_assignment_reports request
943
939
  #
944
- # # The returned object is of type Gapic::PagedEnumerable. You can
945
- # # iterate over all elements by calling #each, and the enumerable
946
- # # will lazily make API calls to fetch subsequent pages. Other
947
- # # methods are also available for managing paging directly.
948
- # result.each do |response|
940
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
941
+ # # over elements, and API calls will be issued to fetch pages as needed.
942
+ # result.each do |item|
949
943
  # # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport.
950
- # p response
944
+ # p item
951
945
  # end
952
946
  #
953
947
  def list_os_policy_assignment_reports request, options = nil
@@ -1145,13 +1139,11 @@ module Google
1145
1139
  # # Call the list_inventories method.
1146
1140
  # result = client.list_inventories request
1147
1141
  #
1148
- # # The returned object is of type Gapic::PagedEnumerable. You can
1149
- # # iterate over all elements by calling #each, and the enumerable
1150
- # # will lazily make API calls to fetch subsequent pages. Other
1151
- # # methods are also available for managing paging directly.
1152
- # result.each do |response|
1142
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1143
+ # # over elements, and API calls will be issued to fetch pages as needed.
1144
+ # result.each do |item|
1153
1145
  # # Each element is of type ::Google::Cloud::OsConfig::V1::Inventory.
1154
- # p response
1146
+ # p item
1155
1147
  # end
1156
1148
  #
1157
1149
  def list_inventories request, options = nil
@@ -1343,13 +1335,11 @@ module Google
1343
1335
  # # Call the list_vulnerability_reports method.
1344
1336
  # result = client.list_vulnerability_reports request
1345
1337
  #
1346
- # # The returned object is of type Gapic::PagedEnumerable. You can
1347
- # # iterate over all elements by calling #each, and the enumerable
1348
- # # will lazily make API calls to fetch subsequent pages. Other
1349
- # # methods are also available for managing paging directly.
1350
- # result.each do |response|
1338
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1339
+ # # over elements, and API calls will be issued to fetch pages as needed.
1340
+ # result.each do |item|
1351
1341
  # # Each element is of type ::Google::Cloud::OsConfig::V1::VulnerabilityReport.
1352
- # p response
1342
+ # p item
1353
1343
  # end
1354
1344
  #
1355
1345
  def list_vulnerability_reports request, options = nil
@@ -1432,9 +1422,9 @@ module Google
1432
1422
  # * (`String`) The path to a service account key file in JSON format
1433
1423
  # * (`Hash`) A service account key as a Hash
1434
1424
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1435
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1425
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1436
1426
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1437
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1427
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1438
1428
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1439
1429
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1440
1430
  # * (`nil`) indicating no credentials
@@ -1476,7 +1466,9 @@ module Google
1476
1466
  class Configuration
1477
1467
  extend ::Gapic::Config
1478
1468
 
1479
- config_attr :endpoint, "osconfig.googleapis.com", ::String
1469
+ DEFAULT_ENDPOINT = "osconfig.googleapis.com"
1470
+
1471
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1480
1472
  config_attr :credentials, nil do |value|
1481
1473
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1482
1474
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -622,9 +620,9 @@ module Google
622
620
  # * (`String`) The path to a service account key file in JSON format
623
621
  # * (`Hash`) A service account key as a Hash
624
622
  # * (`Google::Auth::Credentials`) A googleauth credentials object
625
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
623
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
626
624
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
627
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
625
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
628
626
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
629
627
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
630
628
  # * (`nil`) indicating no credentials
@@ -666,7 +664,9 @@ module Google
666
664
  class Configuration
667
665
  extend ::Gapic::Config
668
666
 
669
- config_attr :endpoint, "osconfig.googleapis.com", ::String
667
+ DEFAULT_ENDPOINT = "osconfig.googleapis.com"
668
+
669
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
670
670
  config_attr :credentials, nil do |value|
671
671
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
672
672
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC