google-cloud-compute-v1 2.10.0 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +9 -3
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +17 -7
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +17 -7
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +27 -12
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +35 -16
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +51 -1
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +9 -3
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +39 -18
  10. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +15 -6
  11. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +39 -18
  12. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +15 -6
  13. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +19 -8
  14. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +15 -6
  15. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +17 -7
  16. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +17 -7
  17. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +13 -5
  18. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +9 -3
  19. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +13 -5
  20. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +17 -7
  21. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +5 -1
  22. data/lib/google/cloud/compute/v1/images/rest/client.rb +25 -11
  23. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/credentials.rb +52 -0
  24. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +837 -0
  25. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/service_stub.rb +378 -0
  26. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest.rb +51 -0
  27. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests.rb +47 -0
  28. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +43 -20
  29. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +21 -9
  30. data/lib/google/cloud/compute/v1/instance_settings_service/credentials.rb +52 -0
  31. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +517 -0
  32. data/lib/google/cloud/compute/v1/instance_settings_service/rest/service_stub.rb +190 -0
  33. data/lib/google/cloud/compute/v1/instance_settings_service/rest.rb +51 -0
  34. data/lib/google/cloud/compute/v1/instance_settings_service.rb +47 -0
  35. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +19 -8
  36. data/lib/google/cloud/compute/v1/instances/rest/client.rb +99 -48
  37. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +21 -9
  38. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +17 -7
  39. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +7 -2
  40. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +7 -2
  41. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +19 -8
  42. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +7 -2
  43. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +17 -7
  44. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +17 -7
  45. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +9 -3
  46. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +21 -9
  47. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +13 -5
  48. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +21 -9
  49. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -16
  50. data/lib/google/cloud/compute/v1/networks/rest/client.rb +25 -11
  51. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +136 -14
  52. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +62 -0
  53. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +19 -8
  54. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +9 -3
  55. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +17 -7
  56. data/lib/google/cloud/compute/v1/projects/rest/client.rb +31 -14
  57. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +17 -7
  58. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +19 -8
  59. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +15 -6
  60. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +27 -12
  61. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +13 -5
  62. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +7 -2
  63. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +37 -17
  64. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +13 -5
  65. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +15 -6
  66. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +41 -19
  67. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +11 -4
  68. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +11 -4
  69. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +5 -1
  70. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +19 -8
  71. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +17 -7
  72. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +37 -17
  73. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +11 -4
  74. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +11 -4
  75. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +21 -9
  76. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +11 -4
  77. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +15 -6
  78. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +13 -5
  79. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +17 -7
  80. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +11 -4
  81. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +17 -7
  82. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +5 -1
  83. data/lib/google/cloud/compute/v1/regions/rest/client.rb +7 -2
  84. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +23 -10
  85. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +21 -9
  86. data/lib/google/cloud/compute/v1/rest.rb +4 -0
  87. data/lib/google/cloud/compute/v1/routers/rest/client.rb +25 -11
  88. data/lib/google/cloud/compute/v1/routes/rest/client.rb +11 -4
  89. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +27 -12
  90. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +21 -9
  91. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +7 -2
  92. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +19 -8
  93. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +13 -5
  94. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +17 -7
  95. data/lib/google/cloud/compute/v1/storage_pool_types/credentials.rb +53 -0
  96. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +609 -0
  97. data/lib/google/cloud/compute/v1/storage_pool_types/rest/service_stub.rb +249 -0
  98. data/lib/google/cloud/compute/v1/storage_pool_types/rest.rb +51 -0
  99. data/lib/google/cloud/compute/v1/storage_pool_types.rb +47 -0
  100. data/lib/google/cloud/compute/v1/storage_pools/credentials.rb +52 -0
  101. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +1326 -0
  102. data/lib/google/cloud/compute/v1/storage_pools/rest/service_stub.rb +679 -0
  103. data/lib/google/cloud/compute/v1/storage_pools/rest.rb +51 -0
  104. data/lib/google/cloud/compute/v1/storage_pools.rb +47 -0
  105. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +27 -12
  106. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +13 -5
  107. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +17 -7
  108. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +25 -11
  109. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +15 -6
  110. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +27 -12
  111. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +21 -9
  112. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +17 -7
  113. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +15 -6
  114. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +21 -9
  115. data/lib/google/cloud/compute/v1/version.rb +1 -1
  116. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +19 -8
  117. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +15 -6
  118. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +11 -4
  119. data/lib/google/cloud/compute/v1/zones/rest/client.rb +7 -2
  120. data/lib/google/cloud/compute/v1.rb +4 -0
  121. data/proto_docs/google/api/client.rb +4 -0
  122. data/proto_docs/google/cloud/compute/v1/compute.rb +1333 -37
  123. metadata +22 -2
@@ -33,6 +33,9 @@ module Google
33
33
  # The NodeGroups API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
41
 
@@ -100,6 +103,8 @@ module Google
100
103
 
101
104
  default_config.rpcs.patch.timeout = 600.0
102
105
 
106
+ default_config.rpcs.perform_maintenance.timeout = 600.0
107
+
103
108
  default_config.rpcs.set_iam_policy.timeout = 600.0
104
109
 
105
110
  default_config.rpcs.set_node_template.timeout = 600.0
@@ -268,12 +273,13 @@ module Google
268
273
  # Customize the options with defaults
269
274
  call_metadata = @config.rpcs.add_nodes.metadata.to_h
270
275
 
271
- # Set x-goog-api-client and x-goog-user-project headers
276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
272
277
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
273
278
  lib_name: @config.lib_name, lib_version: @config.lib_version,
274
279
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
275
280
  transports_version_send: [:rest]
276
281
 
282
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
277
283
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
278
284
 
279
285
  options.apply_defaults timeout: @config.rpcs.add_nodes.timeout,
@@ -369,12 +375,13 @@ module Google
369
375
  # Customize the options with defaults
370
376
  call_metadata = @config.rpcs.aggregated_list.metadata.to_h
371
377
 
372
- # Set x-goog-api-client and x-goog-user-project headers
378
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
373
379
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
374
380
  lib_name: @config.lib_name, lib_version: @config.lib_version,
375
381
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
376
382
  transports_version_send: [:rest]
377
383
 
384
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
378
385
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
379
386
 
380
387
  options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
@@ -454,12 +461,13 @@ module Google
454
461
  # Customize the options with defaults
455
462
  call_metadata = @config.rpcs.delete.metadata.to_h
456
463
 
457
- # Set x-goog-api-client and x-goog-user-project headers
464
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
458
465
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
459
466
  lib_name: @config.lib_name, lib_version: @config.lib_version,
460
467
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
461
468
  transports_version_send: [:rest]
462
469
 
470
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
463
471
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
472
 
465
473
  options.apply_defaults timeout: @config.rpcs.delete.timeout,
@@ -549,12 +557,13 @@ module Google
549
557
  # Customize the options with defaults
550
558
  call_metadata = @config.rpcs.delete_nodes.metadata.to_h
551
559
 
552
- # Set x-goog-api-client and x-goog-user-project headers
560
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
553
561
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
554
562
  lib_name: @config.lib_name, lib_version: @config.lib_version,
555
563
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
556
564
  transports_version_send: [:rest]
557
565
 
566
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
558
567
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
559
568
 
560
569
  options.apply_defaults timeout: @config.rpcs.delete_nodes.timeout,
@@ -640,12 +649,13 @@ module Google
640
649
  # Customize the options with defaults
641
650
  call_metadata = @config.rpcs.get.metadata.to_h
642
651
 
643
- # Set x-goog-api-client and x-goog-user-project headers
652
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
644
653
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
645
654
  lib_name: @config.lib_name, lib_version: @config.lib_version,
646
655
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
647
656
  transports_version_send: [:rest]
648
657
 
658
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
649
659
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
650
660
 
651
661
  options.apply_defaults timeout: @config.rpcs.get.timeout,
@@ -724,12 +734,13 @@ module Google
724
734
  # Customize the options with defaults
725
735
  call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
726
736
 
727
- # Set x-goog-api-client and x-goog-user-project headers
737
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
728
738
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
729
739
  lib_name: @config.lib_name, lib_version: @config.lib_version,
730
740
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
731
741
  transports_version_send: [:rest]
732
742
 
743
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
733
744
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
734
745
 
735
746
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
@@ -810,12 +821,13 @@ module Google
810
821
  # Customize the options with defaults
811
822
  call_metadata = @config.rpcs.insert.metadata.to_h
812
823
 
813
- # Set x-goog-api-client and x-goog-user-project headers
824
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
814
825
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
815
826
  lib_name: @config.lib_name, lib_version: @config.lib_version,
816
827
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
817
828
  transports_version_send: [:rest]
818
829
 
830
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
819
831
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
820
832
 
821
833
  options.apply_defaults timeout: @config.rpcs.insert.timeout,
@@ -909,12 +921,13 @@ module Google
909
921
  # Customize the options with defaults
910
922
  call_metadata = @config.rpcs.list.metadata.to_h
911
923
 
912
- # Set x-goog-api-client and x-goog-user-project headers
924
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
913
925
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
914
926
  lib_name: @config.lib_name, lib_version: @config.lib_version,
915
927
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
916
928
  transports_version_send: [:rest]
917
929
 
930
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
918
931
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
919
932
 
920
933
  options.apply_defaults timeout: @config.rpcs.list.timeout,
@@ -1002,12 +1015,13 @@ module Google
1002
1015
  # Customize the options with defaults
1003
1016
  call_metadata = @config.rpcs.list_nodes.metadata.to_h
1004
1017
 
1005
- # Set x-goog-api-client and x-goog-user-project headers
1018
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1006
1019
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1007
1020
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1008
1021
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1009
1022
  transports_version_send: [:rest]
1010
1023
 
1024
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1011
1025
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1012
1026
 
1013
1027
  options.apply_defaults timeout: @config.rpcs.list_nodes.timeout,
@@ -1089,12 +1103,13 @@ module Google
1089
1103
  # Customize the options with defaults
1090
1104
  call_metadata = @config.rpcs.patch.metadata.to_h
1091
1105
 
1092
- # Set x-goog-api-client and x-goog-user-project headers
1106
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1093
1107
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1094
1108
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1095
1109
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1096
1110
  transports_version_send: [:rest]
1097
1111
 
1112
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1098
1113
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1099
1114
 
1100
1115
  options.apply_defaults timeout: @config.rpcs.patch.timeout,
@@ -1122,6 +1137,102 @@ module Google
1122
1137
  raise ::Google::Cloud::Error.from_error(e)
1123
1138
  end
1124
1139
 
1140
+ ##
1141
+ # Perform maintenance on a subset of nodes in the node group.
1142
+ #
1143
+ # @overload perform_maintenance(request, options = nil)
1144
+ # Pass arguments to `perform_maintenance` via a request object, either of type
1145
+ # {::Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest} or an equivalent Hash.
1146
+ #
1147
+ # @param request [::Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest, ::Hash]
1148
+ # A request object representing the call parameters. Required. To specify no
1149
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1150
+ # @param options [::Gapic::CallOptions, ::Hash]
1151
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1152
+ #
1153
+ # @overload perform_maintenance(node_group: nil, node_groups_perform_maintenance_request_resource: nil, project: nil, request_id: nil, zone: nil)
1154
+ # Pass arguments to `perform_maintenance` via keyword arguments. Note that at
1155
+ # least one keyword argument is required. To specify no parameters, or to keep all
1156
+ # the default parameter values, pass an empty Hash as a request object (see above).
1157
+ #
1158
+ # @param node_group [::String]
1159
+ # Name of the node group scoping this request.
1160
+ # @param node_groups_perform_maintenance_request_resource [::Google::Cloud::Compute::V1::NodeGroupsPerformMaintenanceRequest, ::Hash]
1161
+ # The body resource for this request
1162
+ # @param project [::String]
1163
+ # Project ID for this request.
1164
+ # @param request_id [::String]
1165
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
1166
+ # @param zone [::String]
1167
+ # The name of the zone for this request.
1168
+ # @yield [result, operation] Access the result along with the TransportOperation object
1169
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
1170
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1171
+ #
1172
+ # @return [::Gapic::GenericLRO::Operation]
1173
+ #
1174
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1175
+ #
1176
+ # @example Basic example
1177
+ # require "google/cloud/compute/v1"
1178
+ #
1179
+ # # Create a client object. The client can be reused for multiple calls.
1180
+ # client = Google::Cloud::Compute::V1::NodeGroups::Rest::Client.new
1181
+ #
1182
+ # # Create a request. To set request fields, pass in keyword arguments.
1183
+ # request = Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest.new
1184
+ #
1185
+ # # Call the perform_maintenance method.
1186
+ # result = client.perform_maintenance request
1187
+ #
1188
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1189
+ # p result
1190
+ #
1191
+ def perform_maintenance request, options = nil
1192
+ raise ::ArgumentError, "request must be provided" if request.nil?
1193
+
1194
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest
1195
+
1196
+ # Converts hash and nil to an options object
1197
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1198
+
1199
+ # Customize the options with defaults
1200
+ call_metadata = @config.rpcs.perform_maintenance.metadata.to_h
1201
+
1202
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1203
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1204
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1205
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1206
+ transports_version_send: [:rest]
1207
+
1208
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1209
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1210
+
1211
+ options.apply_defaults timeout: @config.rpcs.perform_maintenance.timeout,
1212
+ metadata: call_metadata,
1213
+ retry_policy: @config.rpcs.perform_maintenance.retry_policy
1214
+
1215
+ options.apply_defaults timeout: @config.timeout,
1216
+ metadata: @config.metadata,
1217
+ retry_policy: @config.retry_policy
1218
+
1219
+ @node_groups_stub.perform_maintenance request, options do |result, response|
1220
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
1221
+ operation: result,
1222
+ client: zone_operations,
1223
+ request_values: {
1224
+ "project" => request.project,
1225
+ "zone" => request.zone
1226
+ },
1227
+ options: options
1228
+ )
1229
+ yield result, response if block_given?
1230
+ return result
1231
+ end
1232
+ rescue ::Gapic::Rest::Error => e
1233
+ raise ::Google::Cloud::Error.from_error(e)
1234
+ end
1235
+
1125
1236
  ##
1126
1237
  # Sets the access control policy on the specified resource. Replaces any existing policy.
1127
1238
  #
@@ -1182,12 +1293,13 @@ module Google
1182
1293
  # Customize the options with defaults
1183
1294
  call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1184
1295
 
1185
- # Set x-goog-api-client and x-goog-user-project headers
1296
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1186
1297
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1187
1298
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1188
1299
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1189
1300
  transports_version_send: [:rest]
1190
1301
 
1302
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1191
1303
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1192
1304
 
1193
1305
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
@@ -1268,12 +1380,13 @@ module Google
1268
1380
  # Customize the options with defaults
1269
1381
  call_metadata = @config.rpcs.set_node_template.metadata.to_h
1270
1382
 
1271
- # Set x-goog-api-client and x-goog-user-project headers
1383
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1272
1384
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1273
1385
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1274
1386
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1275
1387
  transports_version_send: [:rest]
1276
1388
 
1389
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1277
1390
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1278
1391
 
1279
1392
  options.apply_defaults timeout: @config.rpcs.set_node_template.timeout,
@@ -1363,12 +1476,13 @@ module Google
1363
1476
  # Customize the options with defaults
1364
1477
  call_metadata = @config.rpcs.simulate_maintenance_event.metadata.to_h
1365
1478
 
1366
- # Set x-goog-api-client and x-goog-user-project headers
1479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1367
1480
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1368
1481
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1369
1482
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1370
1483
  transports_version_send: [:rest]
1371
1484
 
1485
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1372
1486
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1373
1487
 
1374
1488
  options.apply_defaults timeout: @config.rpcs.simulate_maintenance_event.timeout,
@@ -1456,12 +1570,13 @@ module Google
1456
1570
  # Customize the options with defaults
1457
1571
  call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1458
1572
 
1459
- # Set x-goog-api-client and x-goog-user-project headers
1573
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1460
1574
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1461
1575
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1462
1576
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1463
1577
  transports_version_send: [:rest]
1464
1578
 
1579
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1465
1580
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1466
1581
 
1467
1582
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
@@ -1664,6 +1779,11 @@ module Google
1664
1779
  #
1665
1780
  attr_reader :patch
1666
1781
  ##
1782
+ # RPC-specific configuration for `perform_maintenance`
1783
+ # @return [::Gapic::Config::Method]
1784
+ #
1785
+ attr_reader :perform_maintenance
1786
+ ##
1667
1787
  # RPC-specific configuration for `set_iam_policy`
1668
1788
  # @return [::Gapic::Config::Method]
1669
1789
  #
@@ -1706,6 +1826,8 @@ module Google
1706
1826
  @list_nodes = ::Gapic::Config::Method.new list_nodes_config
1707
1827
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1708
1828
  @patch = ::Gapic::Config::Method.new patch_config
1829
+ perform_maintenance_config = parent_rpcs.perform_maintenance if parent_rpcs.respond_to? :perform_maintenance
1830
+ @perform_maintenance = ::Gapic::Config::Method.new perform_maintenance_config
1709
1831
  set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1710
1832
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1711
1833
  set_node_template_config = parent_rpcs.set_node_template if parent_rpcs.respond_to? :set_node_template
@@ -441,6 +441,44 @@ module Google
441
441
  result
442
442
  end
443
443
 
444
+ ##
445
+ # Baseline implementation for the perform_maintenance REST call
446
+ #
447
+ # @param request_pb [::Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest]
448
+ # A request object representing the call parameters. Required.
449
+ # @param options [::Gapic::CallOptions]
450
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
451
+ #
452
+ # @yield [result, operation] Access the result along with the TransportOperation object
453
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
454
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
455
+ #
456
+ # @return [::Google::Cloud::Compute::V1::Operation]
457
+ # A result object deserialized from the server's reply
458
+ def perform_maintenance request_pb, options = nil
459
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
460
+
461
+ verb, uri, query_string_params, body = ServiceStub.transcode_perform_maintenance_request request_pb
462
+ query_string_params = if query_string_params.any?
463
+ query_string_params.to_h { |p| p.split "=", 2 }
464
+ else
465
+ {}
466
+ end
467
+
468
+ response = @client_stub.make_http_request(
469
+ verb,
470
+ uri: uri,
471
+ body: body || "",
472
+ params: query_string_params,
473
+ options: options
474
+ )
475
+ operation = ::Gapic::Rest::TransportOperation.new response
476
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
477
+
478
+ yield result, operation if block_given?
479
+ result
480
+ end
481
+
444
482
  ##
445
483
  # Baseline implementation for the set_iam_policy REST call
446
484
  #
@@ -823,6 +861,30 @@ module Google
823
861
  transcoder.transcode request_pb
824
862
  end
825
863
 
864
+ ##
865
+ # @private
866
+ #
867
+ # GRPC transcoding helper method for the perform_maintenance REST call
868
+ #
869
+ # @param request_pb [::Google::Cloud::Compute::V1::PerformMaintenanceNodeGroupRequest]
870
+ # A request object representing the call parameters. Required.
871
+ # @return [Array(String, [String, nil], Hash{String => String})]
872
+ # Uri, Body, Query string parameters
873
+ def self.transcode_perform_maintenance_request request_pb
874
+ transcoder = Gapic::Rest::GrpcTranscoder.new
875
+ .with_bindings(
876
+ uri_method: :post,
877
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/performMaintenance",
878
+ body: "node_groups_perform_maintenance_request_resource",
879
+ matches: [
880
+ ["project", %r{^[^/]+/?$}, false],
881
+ ["zone", %r{^[^/]+/?$}, false],
882
+ ["node_group", %r{^[^/]+/?$}, false]
883
+ ]
884
+ )
885
+ transcoder.transcode request_pb
886
+ end
887
+
826
888
  ##
827
889
  # @private
828
890
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The NodeTemplates API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
41
 
@@ -262,12 +265,13 @@ module Google
262
265
  # Customize the options with defaults
263
266
  call_metadata = @config.rpcs.aggregated_list.metadata.to_h
264
267
 
265
- # Set x-goog-api-client and x-goog-user-project headers
268
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
266
269
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
267
270
  lib_name: @config.lib_name, lib_version: @config.lib_version,
268
271
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
269
272
  transports_version_send: [:rest]
270
273
 
274
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
271
275
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
272
276
 
273
277
  options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
@@ -347,12 +351,13 @@ module Google
347
351
  # Customize the options with defaults
348
352
  call_metadata = @config.rpcs.delete.metadata.to_h
349
353
 
350
- # Set x-goog-api-client and x-goog-user-project headers
354
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
351
355
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
356
  lib_name: @config.lib_name, lib_version: @config.lib_version,
353
357
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
354
358
  transports_version_send: [:rest]
355
359
 
360
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
356
361
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
362
 
358
363
  options.apply_defaults timeout: @config.rpcs.delete.timeout,
@@ -438,12 +443,13 @@ module Google
438
443
  # Customize the options with defaults
439
444
  call_metadata = @config.rpcs.get.metadata.to_h
440
445
 
441
- # Set x-goog-api-client and x-goog-user-project headers
446
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
442
447
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
448
  lib_name: @config.lib_name, lib_version: @config.lib_version,
444
449
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
445
450
  transports_version_send: [:rest]
446
451
 
452
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
447
453
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
454
 
449
455
  options.apply_defaults timeout: @config.rpcs.get.timeout,
@@ -522,12 +528,13 @@ module Google
522
528
  # Customize the options with defaults
523
529
  call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
524
530
 
525
- # Set x-goog-api-client and x-goog-user-project headers
531
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
526
532
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
527
533
  lib_name: @config.lib_name, lib_version: @config.lib_version,
528
534
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
529
535
  transports_version_send: [:rest]
530
536
 
537
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
531
538
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
532
539
 
533
540
  options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
@@ -606,12 +613,13 @@ module Google
606
613
  # Customize the options with defaults
607
614
  call_metadata = @config.rpcs.insert.metadata.to_h
608
615
 
609
- # Set x-goog-api-client and x-goog-user-project headers
616
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
610
617
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
611
618
  lib_name: @config.lib_name, lib_version: @config.lib_version,
612
619
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
613
620
  transports_version_send: [:rest]
614
621
 
622
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
615
623
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
616
624
 
617
625
  options.apply_defaults timeout: @config.rpcs.insert.timeout,
@@ -705,12 +713,13 @@ module Google
705
713
  # Customize the options with defaults
706
714
  call_metadata = @config.rpcs.list.metadata.to_h
707
715
 
708
- # Set x-goog-api-client and x-goog-user-project headers
716
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
709
717
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
710
718
  lib_name: @config.lib_name, lib_version: @config.lib_version,
711
719
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
712
720
  transports_version_send: [:rest]
713
721
 
722
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
714
723
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
724
 
716
725
  options.apply_defaults timeout: @config.rpcs.list.timeout,
@@ -790,12 +799,13 @@ module Google
790
799
  # Customize the options with defaults
791
800
  call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
792
801
 
793
- # Set x-goog-api-client and x-goog-user-project headers
802
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
794
803
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
795
804
  lib_name: @config.lib_name, lib_version: @config.lib_version,
796
805
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
797
806
  transports_version_send: [:rest]
798
807
 
808
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
799
809
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
810
 
801
811
  options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
@@ -874,12 +884,13 @@ module Google
874
884
  # Customize the options with defaults
875
885
  call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
876
886
 
877
- # Set x-goog-api-client and x-goog-user-project headers
887
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
878
888
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
879
889
  lib_name: @config.lib_name, lib_version: @config.lib_version,
880
890
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
881
891
  transports_version_send: [:rest]
882
892
 
893
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
883
894
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
884
895
 
885
896
  options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
@@ -32,6 +32,9 @@ module Google
32
32
  # The NodeTypes API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
40
 
@@ -234,12 +237,13 @@ module Google
234
237
  # Customize the options with defaults
235
238
  call_metadata = @config.rpcs.aggregated_list.metadata.to_h
236
239
 
237
- # Set x-goog-api-client and x-goog-user-project headers
240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
238
241
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
242
  lib_name: @config.lib_name, lib_version: @config.lib_version,
240
243
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
241
244
  transports_version_send: [:rest]
242
245
 
246
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
243
247
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
248
 
245
249
  options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
@@ -317,12 +321,13 @@ module Google
317
321
  # Customize the options with defaults
318
322
  call_metadata = @config.rpcs.get.metadata.to_h
319
323
 
320
- # Set x-goog-api-client and x-goog-user-project headers
324
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
321
325
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
322
326
  lib_name: @config.lib_name, lib_version: @config.lib_version,
323
327
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
324
328
  transports_version_send: [:rest]
325
329
 
330
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
326
331
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
327
332
 
328
333
  options.apply_defaults timeout: @config.rpcs.get.timeout,
@@ -407,12 +412,13 @@ module Google
407
412
  # Customize the options with defaults
408
413
  call_metadata = @config.rpcs.list.metadata.to_h
409
414
 
410
- # Set x-goog-api-client and x-goog-user-project headers
415
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
411
416
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
412
417
  lib_name: @config.lib_name, lib_version: @config.lib_version,
413
418
  gapic_version: ::Google::Cloud::Compute::V1::VERSION,
414
419
  transports_version_send: [:rest]
415
420
 
421
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
416
422
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
417
423
 
418
424
  options.apply_defaults timeout: @config.rpcs.list.timeout,