google-cloud-os_config-v1 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/os_config/v1/os_config_service/client.rb +41 -9
- data/lib/google/cloud/os_config/v1/os_config_service/rest/client.rb +237 -7
- data/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/client.rb +42 -9
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/operations.rb +38 -7
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/client.rb +267 -7
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/operations.rb +108 -8
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb +14 -2
- data/lib/google/cloud/os_config/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/osconfig/v1/vulnerability.rb +2 -0
- metadata +5 -5
@@ -35,6 +35,9 @@ module Google
|
|
35
35
|
# manage package installations and patch jobs for Compute Engine VM instances.
|
36
36
|
#
|
37
37
|
class Client
|
38
|
+
# @private
|
39
|
+
DEFAULT_ENDPOINT_TEMPLATE = "osconfig.$UNIVERSE_DOMAIN$"
|
40
|
+
|
38
41
|
include Paths
|
39
42
|
|
40
43
|
# @private
|
@@ -100,6 +103,15 @@ module Google
|
|
100
103
|
@config
|
101
104
|
end
|
102
105
|
|
106
|
+
##
|
107
|
+
# The effective universe domain
|
108
|
+
#
|
109
|
+
# @return [String]
|
110
|
+
#
|
111
|
+
def universe_domain
|
112
|
+
@os_config_zonal_service_stub.universe_domain
|
113
|
+
end
|
114
|
+
|
103
115
|
##
|
104
116
|
# Create a new OsConfigZonalService REST client object.
|
105
117
|
#
|
@@ -127,8 +139,9 @@ module Google
|
|
127
139
|
credentials = @config.credentials
|
128
140
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
129
141
|
# but only if the default endpoint does not have a region prefix.
|
130
|
-
enable_self_signed_jwt = @config.endpoint
|
131
|
-
|
142
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
143
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
144
|
+
!@config.endpoint.split(".").first.include?("-"))
|
132
145
|
credentials ||= Credentials.default scope: @config.scope,
|
133
146
|
enable_self_signed_jwt: enable_self_signed_jwt
|
134
147
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -142,9 +155,15 @@ module Google
|
|
142
155
|
config.credentials = credentials
|
143
156
|
config.quota_project = @quota_project_id
|
144
157
|
config.endpoint = @config.endpoint
|
158
|
+
config.universe_domain = @config.universe_domain
|
145
159
|
end
|
146
160
|
|
147
|
-
@os_config_zonal_service_stub = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::ServiceStub.new
|
161
|
+
@os_config_zonal_service_stub = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::ServiceStub.new(
|
162
|
+
endpoint: @config.endpoint,
|
163
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
164
|
+
universe_domain: @config.universe_domain,
|
165
|
+
credentials: credentials
|
166
|
+
)
|
148
167
|
end
|
149
168
|
|
150
169
|
##
|
@@ -203,6 +222,29 @@ module Google
|
|
203
222
|
# @return [::Gapic::Operation]
|
204
223
|
#
|
205
224
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
225
|
+
#
|
226
|
+
# @example Basic example
|
227
|
+
# require "google/cloud/os_config/v1"
|
228
|
+
#
|
229
|
+
# # Create a client object. The client can be reused for multiple calls.
|
230
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
231
|
+
#
|
232
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
233
|
+
# request = Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest.new
|
234
|
+
#
|
235
|
+
# # Call the create_os_policy_assignment method.
|
236
|
+
# result = client.create_os_policy_assignment request
|
237
|
+
#
|
238
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
239
|
+
# # check the status of an operation, cancel it, or wait for results.
|
240
|
+
# # Here is how to wait for a response.
|
241
|
+
# result.wait_until_done! timeout: 60
|
242
|
+
# if result.response?
|
243
|
+
# p result.response
|
244
|
+
# else
|
245
|
+
# puts "No response received."
|
246
|
+
# end
|
247
|
+
#
|
206
248
|
def create_os_policy_assignment request, options = nil
|
207
249
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
208
250
|
|
@@ -277,6 +319,29 @@ module Google
|
|
277
319
|
# @return [::Gapic::Operation]
|
278
320
|
#
|
279
321
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
322
|
+
#
|
323
|
+
# @example Basic example
|
324
|
+
# require "google/cloud/os_config/v1"
|
325
|
+
#
|
326
|
+
# # Create a client object. The client can be reused for multiple calls.
|
327
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
328
|
+
#
|
329
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
330
|
+
# request = Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest.new
|
331
|
+
#
|
332
|
+
# # Call the update_os_policy_assignment method.
|
333
|
+
# result = client.update_os_policy_assignment request
|
334
|
+
#
|
335
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
336
|
+
# # check the status of an operation, cancel it, or wait for results.
|
337
|
+
# # Here is how to wait for a response.
|
338
|
+
# result.wait_until_done! timeout: 60
|
339
|
+
# if result.response?
|
340
|
+
# p result.response
|
341
|
+
# else
|
342
|
+
# puts "No response received."
|
343
|
+
# end
|
344
|
+
#
|
280
345
|
def update_os_policy_assignment request, options = nil
|
281
346
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
282
347
|
|
@@ -347,6 +412,22 @@ module Google
|
|
347
412
|
# @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignment]
|
348
413
|
#
|
349
414
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
415
|
+
#
|
416
|
+
# @example Basic example
|
417
|
+
# require "google/cloud/os_config/v1"
|
418
|
+
#
|
419
|
+
# # Create a client object. The client can be reused for multiple calls.
|
420
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
421
|
+
#
|
422
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
423
|
+
# request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest.new
|
424
|
+
#
|
425
|
+
# # Call the get_os_policy_assignment method.
|
426
|
+
# result = client.get_os_policy_assignment request
|
427
|
+
#
|
428
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
429
|
+
# p result
|
430
|
+
#
|
350
431
|
def get_os_policy_assignment request, options = nil
|
351
432
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
352
433
|
|
@@ -417,6 +498,26 @@ module Google
|
|
417
498
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
418
499
|
#
|
419
500
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
501
|
+
#
|
502
|
+
# @example Basic example
|
503
|
+
# require "google/cloud/os_config/v1"
|
504
|
+
#
|
505
|
+
# # Create a client object. The client can be reused for multiple calls.
|
506
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
507
|
+
#
|
508
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
509
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest.new
|
510
|
+
#
|
511
|
+
# # Call the list_os_policy_assignments method.
|
512
|
+
# result = client.list_os_policy_assignments request
|
513
|
+
#
|
514
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
515
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
516
|
+
# result.each do |item|
|
517
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
518
|
+
# p item
|
519
|
+
# end
|
520
|
+
#
|
420
521
|
def list_os_policy_assignments request, options = nil
|
421
522
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
422
523
|
|
@@ -486,6 +587,26 @@ module Google
|
|
486
587
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
487
588
|
#
|
488
589
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
590
|
+
#
|
591
|
+
# @example Basic example
|
592
|
+
# require "google/cloud/os_config/v1"
|
593
|
+
#
|
594
|
+
# # Create a client object. The client can be reused for multiple calls.
|
595
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
596
|
+
#
|
597
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
598
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest.new
|
599
|
+
#
|
600
|
+
# # Call the list_os_policy_assignment_revisions method.
|
601
|
+
# result = client.list_os_policy_assignment_revisions request
|
602
|
+
#
|
603
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
604
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
605
|
+
# result.each do |item|
|
606
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
607
|
+
# p item
|
608
|
+
# end
|
609
|
+
#
|
489
610
|
def list_os_policy_assignment_revisions request, options = nil
|
490
611
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
491
612
|
|
@@ -560,6 +681,29 @@ module Google
|
|
560
681
|
# @return [::Gapic::Operation]
|
561
682
|
#
|
562
683
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
684
|
+
#
|
685
|
+
# @example Basic example
|
686
|
+
# require "google/cloud/os_config/v1"
|
687
|
+
#
|
688
|
+
# # Create a client object. The client can be reused for multiple calls.
|
689
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
690
|
+
#
|
691
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
692
|
+
# request = Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest.new
|
693
|
+
#
|
694
|
+
# # Call the delete_os_policy_assignment method.
|
695
|
+
# result = client.delete_os_policy_assignment request
|
696
|
+
#
|
697
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
698
|
+
# # check the status of an operation, cancel it, or wait for results.
|
699
|
+
# # Here is how to wait for a response.
|
700
|
+
# result.wait_until_done! timeout: 60
|
701
|
+
# if result.response?
|
702
|
+
# p result.response
|
703
|
+
# else
|
704
|
+
# puts "No response received."
|
705
|
+
# end
|
706
|
+
#
|
563
707
|
def delete_os_policy_assignment request, options = nil
|
564
708
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
565
709
|
|
@@ -632,6 +776,22 @@ module Google
|
|
632
776
|
# @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport]
|
633
777
|
#
|
634
778
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
779
|
+
#
|
780
|
+
# @example Basic example
|
781
|
+
# require "google/cloud/os_config/v1"
|
782
|
+
#
|
783
|
+
# # Create a client object. The client can be reused for multiple calls.
|
784
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
785
|
+
#
|
786
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
787
|
+
# request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest.new
|
788
|
+
#
|
789
|
+
# # Call the get_os_policy_assignment_report method.
|
790
|
+
# result = client.get_os_policy_assignment_report request
|
791
|
+
#
|
792
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport.
|
793
|
+
# p result
|
794
|
+
#
|
635
795
|
def get_os_policy_assignment_report request, options = nil
|
636
796
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
637
797
|
|
@@ -724,6 +884,26 @@ module Google
|
|
724
884
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport>]
|
725
885
|
#
|
726
886
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
887
|
+
#
|
888
|
+
# @example Basic example
|
889
|
+
# require "google/cloud/os_config/v1"
|
890
|
+
#
|
891
|
+
# # Create a client object. The client can be reused for multiple calls.
|
892
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
893
|
+
#
|
894
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
895
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest.new
|
896
|
+
#
|
897
|
+
# # Call the list_os_policy_assignment_reports method.
|
898
|
+
# result = client.list_os_policy_assignment_reports request
|
899
|
+
#
|
900
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
901
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
902
|
+
# result.each do |item|
|
903
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport.
|
904
|
+
# p item
|
905
|
+
# end
|
906
|
+
#
|
727
907
|
def list_os_policy_assignment_reports request, options = nil
|
728
908
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
729
909
|
|
@@ -798,6 +978,22 @@ module Google
|
|
798
978
|
# @return [::Google::Cloud::OsConfig::V1::Inventory]
|
799
979
|
#
|
800
980
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
981
|
+
#
|
982
|
+
# @example Basic example
|
983
|
+
# require "google/cloud/os_config/v1"
|
984
|
+
#
|
985
|
+
# # Create a client object. The client can be reused for multiple calls.
|
986
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
987
|
+
#
|
988
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
989
|
+
# request = Google::Cloud::OsConfig::V1::GetInventoryRequest.new
|
990
|
+
#
|
991
|
+
# # Call the get_inventory method.
|
992
|
+
# result = client.get_inventory request
|
993
|
+
#
|
994
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::Inventory.
|
995
|
+
# p result
|
996
|
+
#
|
801
997
|
def get_inventory request, options = nil
|
802
998
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
803
999
|
|
@@ -876,6 +1072,26 @@ module Google
|
|
876
1072
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::Inventory>]
|
877
1073
|
#
|
878
1074
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1075
|
+
#
|
1076
|
+
# @example Basic example
|
1077
|
+
# require "google/cloud/os_config/v1"
|
1078
|
+
#
|
1079
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1080
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
1081
|
+
#
|
1082
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1083
|
+
# request = Google::Cloud::OsConfig::V1::ListInventoriesRequest.new
|
1084
|
+
#
|
1085
|
+
# # Call the list_inventories method.
|
1086
|
+
# result = client.list_inventories request
|
1087
|
+
#
|
1088
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1089
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1090
|
+
# result.each do |item|
|
1091
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::Inventory.
|
1092
|
+
# p item
|
1093
|
+
# end
|
1094
|
+
#
|
879
1095
|
def list_inventories request, options = nil
|
880
1096
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
881
1097
|
|
@@ -947,6 +1163,22 @@ module Google
|
|
947
1163
|
# @return [::Google::Cloud::OsConfig::V1::VulnerabilityReport]
|
948
1164
|
#
|
949
1165
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1166
|
+
#
|
1167
|
+
# @example Basic example
|
1168
|
+
# require "google/cloud/os_config/v1"
|
1169
|
+
#
|
1170
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1171
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
1172
|
+
#
|
1173
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1174
|
+
# request = Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest.new
|
1175
|
+
#
|
1176
|
+
# # Call the get_vulnerability_report method.
|
1177
|
+
# result = client.get_vulnerability_report request
|
1178
|
+
#
|
1179
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::VulnerabilityReport.
|
1180
|
+
# p result
|
1181
|
+
#
|
950
1182
|
def get_vulnerability_report request, options = nil
|
951
1183
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
952
1184
|
|
@@ -1022,6 +1254,26 @@ module Google
|
|
1022
1254
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::VulnerabilityReport>]
|
1023
1255
|
#
|
1024
1256
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1257
|
+
#
|
1258
|
+
# @example Basic example
|
1259
|
+
# require "google/cloud/os_config/v1"
|
1260
|
+
#
|
1261
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1262
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
|
1263
|
+
#
|
1264
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1265
|
+
# request = Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest.new
|
1266
|
+
#
|
1267
|
+
# # Call the list_vulnerability_reports method.
|
1268
|
+
# result = client.list_vulnerability_reports request
|
1269
|
+
#
|
1270
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1271
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1272
|
+
# result.each do |item|
|
1273
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::VulnerabilityReport.
|
1274
|
+
# p item
|
1275
|
+
# end
|
1276
|
+
#
|
1025
1277
|
def list_vulnerability_reports request, options = nil
|
1026
1278
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1027
1279
|
|
@@ -1088,9 +1340,9 @@ module Google
|
|
1088
1340
|
# end
|
1089
1341
|
#
|
1090
1342
|
# @!attribute [rw] endpoint
|
1091
|
-
#
|
1092
|
-
#
|
1093
|
-
# @return [::String]
|
1343
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1344
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1345
|
+
# @return [::String,nil]
|
1094
1346
|
# @!attribute [rw] credentials
|
1095
1347
|
# Credentials to send with calls. You may provide any of the following types:
|
1096
1348
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1127,13 +1379,20 @@ module Google
|
|
1127
1379
|
# @!attribute [rw] quota_project
|
1128
1380
|
# A separate project against which to charge quota.
|
1129
1381
|
# @return [::String]
|
1382
|
+
# @!attribute [rw] universe_domain
|
1383
|
+
# The universe domain within which to make requests. This determines the
|
1384
|
+
# default endpoint URL. The default value of nil uses the environment
|
1385
|
+
# universe (usually the default "googleapis.com" universe).
|
1386
|
+
# @return [::String,nil]
|
1130
1387
|
#
|
1131
1388
|
class Configuration
|
1132
1389
|
extend ::Gapic::Config
|
1133
1390
|
|
1391
|
+
# @private
|
1392
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1134
1393
|
DEFAULT_ENDPOINT = "osconfig.googleapis.com"
|
1135
1394
|
|
1136
|
-
config_attr :endpoint,
|
1395
|
+
config_attr :endpoint, nil, ::String, nil
|
1137
1396
|
config_attr :credentials, nil do |value|
|
1138
1397
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1139
1398
|
allowed.any? { |klass| klass === value }
|
@@ -1145,6 +1404,7 @@ module Google
|
|
1145
1404
|
config_attr :metadata, nil, ::Hash, nil
|
1146
1405
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1147
1406
|
config_attr :quota_project, nil, ::String, nil
|
1407
|
+
config_attr :universe_domain, nil, ::String, nil
|
1148
1408
|
|
1149
1409
|
# @private
|
1150
1410
|
def initialize parent_config = nil
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module Rest
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "osconfig.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -84,8 +96,10 @@ module Google
|
|
84
96
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
85
97
|
|
86
98
|
@operations_stub = OperationsServiceStub.new(
|
87
|
-
endpoint:
|
88
|
-
|
99
|
+
endpoint: @config.endpoint,
|
100
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
101
|
+
universe_domain: @config.universe_domain,
|
102
|
+
credentials: credentials
|
89
103
|
)
|
90
104
|
|
91
105
|
# Used by an LRO wrapper for some methods of this service
|
@@ -136,6 +150,26 @@ module Google
|
|
136
150
|
# @return [::Gapic::Operation]
|
137
151
|
#
|
138
152
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
153
|
+
#
|
154
|
+
# @example Basic example
|
155
|
+
# require "google/longrunning"
|
156
|
+
#
|
157
|
+
# # Create a client object. The client can be reused for multiple calls.
|
158
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
159
|
+
#
|
160
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
161
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
162
|
+
#
|
163
|
+
# # Call the list_operations method.
|
164
|
+
# result = client.list_operations request
|
165
|
+
#
|
166
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
167
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
168
|
+
# result.each do |item|
|
169
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
170
|
+
# p item
|
171
|
+
# end
|
172
|
+
#
|
139
173
|
def list_operations request, options = nil
|
140
174
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
141
175
|
|
@@ -201,6 +235,29 @@ module Google
|
|
201
235
|
# @return [::Gapic::Operation]
|
202
236
|
#
|
203
237
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
238
|
+
#
|
239
|
+
# @example Basic example
|
240
|
+
# require "google/longrunning"
|
241
|
+
#
|
242
|
+
# # Create a client object. The client can be reused for multiple calls.
|
243
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
244
|
+
#
|
245
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
246
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
247
|
+
#
|
248
|
+
# # Call the get_operation method.
|
249
|
+
# result = client.get_operation request
|
250
|
+
#
|
251
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
252
|
+
# # check the status of an operation, cancel it, or wait for results.
|
253
|
+
# # Here is how to wait for a response.
|
254
|
+
# result.wait_until_done! timeout: 60
|
255
|
+
# if result.response?
|
256
|
+
# p result.response
|
257
|
+
# else
|
258
|
+
# puts "No response received."
|
259
|
+
# end
|
260
|
+
#
|
204
261
|
def get_operation request, options = nil
|
205
262
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
206
263
|
|
@@ -267,6 +324,22 @@ module Google
|
|
267
324
|
# @return [::Google::Protobuf::Empty]
|
268
325
|
#
|
269
326
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
327
|
+
#
|
328
|
+
# @example Basic example
|
329
|
+
# require "google/longrunning"
|
330
|
+
#
|
331
|
+
# # Create a client object. The client can be reused for multiple calls.
|
332
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
333
|
+
#
|
334
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
335
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
336
|
+
#
|
337
|
+
# # Call the delete_operation method.
|
338
|
+
# result = client.delete_operation request
|
339
|
+
#
|
340
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
341
|
+
# p result
|
342
|
+
#
|
270
343
|
def delete_operation request, options = nil
|
271
344
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
345
|
|
@@ -338,6 +411,22 @@ module Google
|
|
338
411
|
# @return [::Google::Protobuf::Empty]
|
339
412
|
#
|
340
413
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
414
|
+
#
|
415
|
+
# @example Basic example
|
416
|
+
# require "google/longrunning"
|
417
|
+
#
|
418
|
+
# # Create a client object. The client can be reused for multiple calls.
|
419
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
420
|
+
#
|
421
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
422
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
423
|
+
#
|
424
|
+
# # Call the cancel_operation method.
|
425
|
+
# result = client.cancel_operation request
|
426
|
+
#
|
427
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
428
|
+
# p result
|
429
|
+
#
|
341
430
|
def cancel_operation request, options = nil
|
342
431
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
343
432
|
|
@@ -403,9 +492,9 @@ module Google
|
|
403
492
|
# end
|
404
493
|
#
|
405
494
|
# @!attribute [rw] endpoint
|
406
|
-
#
|
407
|
-
#
|
408
|
-
# @return [::String]
|
495
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
496
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
497
|
+
# @return [::String,nil]
|
409
498
|
# @!attribute [rw] credentials
|
410
499
|
# Credentials to send with calls. You may provide any of the following types:
|
411
500
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -442,13 +531,20 @@ module Google
|
|
442
531
|
# @!attribute [rw] quota_project
|
443
532
|
# A separate project against which to charge quota.
|
444
533
|
# @return [::String]
|
534
|
+
# @!attribute [rw] universe_domain
|
535
|
+
# The universe domain within which to make requests. This determines the
|
536
|
+
# default endpoint URL. The default value of nil uses the environment
|
537
|
+
# universe (usually the default "googleapis.com" universe).
|
538
|
+
# @return [::String,nil]
|
445
539
|
#
|
446
540
|
class Configuration
|
447
541
|
extend ::Gapic::Config
|
448
542
|
|
543
|
+
# @private
|
544
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
449
545
|
DEFAULT_ENDPOINT = "osconfig.googleapis.com"
|
450
546
|
|
451
|
-
config_attr :endpoint,
|
547
|
+
config_attr :endpoint, nil, ::String, nil
|
452
548
|
config_attr :credentials, nil do |value|
|
453
549
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
454
550
|
allowed.any? { |klass| klass === value }
|
@@ -460,6 +556,7 @@ module Google
|
|
460
556
|
config_attr :metadata, nil, ::Hash, nil
|
461
557
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
462
558
|
config_attr :quota_project, nil, ::String, nil
|
559
|
+
config_attr :universe_domain, nil, ::String, nil
|
463
560
|
|
464
561
|
# @private
|
465
562
|
def initialize parent_config = nil
|
@@ -542,12 +639,15 @@ module Google
|
|
542
639
|
# Service stub contains baseline method implementations
|
543
640
|
# including transcoding, making the REST call, and deserialing the response.
|
544
641
|
class OperationsServiceStub
|
545
|
-
def initialize endpoint:, credentials:
|
642
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
546
643
|
# These require statements are intentionally placed here to initialize
|
547
644
|
# the REST modules only when it's required.
|
548
645
|
require "gapic/rest"
|
549
646
|
|
550
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
647
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
648
|
+
endpoint_template: endpoint_template,
|
649
|
+
universe_domain: universe_domain,
|
650
|
+
credentials: credentials
|
551
651
|
end
|
552
652
|
|
553
653
|
##
|
@@ -30,16 +30,28 @@ module Google
|
|
30
30
|
# including transcoding, making the REST call, and deserialing the response.
|
31
31
|
#
|
32
32
|
class ServiceStub
|
33
|
-
def initialize endpoint:, credentials:
|
33
|
+
def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
|
34
34
|
# These require statements are intentionally placed here to initialize
|
35
35
|
# the REST modules only when it's required.
|
36
36
|
require "gapic/rest"
|
37
37
|
|
38
|
-
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
38
|
+
@client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
|
39
|
+
endpoint_template: endpoint_template,
|
40
|
+
universe_domain: universe_domain,
|
41
|
+
credentials: credentials,
|
39
42
|
numeric_enums: true,
|
40
43
|
raise_faraday_errors: false
|
41
44
|
end
|
42
45
|
|
46
|
+
##
|
47
|
+
# The effective universe domain
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
#
|
51
|
+
def universe_domain
|
52
|
+
@client_stub.universe_domain
|
53
|
+
end
|
54
|
+
|
43
55
|
##
|
44
56
|
# Baseline implementation for the create_os_policy_assignment REST call
|
45
57
|
#
|
@@ -21,6 +21,7 @@ module Google
|
|
21
21
|
module Api
|
22
22
|
# Required information for every language.
|
23
23
|
# @!attribute [rw] reference_docs_uri
|
24
|
+
# @deprecated This field is deprecated and may be removed in the next major version update.
|
24
25
|
# @return [::String]
|
25
26
|
# Link to automatically generated reference documentation. Example:
|
26
27
|
# https://cloud.google.com/nodejs/docs/reference/asset/latest
|
@@ -304,6 +305,19 @@ module Google
|
|
304
305
|
# seconds: 360 # 6 minutes
|
305
306
|
# total_poll_timeout:
|
306
307
|
# seconds: 54000 # 90 minutes
|
308
|
+
# @!attribute [rw] auto_populated_fields
|
309
|
+
# @return [::Array<::String>]
|
310
|
+
# List of top-level fields of the request message, that should be
|
311
|
+
# automatically populated by the client libraries based on their
|
312
|
+
# (google.api.field_info).format. Currently supported format: UUID4.
|
313
|
+
#
|
314
|
+
# Example of a YAML configuration:
|
315
|
+
#
|
316
|
+
# publishing:
|
317
|
+
# method_settings:
|
318
|
+
# - selector: google.example.v1.ExampleService.CreateExample
|
319
|
+
# auto_populated_fields:
|
320
|
+
# - request_id
|
307
321
|
class MethodSettings
|
308
322
|
include ::Google::Protobuf::MessageExts
|
309
323
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|