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 GlobalNetworkEndpointGroups API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :global_network_endpoint_groups_stub
38
41
 
@@ -111,6 +114,15 @@ module Google
111
114
  @config
112
115
  end
113
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @global_network_endpoint_groups_stub.universe_domain
124
+ end
125
+
114
126
  ##
115
127
  # Create a new GlobalNetworkEndpointGroups REST client object.
116
128
  #
@@ -138,8 +150,9 @@ module Google
138
150
  credentials = @config.credentials
139
151
  # Use self-signed JWT if the endpoint is unchanged from default,
140
152
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
- !@config.endpoint.split(".").first.include?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
143
156
  credentials ||= Credentials.default scope: @config.scope,
144
157
  enable_self_signed_jwt: enable_self_signed_jwt
145
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -153,9 +166,15 @@ module Google
153
166
  config.credentials = credentials
154
167
  config.quota_project = @quota_project_id
155
168
  config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
156
170
  end
157
171
 
158
- @global_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
172
+ @global_network_endpoint_groups_stub = ::Google::Cloud::Compute::V1::GlobalNetworkEndpointGroups::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
159
178
  end
160
179
 
161
180
  ##
@@ -630,7 +649,7 @@ module Google
630
649
  # the default parameter values, pass an empty Hash as a request object (see above).
631
650
  #
632
651
  # @param filter [::String]
633
- # 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`.
652
+ # 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.
634
653
  # @param max_results [::Integer]
635
654
  # 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`)
636
655
  # @param order_by [::String]
@@ -719,7 +738,7 @@ module Google
719
738
  # the default parameter values, pass an empty Hash as a request object (see above).
720
739
  #
721
740
  # @param filter [::String]
722
- # 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`.
741
+ # 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.
723
742
  # @param max_results [::Integer]
724
743
  # 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`)
725
744
  # @param network_endpoint_group [::String]
@@ -821,9 +840,9 @@ module Google
821
840
  # end
822
841
  #
823
842
  # @!attribute [rw] endpoint
824
- # The hostname or hostname:port of the service endpoint.
825
- # Defaults to `"compute.googleapis.com"`.
826
- # @return [::String]
843
+ # A custom service endpoint, as a hostname or hostname:port. The default is
844
+ # nil, indicating to use the default endpoint in the current universe domain.
845
+ # @return [::String,nil]
827
846
  # @!attribute [rw] credentials
828
847
  # Credentials to send with calls. You may provide any of the following types:
829
848
  # * (`String`) The path to a service account key file in JSON format
@@ -860,13 +879,20 @@ module Google
860
879
  # @!attribute [rw] quota_project
861
880
  # A separate project against which to charge quota.
862
881
  # @return [::String]
882
+ # @!attribute [rw] universe_domain
883
+ # The universe domain within which to make requests. This determines the
884
+ # default endpoint URL. The default value of nil uses the environment
885
+ # universe (usually the default "googleapis.com" universe).
886
+ # @return [::String,nil]
863
887
  #
864
888
  class Configuration
865
889
  extend ::Gapic::Config
866
890
 
891
+ # @private
892
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
867
893
  DEFAULT_ENDPOINT = "compute.googleapis.com"
868
894
 
869
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
895
+ config_attr :endpoint, nil, ::String, nil
870
896
  config_attr :credentials, nil do |value|
871
897
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
872
898
  allowed.any? { |klass| klass === value }
@@ -878,6 +904,7 @@ module Google
878
904
  config_attr :metadata, nil, ::Hash, nil
879
905
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
880
906
  config_attr :quota_project, nil, ::String, nil
907
+ config_attr :universe_domain, nil, ::String, nil
881
908
 
882
909
  # @private
883
910
  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 attach_network_endpoints REST call
45
57
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # The GlobalOperations API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :global_operations_stub
37
40
 
@@ -109,6 +112,15 @@ module Google
109
112
  @config
110
113
  end
111
114
 
115
+ ##
116
+ # The effective universe domain
117
+ #
118
+ # @return [String]
119
+ #
120
+ def universe_domain
121
+ @global_operations_stub.universe_domain
122
+ end
123
+
112
124
  ##
113
125
  # Create a new GlobalOperations REST client object.
114
126
  #
@@ -136,8 +148,9 @@ module Google
136
148
  credentials = @config.credentials
137
149
  # Use self-signed JWT if the endpoint is unchanged from default,
138
150
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
- !@config.endpoint.split(".").first.include?("-")
151
+ enable_self_signed_jwt = @config.endpoint.nil? ||
152
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
+ !@config.endpoint.split(".").first.include?("-"))
141
154
  credentials ||= Credentials.default scope: @config.scope,
142
155
  enable_self_signed_jwt: enable_self_signed_jwt
143
156
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -147,7 +160,12 @@ module Google
147
160
  @quota_project_id = @config.quota_project
148
161
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
162
 
150
- @global_operations_stub = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
163
+ @global_operations_stub = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::ServiceStub.new(
164
+ endpoint: @config.endpoint,
165
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
166
+ universe_domain: @config.universe_domain,
167
+ credentials: credentials
168
+ )
151
169
  end
152
170
 
153
171
  # Service calls
@@ -165,13 +183,13 @@ module Google
165
183
  # @param options [::Gapic::CallOptions, ::Hash]
166
184
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
167
185
  #
168
- # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
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, service_project_number: nil)
169
187
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
170
188
  # least one keyword argument is required. To specify no parameters, or to keep all
171
189
  # the default parameter values, pass an empty Hash as a request object (see above).
172
190
  #
173
191
  # @param filter [::String]
174
- # 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`.
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. 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.
175
193
  # @param include_all_scopes [::Boolean]
176
194
  # 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.
177
195
  # @param max_results [::Integer]
@@ -184,6 +202,7 @@ module Google
184
202
  # Project ID for this request.
185
203
  # @param return_partial_success [::Boolean]
186
204
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
205
+ # @param service_project_number [::Integer]
187
206
  # @yield [result, operation] Access the result along with the TransportOperation object
188
207
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::OperationsScopedList>]
189
208
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -422,7 +441,7 @@ module Google
422
441
  # the default parameter values, pass an empty Hash as a request object (see above).
423
442
  #
424
443
  # @param filter [::String]
425
- # 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`.
444
+ # 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.
426
445
  # @param max_results [::Integer]
427
446
  # 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`)
428
447
  # @param order_by [::String]
@@ -602,9 +621,9 @@ module Google
602
621
  # end
603
622
  #
604
623
  # @!attribute [rw] endpoint
605
- # The hostname or hostname:port of the service endpoint.
606
- # Defaults to `"compute.googleapis.com"`.
607
- # @return [::String]
624
+ # A custom service endpoint, as a hostname or hostname:port. The default is
625
+ # nil, indicating to use the default endpoint in the current universe domain.
626
+ # @return [::String,nil]
608
627
  # @!attribute [rw] credentials
609
628
  # Credentials to send with calls. You may provide any of the following types:
610
629
  # * (`String`) The path to a service account key file in JSON format
@@ -641,13 +660,20 @@ module Google
641
660
  # @!attribute [rw] quota_project
642
661
  # A separate project against which to charge quota.
643
662
  # @return [::String]
663
+ # @!attribute [rw] universe_domain
664
+ # The universe domain within which to make requests. This determines the
665
+ # default endpoint URL. The default value of nil uses the environment
666
+ # universe (usually the default "googleapis.com" universe).
667
+ # @return [::String,nil]
644
668
  #
645
669
  class Configuration
646
670
  extend ::Gapic::Config
647
671
 
672
+ # @private
673
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
648
674
  DEFAULT_ENDPOINT = "compute.googleapis.com"
649
675
 
650
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
676
+ config_attr :endpoint, nil, ::String, nil
651
677
  config_attr :credentials, nil do |value|
652
678
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
653
679
  allowed.any? { |klass| klass === value }
@@ -659,6 +685,7 @@ module Google
659
685
  config_attr :metadata, nil, ::Hash, nil
660
686
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
661
687
  config_attr :quota_project, nil, ::String, nil
688
+ config_attr :universe_domain, nil, ::String, nil
662
689
 
663
690
  # @private
664
691
  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
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # The GlobalOrganizationOperations API.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :global_organization_operations_stub
37
40
 
@@ -102,6 +105,15 @@ module Google
102
105
  @config
103
106
  end
104
107
 
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @global_organization_operations_stub.universe_domain
115
+ end
116
+
105
117
  ##
106
118
  # Create a new GlobalOrganizationOperations REST client object.
107
119
  #
@@ -129,8 +141,9 @@ module Google
129
141
  credentials = @config.credentials
130
142
  # Use self-signed JWT if the endpoint is unchanged from default,
131
143
  # but only if the default endpoint does not have a region prefix.
132
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
133
- !@config.endpoint.split(".").first.include?("-")
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
134
147
  credentials ||= Credentials.default scope: @config.scope,
135
148
  enable_self_signed_jwt: enable_self_signed_jwt
136
149
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -140,7 +153,12 @@ module Google
140
153
  @quota_project_id = @config.quota_project
141
154
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
142
155
 
143
- @global_organization_operations_stub = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
156
+ @global_organization_operations_stub = ::Google::Cloud::Compute::V1::GlobalOrganizationOperations::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials
161
+ )
144
162
  end
145
163
 
146
164
  # Service calls
@@ -324,7 +342,7 @@ module Google
324
342
  # the default parameter values, pass an empty Hash as a request object (see above).
325
343
  #
326
344
  # @param filter [::String]
327
- # 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`.
345
+ # 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.
328
346
  # @param max_results [::Integer]
329
347
  # 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`)
330
348
  # @param order_by [::String]
@@ -424,9 +442,9 @@ module Google
424
442
  # end
425
443
  #
426
444
  # @!attribute [rw] endpoint
427
- # The hostname or hostname:port of the service endpoint.
428
- # Defaults to `"compute.googleapis.com"`.
429
- # @return [::String]
445
+ # A custom service endpoint, as a hostname or hostname:port. The default is
446
+ # nil, indicating to use the default endpoint in the current universe domain.
447
+ # @return [::String,nil]
430
448
  # @!attribute [rw] credentials
431
449
  # Credentials to send with calls. You may provide any of the following types:
432
450
  # * (`String`) The path to a service account key file in JSON format
@@ -463,13 +481,20 @@ module Google
463
481
  # @!attribute [rw] quota_project
464
482
  # A separate project against which to charge quota.
465
483
  # @return [::String]
484
+ # @!attribute [rw] universe_domain
485
+ # The universe domain within which to make requests. This determines the
486
+ # default endpoint URL. The default value of nil uses the environment
487
+ # universe (usually the default "googleapis.com" universe).
488
+ # @return [::String,nil]
466
489
  #
467
490
  class Configuration
468
491
  extend ::Gapic::Config
469
492
 
493
+ # @private
494
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
470
495
  DEFAULT_ENDPOINT = "compute.googleapis.com"
471
496
 
472
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
497
+ config_attr :endpoint, nil, ::String, nil
473
498
  config_attr :credentials, nil do |value|
474
499
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
475
500
  allowed.any? { |klass| klass === value }
@@ -481,6 +506,7 @@ module Google
481
506
  config_attr :metadata, nil, ::Hash, nil
482
507
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
483
508
  config_attr :quota_project, nil, ::String, nil
509
+ config_attr :universe_domain, nil, ::String, nil
484
510
 
485
511
  # @private
486
512
  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
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The GlobalPublicDelegatedPrefixes API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :global_public_delegated_prefixes_stub
38
41
 
@@ -107,6 +110,15 @@ module Google
107
110
  @config
108
111
  end
109
112
 
113
+ ##
114
+ # The effective universe domain
115
+ #
116
+ # @return [String]
117
+ #
118
+ def universe_domain
119
+ @global_public_delegated_prefixes_stub.universe_domain
120
+ end
121
+
110
122
  ##
111
123
  # Create a new GlobalPublicDelegatedPrefixes REST client object.
112
124
  #
@@ -134,8 +146,9 @@ module Google
134
146
  credentials = @config.credentials
135
147
  # Use self-signed JWT if the endpoint is unchanged from default,
136
148
  # but only if the default endpoint does not have a region prefix.
137
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
- !@config.endpoint.split(".").first.include?("-")
149
+ enable_self_signed_jwt = @config.endpoint.nil? ||
150
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
+ !@config.endpoint.split(".").first.include?("-"))
139
152
  credentials ||= Credentials.default scope: @config.scope,
140
153
  enable_self_signed_jwt: enable_self_signed_jwt
141
154
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -149,9 +162,15 @@ module Google
149
162
  config.credentials = credentials
150
163
  config.quota_project = @quota_project_id
151
164
  config.endpoint = @config.endpoint
165
+ config.universe_domain = @config.universe_domain
152
166
  end
153
167
 
154
- @global_public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
168
+ @global_public_delegated_prefixes_stub = ::Google::Cloud::Compute::V1::GlobalPublicDelegatedPrefixes::Rest::ServiceStub.new(
169
+ endpoint: @config.endpoint,
170
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
171
+ universe_domain: @config.universe_domain,
172
+ credentials: credentials
173
+ )
155
174
  end
156
175
 
157
176
  ##
@@ -442,7 +461,7 @@ module Google
442
461
  # the default parameter values, pass an empty Hash as a request object (see above).
443
462
  #
444
463
  # @param filter [::String]
445
- # 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`.
464
+ # 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.
446
465
  # @param max_results [::Integer]
447
466
  # 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`)
448
467
  # @param order_by [::String]
@@ -634,9 +653,9 @@ module Google
634
653
  # end
635
654
  #
636
655
  # @!attribute [rw] endpoint
637
- # The hostname or hostname:port of the service endpoint.
638
- # Defaults to `"compute.googleapis.com"`.
639
- # @return [::String]
656
+ # A custom service endpoint, as a hostname or hostname:port. The default is
657
+ # nil, indicating to use the default endpoint in the current universe domain.
658
+ # @return [::String,nil]
640
659
  # @!attribute [rw] credentials
641
660
  # Credentials to send with calls. You may provide any of the following types:
642
661
  # * (`String`) The path to a service account key file in JSON format
@@ -673,13 +692,20 @@ module Google
673
692
  # @!attribute [rw] quota_project
674
693
  # A separate project against which to charge quota.
675
694
  # @return [::String]
695
+ # @!attribute [rw] universe_domain
696
+ # The universe domain within which to make requests. This determines the
697
+ # default endpoint URL. The default value of nil uses the environment
698
+ # universe (usually the default "googleapis.com" universe).
699
+ # @return [::String,nil]
676
700
  #
677
701
  class Configuration
678
702
  extend ::Gapic::Config
679
703
 
704
+ # @private
705
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
680
706
  DEFAULT_ENDPOINT = "compute.googleapis.com"
681
707
 
682
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
708
+ config_attr :endpoint, nil, ::String, nil
683
709
  config_attr :credentials, nil do |value|
684
710
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
685
711
  allowed.any? { |klass| klass === value }
@@ -691,6 +717,7 @@ module Google
691
717
  config_attr :metadata, nil, ::Hash, nil
692
718
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
693
719
  config_attr :quota_project, nil, ::String, nil
720
+ config_attr :universe_domain, nil, ::String, nil
694
721
 
695
722
  # @private
696
723
  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
  #