google-cloud-compute-v1 2.5.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +37 -10
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +14 -2
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +38 -10
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +14 -2
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +38 -10
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +311 -8
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +196 -2
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +230 -10
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +134 -2
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +37 -10
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +14 -2
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -10
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +14 -2
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +35 -8
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +14 -2
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +35 -8
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +14 -2
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +35 -8
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +14 -2
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +38 -10
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +14 -2
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +35 -8
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +14 -2
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -8
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -2
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +36 -9
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +37 -10
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +14 -2
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +34 -8
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +14 -2
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +35 -8
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +14 -2
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +38 -10
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +14 -2
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +14 -2
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +35 -8
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +14 -2
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +41 -13
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +14 -2
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +39 -11
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +14 -2
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +38 -10
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -2
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +143 -11
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +76 -2
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +38 -10
  53. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +14 -2
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +34 -8
  55. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +14 -2
  56. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +34 -8
  57. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +14 -2
  58. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +128 -9
  59. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +74 -2
  60. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
  61. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +14 -2
  62. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -8
  63. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -2
  64. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -8
  65. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -2
  66. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +37 -10
  67. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +14 -2
  68. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +142 -10
  69. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +76 -2
  70. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +37 -9
  71. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -2
  72. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +39 -11
  73. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +14 -2
  74. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -8
  75. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +14 -2
  76. data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -9
  77. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +14 -2
  78. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +39 -11
  79. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +14 -2
  80. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +38 -10
  81. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +14 -2
  82. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +37 -10
  83. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +14 -2
  84. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +38 -10
  85. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +14 -2
  86. data/lib/google/cloud/compute/v1/projects/rest/client.rb +36 -9
  87. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +14 -2
  88. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +236 -11
  89. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +134 -2
  90. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +242 -10
  91. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +136 -2
  92. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +35 -8
  93. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +14 -2
  94. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +335 -8
  95. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +198 -2
  96. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +38 -10
  97. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +14 -2
  98. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +34 -8
  99. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +14 -2
  100. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +35 -8
  101. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +14 -2
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +35 -8
  103. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +14 -2
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +35 -8
  105. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +14 -2
  106. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +38 -11
  107. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +14 -2
  108. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +36 -9
  109. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +14 -2
  110. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +35 -8
  111. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +14 -2
  112. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
  113. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +14 -2
  114. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +348 -11
  115. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +199 -2
  116. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +35 -8
  117. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +14 -2
  118. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +35 -8
  119. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +14 -2
  120. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +34 -8
  121. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +14 -2
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +451 -12
  123. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +260 -2
  124. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +35 -8
  125. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +14 -2
  126. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +36 -9
  127. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +14 -2
  128. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +35 -8
  129. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +14 -2
  130. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -8
  131. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +14 -2
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +35 -8
  133. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +14 -2
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -8
  135. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +14 -2
  136. data/lib/google/cloud/compute/v1/regions/rest/client.rb +34 -8
  137. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +14 -2
  138. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +38 -10
  139. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +14 -2
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +38 -10
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +14 -2
  142. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  143. data/lib/google/cloud/compute/v1/routers/rest/client.rb +135 -11
  144. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +75 -2
  145. data/lib/google/cloud/compute/v1/routes/rest/client.rb +35 -8
  146. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +14 -2
  147. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +45 -13
  148. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +14 -2
  149. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +38 -10
  150. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +14 -2
  151. data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
  152. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +507 -0
  153. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +179 -0
  154. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
  155. data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
  156. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +35 -8
  157. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +14 -2
  158. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +38 -10
  159. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +14 -2
  160. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +39 -11
  161. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +14 -2
  162. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +39 -11
  163. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +14 -2
  164. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +35 -8
  165. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +14 -2
  166. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +38 -10
  167. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +14 -2
  168. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +38 -10
  169. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +14 -2
  170. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +142 -10
  171. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +76 -2
  172. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +142 -10
  173. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +76 -2
  174. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -8
  175. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +14 -2
  176. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +38 -10
  177. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +14 -2
  178. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +38 -10
  179. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +14 -2
  180. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +38 -10
  181. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +14 -2
  182. data/lib/google/cloud/compute/v1/version.rb +1 -1
  183. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +38 -10
  184. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +14 -2
  185. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +38 -10
  186. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +14 -2
  187. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +34 -8
  188. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +14 -2
  189. data/lib/google/cloud/compute/v1/zones/rest/client.rb +34 -8
  190. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +14 -2
  191. data/lib/google/cloud/compute/v1.rb +1 -0
  192. data/proto_docs/google/api/client.rb +14 -0
  193. data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
  194. data/proto_docs/google/protobuf/any.rb +144 -0
  195. metadata +11 -5
@@ -33,6 +33,9 @@ module Google
33
33
  # The Instances API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :instances_stub
38
41
 
@@ -159,6 +162,8 @@ module Google
159
162
 
160
163
  default_config.rpcs.set_scheduling.timeout = 600.0
161
164
 
165
+ default_config.rpcs.set_security_policy.timeout = 600.0
166
+
162
167
  default_config.rpcs.set_service_account.timeout = 600.0
163
168
 
164
169
  default_config.rpcs.set_shielded_instance_integrity_policy.timeout = 600.0
@@ -213,6 +218,15 @@ module Google
213
218
  @config
214
219
  end
215
220
 
221
+ ##
222
+ # The effective universe domain
223
+ #
224
+ # @return [String]
225
+ #
226
+ def universe_domain
227
+ @instances_stub.universe_domain
228
+ end
229
+
216
230
  ##
217
231
  # Create a new Instances REST client object.
218
232
  #
@@ -240,8 +254,9 @@ module Google
240
254
  credentials = @config.credentials
241
255
  # Use self-signed JWT if the endpoint is unchanged from default,
242
256
  # but only if the default endpoint does not have a region prefix.
243
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
244
- !@config.endpoint.split(".").first.include?("-")
257
+ enable_self_signed_jwt = @config.endpoint.nil? ||
258
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
259
+ !@config.endpoint.split(".").first.include?("-"))
245
260
  credentials ||= Credentials.default scope: @config.scope,
246
261
  enable_self_signed_jwt: enable_self_signed_jwt
247
262
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -255,9 +270,15 @@ module Google
255
270
  config.credentials = credentials
256
271
  config.quota_project = @quota_project_id
257
272
  config.endpoint = @config.endpoint
273
+ config.universe_domain = @config.universe_domain
258
274
  end
259
275
 
260
- @instances_stub = ::Google::Cloud::Compute::V1::Instances::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
276
+ @instances_stub = ::Google::Cloud::Compute::V1::Instances::Rest::ServiceStub.new(
277
+ endpoint: @config.endpoint,
278
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
279
+ universe_domain: @config.universe_domain,
280
+ credentials: credentials
281
+ )
261
282
  end
262
283
 
263
284
  ##
@@ -474,13 +495,13 @@ module Google
474
495
  # @param options [::Gapic::CallOptions, ::Hash]
475
496
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
476
497
  #
477
- # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
498
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, service_project_number: nil)
478
499
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
479
500
  # least one keyword argument is required. To specify no parameters, or to keep all
480
501
  # the default parameter values, pass an empty Hash as a request object (see above).
481
502
  #
482
503
  # @param filter [::String]
483
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
504
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
484
505
  # @param include_all_scopes [::Boolean]
485
506
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
486
507
  # @param max_results [::Integer]
@@ -493,6 +514,7 @@ module Google
493
514
  # Project ID for this request.
494
515
  # @param return_partial_success [::Boolean]
495
516
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
517
+ # @param service_project_number [::Integer]
496
518
  # @yield [result, operation] Access the result along with the TransportOperation object
497
519
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList>]
498
520
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1729,7 +1751,7 @@ module Google
1729
1751
  # the default parameter values, pass an empty Hash as a request object (see above).
1730
1752
  #
1731
1753
  # @param filter [::String]
1732
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
1754
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
1733
1755
  # @param max_results [::Integer]
1734
1756
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1735
1757
  # @param order_by [::String]
@@ -1820,7 +1842,7 @@ module Google
1820
1842
  # the default parameter values, pass an empty Hash as a request object (see above).
1821
1843
  #
1822
1844
  # @param filter [::String]
1823
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
1845
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
1824
1846
  # @param instance [::String]
1825
1847
  # Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.
1826
1848
  # @param max_results [::Integer]
@@ -3198,6 +3220,101 @@ module Google
3198
3220
  raise ::Google::Cloud::Error.from_error(e)
3199
3221
  end
3200
3222
 
3223
+ ##
3224
+ # Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview
3225
+ #
3226
+ # @overload set_security_policy(request, options = nil)
3227
+ # Pass arguments to `set_security_policy` via a request object, either of type
3228
+ # {::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest} or an equivalent Hash.
3229
+ #
3230
+ # @param request [::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest, ::Hash]
3231
+ # A request object representing the call parameters. Required. To specify no
3232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3233
+ # @param options [::Gapic::CallOptions, ::Hash]
3234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3235
+ #
3236
+ # @overload set_security_policy(instance: nil, instances_set_security_policy_request_resource: nil, project: nil, request_id: nil, zone: nil)
3237
+ # Pass arguments to `set_security_policy` via keyword arguments. Note that at
3238
+ # least one keyword argument is required. To specify no parameters, or to keep all
3239
+ # the default parameter values, pass an empty Hash as a request object (see above).
3240
+ #
3241
+ # @param instance [::String]
3242
+ # Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035.
3243
+ # @param instances_set_security_policy_request_resource [::Google::Cloud::Compute::V1::InstancesSetSecurityPolicyRequest, ::Hash]
3244
+ # The body resource for this request
3245
+ # @param project [::String]
3246
+ # Project ID for this request.
3247
+ # @param request_id [::String]
3248
+ # 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).
3249
+ # @param zone [::String]
3250
+ # Name of the zone scoping this request.
3251
+ # @yield [result, operation] Access the result along with the TransportOperation object
3252
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
3253
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3254
+ #
3255
+ # @return [::Gapic::GenericLRO::Operation]
3256
+ #
3257
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3258
+ #
3259
+ # @example Basic example
3260
+ # require "google/cloud/compute/v1"
3261
+ #
3262
+ # # Create a client object. The client can be reused for multiple calls.
3263
+ # client = Google::Cloud::Compute::V1::Instances::Rest::Client.new
3264
+ #
3265
+ # # Create a request. To set request fields, pass in keyword arguments.
3266
+ # request = Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest.new
3267
+ #
3268
+ # # Call the set_security_policy method.
3269
+ # result = client.set_security_policy request
3270
+ #
3271
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
3272
+ # p result
3273
+ #
3274
+ def set_security_policy request, options = nil
3275
+ raise ::ArgumentError, "request must be provided" if request.nil?
3276
+
3277
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest
3278
+
3279
+ # Converts hash and nil to an options object
3280
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3281
+
3282
+ # Customize the options with defaults
3283
+ call_metadata = @config.rpcs.set_security_policy.metadata.to_h
3284
+
3285
+ # Set x-goog-api-client and x-goog-user-project headers
3286
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3287
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3288
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
3289
+ transports_version_send: [:rest]
3290
+
3291
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3292
+
3293
+ options.apply_defaults timeout: @config.rpcs.set_security_policy.timeout,
3294
+ metadata: call_metadata,
3295
+ retry_policy: @config.rpcs.set_security_policy.retry_policy
3296
+
3297
+ options.apply_defaults timeout: @config.timeout,
3298
+ metadata: @config.metadata,
3299
+ retry_policy: @config.retry_policy
3300
+
3301
+ @instances_stub.set_security_policy request, options do |result, response|
3302
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
3303
+ operation: result,
3304
+ client: zone_operations,
3305
+ request_values: {
3306
+ "project" => request.project,
3307
+ "zone" => request.zone
3308
+ },
3309
+ options: options
3310
+ )
3311
+ yield result, response if block_given?
3312
+ return result
3313
+ end
3314
+ rescue ::Gapic::Rest::Error => e
3315
+ raise ::Google::Cloud::Error.from_error(e)
3316
+ end
3317
+
3201
3318
  ##
3202
3319
  # Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
3203
3320
  #
@@ -4553,9 +4670,9 @@ module Google
4553
4670
  # end
4554
4671
  #
4555
4672
  # @!attribute [rw] endpoint
4556
- # The hostname or hostname:port of the service endpoint.
4557
- # Defaults to `"compute.googleapis.com"`.
4558
- # @return [::String]
4673
+ # A custom service endpoint, as a hostname or hostname:port. The default is
4674
+ # nil, indicating to use the default endpoint in the current universe domain.
4675
+ # @return [::String,nil]
4559
4676
  # @!attribute [rw] credentials
4560
4677
  # Credentials to send with calls. You may provide any of the following types:
4561
4678
  # * (`String`) The path to a service account key file in JSON format
@@ -4592,13 +4709,20 @@ module Google
4592
4709
  # @!attribute [rw] quota_project
4593
4710
  # A separate project against which to charge quota.
4594
4711
  # @return [::String]
4712
+ # @!attribute [rw] universe_domain
4713
+ # The universe domain within which to make requests. This determines the
4714
+ # default endpoint URL. The default value of nil uses the environment
4715
+ # universe (usually the default "googleapis.com" universe).
4716
+ # @return [::String,nil]
4595
4717
  #
4596
4718
  class Configuration
4597
4719
  extend ::Gapic::Config
4598
4720
 
4721
+ # @private
4722
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4599
4723
  DEFAULT_ENDPOINT = "compute.googleapis.com"
4600
4724
 
4601
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
4725
+ config_attr :endpoint, nil, ::String, nil
4602
4726
  config_attr :credentials, nil do |value|
4603
4727
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
4604
4728
  allowed.any? { |klass| klass === value }
@@ -4610,6 +4734,7 @@ module Google
4610
4734
  config_attr :metadata, nil, ::Hash, nil
4611
4735
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4612
4736
  config_attr :quota_project, nil, ::String, nil
4737
+ config_attr :universe_domain, nil, ::String, nil
4613
4738
 
4614
4739
  # @private
4615
4740
  def initialize parent_config = nil
@@ -4809,6 +4934,11 @@ module Google
4809
4934
  #
4810
4935
  attr_reader :set_scheduling
4811
4936
  ##
4937
+ # RPC-specific configuration for `set_security_policy`
4938
+ # @return [::Gapic::Config::Method]
4939
+ #
4940
+ attr_reader :set_security_policy
4941
+ ##
4812
4942
  # RPC-specific configuration for `set_service_account`
4813
4943
  # @return [::Gapic::Config::Method]
4814
4944
  #
@@ -4945,6 +5075,8 @@ module Google
4945
5075
  @set_name = ::Gapic::Config::Method.new set_name_config
4946
5076
  set_scheduling_config = parent_rpcs.set_scheduling if parent_rpcs.respond_to? :set_scheduling
4947
5077
  @set_scheduling = ::Gapic::Config::Method.new set_scheduling_config
5078
+ set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
5079
+ @set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
4948
5080
  set_service_account_config = parent_rpcs.set_service_account if parent_rpcs.respond_to? :set_service_account
4949
5081
  @set_service_account = ::Gapic::Config::Method.new set_service_account_config
4950
5082
  set_shielded_instance_integrity_policy_config = parent_rpcs.set_shielded_instance_integrity_policy if parent_rpcs.respond_to? :set_shielded_instance_integrity_policy
@@ -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, credentials: credentials,
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: false,
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 add_access_config REST call
45
57
  #
@@ -1256,6 +1268,44 @@ module Google
1256
1268
  result
1257
1269
  end
1258
1270
 
1271
+ ##
1272
+ # Baseline implementation for the set_security_policy REST call
1273
+ #
1274
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest]
1275
+ # A request object representing the call parameters. Required.
1276
+ # @param options [::Gapic::CallOptions]
1277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1278
+ #
1279
+ # @yield [result, operation] Access the result along with the TransportOperation object
1280
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
1281
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1282
+ #
1283
+ # @return [::Google::Cloud::Compute::V1::Operation]
1284
+ # A result object deserialized from the server's reply
1285
+ def set_security_policy request_pb, options = nil
1286
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
1287
+
1288
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_security_policy_request request_pb
1289
+ query_string_params = if query_string_params.any?
1290
+ query_string_params.to_h { |p| p.split "=", 2 }
1291
+ else
1292
+ {}
1293
+ end
1294
+
1295
+ response = @client_stub.make_http_request(
1296
+ verb,
1297
+ uri: uri,
1298
+ body: body || "",
1299
+ params: query_string_params,
1300
+ options: options
1301
+ )
1302
+ operation = ::Gapic::Rest::TransportOperation.new response
1303
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
1304
+
1305
+ yield result, operation if block_given?
1306
+ result
1307
+ end
1308
+
1259
1309
  ##
1260
1310
  # Baseline implementation for the set_service_account REST call
1261
1311
  #
@@ -2533,6 +2583,30 @@ module Google
2533
2583
  transcoder.transcode request_pb
2534
2584
  end
2535
2585
 
2586
+ ##
2587
+ # @private
2588
+ #
2589
+ # GRPC transcoding helper method for the set_security_policy REST call
2590
+ #
2591
+ # @param request_pb [::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest]
2592
+ # A request object representing the call parameters. Required.
2593
+ # @return [Array(String, [String, nil], Hash{String => String})]
2594
+ # Uri, Body, Query string parameters
2595
+ def self.transcode_set_security_policy_request request_pb
2596
+ transcoder = Gapic::Rest::GrpcTranscoder.new
2597
+ .with_bindings(
2598
+ uri_method: :post,
2599
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy",
2600
+ body: "instances_set_security_policy_request_resource",
2601
+ matches: [
2602
+ ["project", %r{^[^/]+/?$}, false],
2603
+ ["zone", %r{^[^/]+/?$}, false],
2604
+ ["instance", %r{^[^/]+/?$}, false]
2605
+ ]
2606
+ )
2607
+ transcoder.transcode request_pb
2608
+ end
2609
+
2536
2610
  ##
2537
2611
  # @private
2538
2612
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The InterconnectAttachments API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :interconnect_attachments_stub
38
41
 
@@ -114,6 +117,15 @@ module Google
114
117
  @config
115
118
  end
116
119
 
120
+ ##
121
+ # The effective universe domain
122
+ #
123
+ # @return [String]
124
+ #
125
+ def universe_domain
126
+ @interconnect_attachments_stub.universe_domain
127
+ end
128
+
117
129
  ##
118
130
  # Create a new InterconnectAttachments REST client object.
119
131
  #
@@ -141,8 +153,9 @@ module Google
141
153
  credentials = @config.credentials
142
154
  # Use self-signed JWT if the endpoint is unchanged from default,
143
155
  # but only if the default endpoint does not have a region prefix.
144
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
- !@config.endpoint.split(".").first.include?("-")
156
+ enable_self_signed_jwt = @config.endpoint.nil? ||
157
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
158
+ !@config.endpoint.split(".").first.include?("-"))
146
159
  credentials ||= Credentials.default scope: @config.scope,
147
160
  enable_self_signed_jwt: enable_self_signed_jwt
148
161
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -156,9 +169,15 @@ module Google
156
169
  config.credentials = credentials
157
170
  config.quota_project = @quota_project_id
158
171
  config.endpoint = @config.endpoint
172
+ config.universe_domain = @config.universe_domain
159
173
  end
160
174
 
161
- @interconnect_attachments_stub = ::Google::Cloud::Compute::V1::InterconnectAttachments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
175
+ @interconnect_attachments_stub = ::Google::Cloud::Compute::V1::InterconnectAttachments::Rest::ServiceStub.new(
176
+ endpoint: @config.endpoint,
177
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
178
+ universe_domain: @config.universe_domain,
179
+ credentials: credentials
180
+ )
162
181
  end
163
182
 
164
183
  ##
@@ -183,13 +202,13 @@ module Google
183
202
  # @param options [::Gapic::CallOptions, ::Hash]
184
203
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
185
204
  #
186
- # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
205
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, service_project_number: nil)
187
206
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
188
207
  # least one keyword argument is required. To specify no parameters, or to keep all
189
208
  # the default parameter values, pass an empty Hash as a request object (see above).
190
209
  #
191
210
  # @param filter [::String]
192
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
211
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
193
212
  # @param include_all_scopes [::Boolean]
194
213
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
195
214
  # @param max_results [::Integer]
@@ -202,6 +221,7 @@ module Google
202
221
  # Project ID for this request.
203
222
  # @param return_partial_success [::Boolean]
204
223
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
224
+ # @param service_project_number [::Integer]
205
225
  # @yield [result, operation] Access the result along with the TransportOperation object
206
226
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InterconnectAttachmentsScopedList>]
207
227
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -550,7 +570,7 @@ module Google
550
570
  # the default parameter values, pass an empty Hash as a request object (see above).
551
571
  #
552
572
  # @param filter [::String]
553
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
573
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
554
574
  # @param max_results [::Integer]
555
575
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
556
576
  # @param order_by [::String]
@@ -842,9 +862,9 @@ module Google
842
862
  # end
843
863
  #
844
864
  # @!attribute [rw] endpoint
845
- # The hostname or hostname:port of the service endpoint.
846
- # Defaults to `"compute.googleapis.com"`.
847
- # @return [::String]
865
+ # A custom service endpoint, as a hostname or hostname:port. The default is
866
+ # nil, indicating to use the default endpoint in the current universe domain.
867
+ # @return [::String,nil]
848
868
  # @!attribute [rw] credentials
849
869
  # Credentials to send with calls. You may provide any of the following types:
850
870
  # * (`String`) The path to a service account key file in JSON format
@@ -881,13 +901,20 @@ module Google
881
901
  # @!attribute [rw] quota_project
882
902
  # A separate project against which to charge quota.
883
903
  # @return [::String]
904
+ # @!attribute [rw] universe_domain
905
+ # The universe domain within which to make requests. This determines the
906
+ # default endpoint URL. The default value of nil uses the environment
907
+ # universe (usually the default "googleapis.com" universe).
908
+ # @return [::String,nil]
884
909
  #
885
910
  class Configuration
886
911
  extend ::Gapic::Config
887
912
 
913
+ # @private
914
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
888
915
  DEFAULT_ENDPOINT = "compute.googleapis.com"
889
916
 
890
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
917
+ config_attr :endpoint, nil, ::String, nil
891
918
  config_attr :credentials, nil do |value|
892
919
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
893
920
  allowed.any? { |klass| klass === value }
@@ -899,6 +926,7 @@ module Google
899
926
  config_attr :metadata, nil, ::Hash, nil
900
927
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
901
928
  config_attr :quota_project, nil, ::String, nil
929
+ config_attr :universe_domain, nil, ::String, nil
902
930
 
903
931
  # @private
904
932
  def initialize parent_config = nil
@@ -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, credentials: credentials,
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: false,
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 aggregated_list REST call
45
57
  #