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 Routers API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :routers_stub
38
41
 
@@ -77,6 +80,11 @@ module Google
77
80
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
81
  }
79
82
 
83
+ default_config.rpcs.get_nat_ip_info.timeout = 600.0
84
+ default_config.rpcs.get_nat_ip_info.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
80
88
  default_config.rpcs.get_nat_mapping_info.timeout = 600.0
81
89
  default_config.rpcs.get_nat_mapping_info.retry_policy = {
82
90
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
@@ -126,6 +134,15 @@ module Google
126
134
  @config
127
135
  end
128
136
 
137
+ ##
138
+ # The effective universe domain
139
+ #
140
+ # @return [String]
141
+ #
142
+ def universe_domain
143
+ @routers_stub.universe_domain
144
+ end
145
+
129
146
  ##
130
147
  # Create a new Routers REST client object.
131
148
  #
@@ -153,8 +170,9 @@ module Google
153
170
  credentials = @config.credentials
154
171
  # Use self-signed JWT if the endpoint is unchanged from default,
155
172
  # but only if the default endpoint does not have a region prefix.
156
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
157
- !@config.endpoint.split(".").first.include?("-")
173
+ enable_self_signed_jwt = @config.endpoint.nil? ||
174
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
175
+ !@config.endpoint.split(".").first.include?("-"))
158
176
  credentials ||= Credentials.default scope: @config.scope,
159
177
  enable_self_signed_jwt: enable_self_signed_jwt
160
178
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -168,9 +186,15 @@ module Google
168
186
  config.credentials = credentials
169
187
  config.quota_project = @quota_project_id
170
188
  config.endpoint = @config.endpoint
189
+ config.universe_domain = @config.universe_domain
171
190
  end
172
191
 
173
- @routers_stub = ::Google::Cloud::Compute::V1::Routers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
192
+ @routers_stub = ::Google::Cloud::Compute::V1::Routers::Rest::ServiceStub.new(
193
+ endpoint: @config.endpoint,
194
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
195
+ universe_domain: @config.universe_domain,
196
+ credentials: credentials
197
+ )
174
198
  end
175
199
 
176
200
  ##
@@ -195,13 +219,13 @@ module Google
195
219
  # @param options [::Gapic::CallOptions, ::Hash]
196
220
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
221
  #
198
- # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
222
+ # @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)
199
223
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
200
224
  # least one keyword argument is required. To specify no parameters, or to keep all
201
225
  # the default parameter values, pass an empty Hash as a request object (see above).
202
226
  #
203
227
  # @param filter [::String]
204
- # 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`.
228
+ # 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.
205
229
  # @param include_all_scopes [::Boolean]
206
230
  # 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.
207
231
  # @param max_results [::Integer]
@@ -214,6 +238,7 @@ module Google
214
238
  # Project ID for this request.
215
239
  # @param return_partial_success [::Boolean]
216
240
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
241
+ # @param service_project_number [::Integer]
217
242
  # @yield [result, operation] Access the result along with the TransportOperation object
218
243
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::RoutersScopedList>]
219
244
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -448,6 +473,90 @@ module Google
448
473
  raise ::Google::Cloud::Error.from_error(e)
449
474
  end
450
475
 
476
+ ##
477
+ # Retrieves runtime NAT IP information.
478
+ #
479
+ # @overload get_nat_ip_info(request, options = nil)
480
+ # Pass arguments to `get_nat_ip_info` via a request object, either of type
481
+ # {::Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest} or an equivalent Hash.
482
+ #
483
+ # @param request [::Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest, ::Hash]
484
+ # A request object representing the call parameters. Required. To specify no
485
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
486
+ # @param options [::Gapic::CallOptions, ::Hash]
487
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
488
+ #
489
+ # @overload get_nat_ip_info(nat_name: nil, project: nil, region: nil, router: nil)
490
+ # Pass arguments to `get_nat_ip_info` via keyword arguments. Note that at
491
+ # least one keyword argument is required. To specify no parameters, or to keep all
492
+ # the default parameter values, pass an empty Hash as a request object (see above).
493
+ #
494
+ # @param nat_name [::String]
495
+ # Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035.
496
+ # @param project [::String]
497
+ # Project ID for this request.
498
+ # @param region [::String]
499
+ # Name of the region for this request.
500
+ # @param router [::String]
501
+ # Name of the Router resource to query for Nat IP information. The name should conform to RFC1035.
502
+ # @yield [result, operation] Access the result along with the TransportOperation object
503
+ # @yieldparam result [::Google::Cloud::Compute::V1::NatIpInfoResponse]
504
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
505
+ #
506
+ # @return [::Google::Cloud::Compute::V1::NatIpInfoResponse]
507
+ #
508
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
509
+ #
510
+ # @example Basic example
511
+ # require "google/cloud/compute/v1"
512
+ #
513
+ # # Create a client object. The client can be reused for multiple calls.
514
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
515
+ #
516
+ # # Create a request. To set request fields, pass in keyword arguments.
517
+ # request = Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest.new
518
+ #
519
+ # # Call the get_nat_ip_info method.
520
+ # result = client.get_nat_ip_info request
521
+ #
522
+ # # The returned object is of type Google::Cloud::Compute::V1::NatIpInfoResponse.
523
+ # p result
524
+ #
525
+ def get_nat_ip_info request, options = nil
526
+ raise ::ArgumentError, "request must be provided" if request.nil?
527
+
528
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest
529
+
530
+ # Converts hash and nil to an options object
531
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
532
+
533
+ # Customize the options with defaults
534
+ call_metadata = @config.rpcs.get_nat_ip_info.metadata.to_h
535
+
536
+ # Set x-goog-api-client and x-goog-user-project headers
537
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
538
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
539
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
540
+ transports_version_send: [:rest]
541
+
542
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
543
+
544
+ options.apply_defaults timeout: @config.rpcs.get_nat_ip_info.timeout,
545
+ metadata: call_metadata,
546
+ retry_policy: @config.rpcs.get_nat_ip_info.retry_policy
547
+
548
+ options.apply_defaults timeout: @config.timeout,
549
+ metadata: @config.metadata,
550
+ retry_policy: @config.retry_policy
551
+
552
+ @routers_stub.get_nat_ip_info request, options do |result, operation|
553
+ yield result, operation if block_given?
554
+ return result
555
+ end
556
+ rescue ::Gapic::Rest::Error => e
557
+ raise ::Google::Cloud::Error.from_error(e)
558
+ end
559
+
451
560
  ##
452
561
  # Retrieves runtime Nat mapping information of VM endpoints.
453
562
  #
@@ -467,7 +576,7 @@ module Google
467
576
  # the default parameter values, pass an empty Hash as a request object (see above).
468
577
  #
469
578
  # @param filter [::String]
470
- # 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`.
579
+ # 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.
471
580
  # @param max_results [::Integer]
472
581
  # 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`)
473
582
  # @param nat_name [::String]
@@ -737,7 +846,7 @@ module Google
737
846
  # the default parameter values, pass an empty Hash as a request object (see above).
738
847
  #
739
848
  # @param filter [::String]
740
- # 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`.
849
+ # 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.
741
850
  # @param max_results [::Integer]
742
851
  # 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`)
743
852
  # @param order_by [::String]
@@ -1113,9 +1222,9 @@ module Google
1113
1222
  # end
1114
1223
  #
1115
1224
  # @!attribute [rw] endpoint
1116
- # The hostname or hostname:port of the service endpoint.
1117
- # Defaults to `"compute.googleapis.com"`.
1118
- # @return [::String]
1225
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1226
+ # nil, indicating to use the default endpoint in the current universe domain.
1227
+ # @return [::String,nil]
1119
1228
  # @!attribute [rw] credentials
1120
1229
  # Credentials to send with calls. You may provide any of the following types:
1121
1230
  # * (`String`) The path to a service account key file in JSON format
@@ -1152,13 +1261,20 @@ module Google
1152
1261
  # @!attribute [rw] quota_project
1153
1262
  # A separate project against which to charge quota.
1154
1263
  # @return [::String]
1264
+ # @!attribute [rw] universe_domain
1265
+ # The universe domain within which to make requests. This determines the
1266
+ # default endpoint URL. The default value of nil uses the environment
1267
+ # universe (usually the default "googleapis.com" universe).
1268
+ # @return [::String,nil]
1155
1269
  #
1156
1270
  class Configuration
1157
1271
  extend ::Gapic::Config
1158
1272
 
1273
+ # @private
1274
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1159
1275
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1160
1276
 
1161
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1277
+ config_attr :endpoint, nil, ::String, nil
1162
1278
  config_attr :credentials, nil do |value|
1163
1279
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1164
1280
  allowed.any? { |klass| klass === value }
@@ -1170,6 +1286,7 @@ module Google
1170
1286
  config_attr :metadata, nil, ::Hash, nil
1171
1287
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1172
1288
  config_attr :quota_project, nil, ::String, nil
1289
+ config_attr :universe_domain, nil, ::String, nil
1173
1290
 
1174
1291
  # @private
1175
1292
  def initialize parent_config = nil
@@ -1224,6 +1341,11 @@ module Google
1224
1341
  #
1225
1342
  attr_reader :get
1226
1343
  ##
1344
+ # RPC-specific configuration for `get_nat_ip_info`
1345
+ # @return [::Gapic::Config::Method]
1346
+ #
1347
+ attr_reader :get_nat_ip_info
1348
+ ##
1227
1349
  # RPC-specific configuration for `get_nat_mapping_info`
1228
1350
  # @return [::Gapic::Config::Method]
1229
1351
  #
@@ -1267,6 +1389,8 @@ module Google
1267
1389
  @delete = ::Gapic::Config::Method.new delete_config
1268
1390
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1269
1391
  @get = ::Gapic::Config::Method.new get_config
1392
+ get_nat_ip_info_config = parent_rpcs.get_nat_ip_info if parent_rpcs.respond_to? :get_nat_ip_info
1393
+ @get_nat_ip_info = ::Gapic::Config::Method.new get_nat_ip_info_config
1270
1394
  get_nat_mapping_info_config = parent_rpcs.get_nat_mapping_info if parent_rpcs.respond_to? :get_nat_mapping_info
1271
1395
  @get_nat_mapping_info = ::Gapic::Config::Method.new get_nat_mapping_info_config
1272
1396
  get_router_status_config = parent_rpcs.get_router_status if parent_rpcs.respond_to? :get_router_status
@@ -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
  #
@@ -154,6 +166,44 @@ module Google
154
166
  result
155
167
  end
156
168
 
169
+ ##
170
+ # Baseline implementation for the get_nat_ip_info REST call
171
+ #
172
+ # @param request_pb [::Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest]
173
+ # A request object representing the call parameters. Required.
174
+ # @param options [::Gapic::CallOptions]
175
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
176
+ #
177
+ # @yield [result, operation] Access the result along with the TransportOperation object
178
+ # @yieldparam result [::Google::Cloud::Compute::V1::NatIpInfoResponse]
179
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
180
+ #
181
+ # @return [::Google::Cloud::Compute::V1::NatIpInfoResponse]
182
+ # A result object deserialized from the server's reply
183
+ def get_nat_ip_info request_pb, options = nil
184
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
185
+
186
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_nat_ip_info_request request_pb
187
+ query_string_params = if query_string_params.any?
188
+ query_string_params.to_h { |p| p.split "=", 2 }
189
+ else
190
+ {}
191
+ end
192
+
193
+ response = @client_stub.make_http_request(
194
+ verb,
195
+ uri: uri,
196
+ body: body || "",
197
+ params: query_string_params,
198
+ options: options
199
+ )
200
+ operation = ::Gapic::Rest::TransportOperation.new response
201
+ result = ::Google::Cloud::Compute::V1::NatIpInfoResponse.decode_json response.body, ignore_unknown_fields: true
202
+
203
+ yield result, operation if block_given?
204
+ result
205
+ end
206
+
157
207
  ##
158
208
  # Baseline implementation for the get_nat_mapping_info REST call
159
209
  #
@@ -487,6 +537,29 @@ module Google
487
537
  transcoder.transcode request_pb
488
538
  end
489
539
 
540
+ ##
541
+ # @private
542
+ #
543
+ # GRPC transcoding helper method for the get_nat_ip_info REST call
544
+ #
545
+ # @param request_pb [::Google::Cloud::Compute::V1::GetNatIpInfoRouterRequest]
546
+ # A request object representing the call parameters. Required.
547
+ # @return [Array(String, [String, nil], Hash{String => String})]
548
+ # Uri, Body, Query string parameters
549
+ def self.transcode_get_nat_ip_info_request request_pb
550
+ transcoder = Gapic::Rest::GrpcTranscoder.new
551
+ .with_bindings(
552
+ uri_method: :get,
553
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatIpInfo",
554
+ matches: [
555
+ ["project", %r{^[^/]+/?$}, false],
556
+ ["region", %r{^[^/]+/?$}, false],
557
+ ["router", %r{^[^/]+/?$}, false]
558
+ ]
559
+ )
560
+ transcoder.transcode request_pb
561
+ end
562
+
490
563
  ##
491
564
  # @private
492
565
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The Routes API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :routes_stub
38
41
 
@@ -105,6 +108,15 @@ module Google
105
108
  @config
106
109
  end
107
110
 
111
+ ##
112
+ # The effective universe domain
113
+ #
114
+ # @return [String]
115
+ #
116
+ def universe_domain
117
+ @routes_stub.universe_domain
118
+ end
119
+
108
120
  ##
109
121
  # Create a new Routes REST client object.
110
122
  #
@@ -132,8 +144,9 @@ module Google
132
144
  credentials = @config.credentials
133
145
  # Use self-signed JWT if the endpoint is unchanged from default,
134
146
  # but only if the default endpoint does not have a region prefix.
135
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
- !@config.endpoint.split(".").first.include?("-")
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
137
150
  credentials ||= Credentials.default scope: @config.scope,
138
151
  enable_self_signed_jwt: enable_self_signed_jwt
139
152
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -147,9 +160,15 @@ module Google
147
160
  config.credentials = credentials
148
161
  config.quota_project = @quota_project_id
149
162
  config.endpoint = @config.endpoint
163
+ config.universe_domain = @config.universe_domain
150
164
  end
151
165
 
152
- @routes_stub = ::Google::Cloud::Compute::V1::Routes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
166
+ @routes_stub = ::Google::Cloud::Compute::V1::Routes::Rest::ServiceStub.new(
167
+ endpoint: @config.endpoint,
168
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
169
+ universe_domain: @config.universe_domain,
170
+ credentials: credentials
171
+ )
153
172
  end
154
173
 
155
174
  ##
@@ -440,7 +459,7 @@ module Google
440
459
  # the default parameter values, pass an empty Hash as a request object (see above).
441
460
  #
442
461
  # @param filter [::String]
443
- # 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`.
462
+ # 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.
444
463
  # @param max_results [::Integer]
445
464
  # 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`)
446
465
  # @param order_by [::String]
@@ -540,9 +559,9 @@ module Google
540
559
  # end
541
560
  #
542
561
  # @!attribute [rw] endpoint
543
- # The hostname or hostname:port of the service endpoint.
544
- # Defaults to `"compute.googleapis.com"`.
545
- # @return [::String]
562
+ # A custom service endpoint, as a hostname or hostname:port. The default is
563
+ # nil, indicating to use the default endpoint in the current universe domain.
564
+ # @return [::String,nil]
546
565
  # @!attribute [rw] credentials
547
566
  # Credentials to send with calls. You may provide any of the following types:
548
567
  # * (`String`) The path to a service account key file in JSON format
@@ -579,13 +598,20 @@ module Google
579
598
  # @!attribute [rw] quota_project
580
599
  # A separate project against which to charge quota.
581
600
  # @return [::String]
601
+ # @!attribute [rw] universe_domain
602
+ # The universe domain within which to make requests. This determines the
603
+ # default endpoint URL. The default value of nil uses the environment
604
+ # universe (usually the default "googleapis.com" universe).
605
+ # @return [::String,nil]
582
606
  #
583
607
  class Configuration
584
608
  extend ::Gapic::Config
585
609
 
610
+ # @private
611
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
586
612
  DEFAULT_ENDPOINT = "compute.googleapis.com"
587
613
 
588
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
614
+ config_attr :endpoint, nil, ::String, nil
589
615
  config_attr :credentials, nil do |value|
590
616
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
591
617
  allowed.any? { |klass| klass === value }
@@ -597,6 +623,7 @@ module Google
597
623
  config_attr :metadata, nil, ::Hash, nil
598
624
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
599
625
  config_attr :quota_project, nil, ::String, nil
626
+ config_attr :universe_domain, nil, ::String, nil
600
627
 
601
628
  # @private
602
629
  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 delete REST call
45
57
  #