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 PublicAdvertisedPrefixes API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :public_advertised_prefixes_stub
38
41
 
@@ -65,6 +68,8 @@ module Google
65
68
  end
66
69
  default_config = Client::Configuration.new parent_config
67
70
 
71
+ default_config.rpcs.announce.timeout = 600.0
72
+
68
73
  default_config.rpcs.delete.timeout = 600.0
69
74
 
70
75
  default_config.rpcs.get.timeout = 600.0
@@ -81,6 +86,8 @@ module Google
81
86
 
82
87
  default_config.rpcs.patch.timeout = 600.0
83
88
 
89
+ default_config.rpcs.withdraw.timeout = 600.0
90
+
84
91
  default_config
85
92
  end
86
93
  yield @configure if block_given?
@@ -107,6 +114,15 @@ module Google
107
114
  @config
108
115
  end
109
116
 
117
+ ##
118
+ # The effective universe domain
119
+ #
120
+ # @return [String]
121
+ #
122
+ def universe_domain
123
+ @public_advertised_prefixes_stub.universe_domain
124
+ end
125
+
110
126
  ##
111
127
  # Create a new PublicAdvertisedPrefixes REST client object.
112
128
  #
@@ -134,8 +150,9 @@ module Google
134
150
  credentials = @config.credentials
135
151
  # Use self-signed JWT if the endpoint is unchanged from default,
136
152
  # 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?("-")
153
+ enable_self_signed_jwt = @config.endpoint.nil? ||
154
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
155
+ !@config.endpoint.split(".").first.include?("-"))
139
156
  credentials ||= Credentials.default scope: @config.scope,
140
157
  enable_self_signed_jwt: enable_self_signed_jwt
141
158
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -149,9 +166,15 @@ module Google
149
166
  config.credentials = credentials
150
167
  config.quota_project = @quota_project_id
151
168
  config.endpoint = @config.endpoint
169
+ config.universe_domain = @config.universe_domain
152
170
  end
153
171
 
154
- @public_advertised_prefixes_stub = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
172
+ @public_advertised_prefixes_stub = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::ServiceStub.new(
173
+ endpoint: @config.endpoint,
174
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
175
+ universe_domain: @config.universe_domain,
176
+ credentials: credentials
177
+ )
155
178
  end
156
179
 
157
180
  ##
@@ -163,6 +186,96 @@ module Google
163
186
 
164
187
  # Service calls
165
188
 
189
+ ##
190
+ # Announces the specified PublicAdvertisedPrefix
191
+ #
192
+ # @overload announce(request, options = nil)
193
+ # Pass arguments to `announce` via a request object, either of type
194
+ # {::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest} or an equivalent Hash.
195
+ #
196
+ # @param request [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest, ::Hash]
197
+ # A request object representing the call parameters. Required. To specify no
198
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
199
+ # @param options [::Gapic::CallOptions, ::Hash]
200
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
201
+ #
202
+ # @overload announce(project: nil, public_advertised_prefix: nil, request_id: nil)
203
+ # Pass arguments to `announce` via keyword arguments. Note that at
204
+ # least one keyword argument is required. To specify no parameters, or to keep all
205
+ # the default parameter values, pass an empty Hash as a request object (see above).
206
+ #
207
+ # @param project [::String]
208
+ # Project ID for this request.
209
+ # @param public_advertised_prefix [::String]
210
+ # The name of the public advertised prefix. It should comply with RFC1035.
211
+ # @param request_id [::String]
212
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
213
+ # @yield [result, operation] Access the result along with the TransportOperation object
214
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
215
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
216
+ #
217
+ # @return [::Gapic::GenericLRO::Operation]
218
+ #
219
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
220
+ #
221
+ # @example Basic example
222
+ # require "google/cloud/compute/v1"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest.new
229
+ #
230
+ # # Call the announce method.
231
+ # result = client.announce request
232
+ #
233
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
234
+ # p result
235
+ #
236
+ def announce request, options = nil
237
+ raise ::ArgumentError, "request must be provided" if request.nil?
238
+
239
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest
240
+
241
+ # Converts hash and nil to an options object
242
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
243
+
244
+ # Customize the options with defaults
245
+ call_metadata = @config.rpcs.announce.metadata.to_h
246
+
247
+ # Set x-goog-api-client and x-goog-user-project headers
248
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
249
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
250
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
251
+ transports_version_send: [:rest]
252
+
253
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
254
+
255
+ options.apply_defaults timeout: @config.rpcs.announce.timeout,
256
+ metadata: call_metadata,
257
+ retry_policy: @config.rpcs.announce.retry_policy
258
+
259
+ options.apply_defaults timeout: @config.timeout,
260
+ metadata: @config.metadata,
261
+ retry_policy: @config.retry_policy
262
+
263
+ @public_advertised_prefixes_stub.announce request, options do |result, response|
264
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
265
+ operation: result,
266
+ client: global_operations,
267
+ request_values: {
268
+ "project" => request.project
269
+ },
270
+ options: options
271
+ )
272
+ yield result, response if block_given?
273
+ return result
274
+ end
275
+ rescue ::Gapic::Rest::Error => e
276
+ raise ::Google::Cloud::Error.from_error(e)
277
+ end
278
+
166
279
  ##
167
280
  # Deletes the specified PublicAdvertisedPrefix
168
281
  #
@@ -442,7 +555,7 @@ module Google
442
555
  # the default parameter values, pass an empty Hash as a request object (see above).
443
556
  #
444
557
  # @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`.
558
+ # 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
559
  # @param max_results [::Integer]
447
560
  # 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
561
  # @param order_by [::String]
@@ -604,6 +717,96 @@ module Google
604
717
  raise ::Google::Cloud::Error.from_error(e)
605
718
  end
606
719
 
720
+ ##
721
+ # Withdraws the specified PublicAdvertisedPrefix
722
+ #
723
+ # @overload withdraw(request, options = nil)
724
+ # Pass arguments to `withdraw` via a request object, either of type
725
+ # {::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest} or an equivalent Hash.
726
+ #
727
+ # @param request [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest, ::Hash]
728
+ # A request object representing the call parameters. Required. To specify no
729
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
730
+ # @param options [::Gapic::CallOptions, ::Hash]
731
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
732
+ #
733
+ # @overload withdraw(project: nil, public_advertised_prefix: nil, request_id: nil)
734
+ # Pass arguments to `withdraw` via keyword arguments. Note that at
735
+ # least one keyword argument is required. To specify no parameters, or to keep all
736
+ # the default parameter values, pass an empty Hash as a request object (see above).
737
+ #
738
+ # @param project [::String]
739
+ # Project ID for this request.
740
+ # @param public_advertised_prefix [::String]
741
+ # The name of the public advertised prefix. It should comply with RFC1035.
742
+ # @param request_id [::String]
743
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
744
+ # @yield [result, operation] Access the result along with the TransportOperation object
745
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
746
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
747
+ #
748
+ # @return [::Gapic::GenericLRO::Operation]
749
+ #
750
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
751
+ #
752
+ # @example Basic example
753
+ # require "google/cloud/compute/v1"
754
+ #
755
+ # # Create a client object. The client can be reused for multiple calls.
756
+ # client = Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new
757
+ #
758
+ # # Create a request. To set request fields, pass in keyword arguments.
759
+ # request = Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest.new
760
+ #
761
+ # # Call the withdraw method.
762
+ # result = client.withdraw request
763
+ #
764
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
765
+ # p result
766
+ #
767
+ def withdraw request, options = nil
768
+ raise ::ArgumentError, "request must be provided" if request.nil?
769
+
770
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest
771
+
772
+ # Converts hash and nil to an options object
773
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
774
+
775
+ # Customize the options with defaults
776
+ call_metadata = @config.rpcs.withdraw.metadata.to_h
777
+
778
+ # Set x-goog-api-client and x-goog-user-project headers
779
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
780
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
781
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
782
+ transports_version_send: [:rest]
783
+
784
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ options.apply_defaults timeout: @config.rpcs.withdraw.timeout,
787
+ metadata: call_metadata,
788
+ retry_policy: @config.rpcs.withdraw.retry_policy
789
+
790
+ options.apply_defaults timeout: @config.timeout,
791
+ metadata: @config.metadata,
792
+ retry_policy: @config.retry_policy
793
+
794
+ @public_advertised_prefixes_stub.withdraw request, options do |result, response|
795
+ result = ::Google::Cloud::Compute::V1::GlobalOperations::Rest::NonstandardLro.create_operation(
796
+ operation: result,
797
+ client: global_operations,
798
+ request_values: {
799
+ "project" => request.project
800
+ },
801
+ options: options
802
+ )
803
+ yield result, response if block_given?
804
+ return result
805
+ end
806
+ rescue ::Gapic::Rest::Error => e
807
+ raise ::Google::Cloud::Error.from_error(e)
808
+ end
809
+
607
810
  ##
608
811
  # Configuration class for the PublicAdvertisedPrefixes REST API.
609
812
  #
@@ -620,23 +823,23 @@ module Google
620
823
  # @example
621
824
  #
622
825
  # # Modify the global config, setting the timeout for
623
- # # delete to 20 seconds,
826
+ # # announce to 20 seconds,
624
827
  # # and all remaining timeouts to 10 seconds.
625
828
  # ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.configure do |config|
626
829
  # config.timeout = 10.0
627
- # config.rpcs.delete.timeout = 20.0
830
+ # config.rpcs.announce.timeout = 20.0
628
831
  # end
629
832
  #
630
833
  # # Apply the above configuration only to a new client.
631
834
  # client = ::Google::Cloud::Compute::V1::PublicAdvertisedPrefixes::Rest::Client.new do |config|
632
835
  # config.timeout = 10.0
633
- # config.rpcs.delete.timeout = 20.0
836
+ # config.rpcs.announce.timeout = 20.0
634
837
  # end
635
838
  #
636
839
  # @!attribute [rw] endpoint
637
- # The hostname or hostname:port of the service endpoint.
638
- # Defaults to `"compute.googleapis.com"`.
639
- # @return [::String]
840
+ # A custom service endpoint, as a hostname or hostname:port. The default is
841
+ # nil, indicating to use the default endpoint in the current universe domain.
842
+ # @return [::String,nil]
640
843
  # @!attribute [rw] credentials
641
844
  # Credentials to send with calls. You may provide any of the following types:
642
845
  # * (`String`) The path to a service account key file in JSON format
@@ -673,13 +876,20 @@ module Google
673
876
  # @!attribute [rw] quota_project
674
877
  # A separate project against which to charge quota.
675
878
  # @return [::String]
879
+ # @!attribute [rw] universe_domain
880
+ # The universe domain within which to make requests. This determines the
881
+ # default endpoint URL. The default value of nil uses the environment
882
+ # universe (usually the default "googleapis.com" universe).
883
+ # @return [::String,nil]
676
884
  #
677
885
  class Configuration
678
886
  extend ::Gapic::Config
679
887
 
888
+ # @private
889
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
680
890
  DEFAULT_ENDPOINT = "compute.googleapis.com"
681
891
 
682
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
892
+ config_attr :endpoint, nil, ::String, nil
683
893
  config_attr :credentials, nil do |value|
684
894
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
685
895
  allowed.any? { |klass| klass === value }
@@ -691,6 +901,7 @@ module Google
691
901
  config_attr :metadata, nil, ::Hash, nil
692
902
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
693
903
  config_attr :quota_project, nil, ::String, nil
904
+ config_attr :universe_domain, nil, ::String, nil
694
905
 
695
906
  # @private
696
907
  def initialize parent_config = nil
@@ -729,6 +940,11 @@ module Google
729
940
  # trigger a retry.
730
941
  #
731
942
  class Rpcs
943
+ ##
944
+ # RPC-specific configuration for `announce`
945
+ # @return [::Gapic::Config::Method]
946
+ #
947
+ attr_reader :announce
732
948
  ##
733
949
  # RPC-specific configuration for `delete`
734
950
  # @return [::Gapic::Config::Method]
@@ -754,9 +970,16 @@ module Google
754
970
  # @return [::Gapic::Config::Method]
755
971
  #
756
972
  attr_reader :patch
973
+ ##
974
+ # RPC-specific configuration for `withdraw`
975
+ # @return [::Gapic::Config::Method]
976
+ #
977
+ attr_reader :withdraw
757
978
 
758
979
  # @private
759
980
  def initialize parent_rpcs = nil
981
+ announce_config = parent_rpcs.announce if parent_rpcs.respond_to? :announce
982
+ @announce = ::Gapic::Config::Method.new announce_config
760
983
  delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
761
984
  @delete = ::Gapic::Config::Method.new delete_config
762
985
  get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
@@ -767,6 +990,8 @@ module Google
767
990
  @list = ::Gapic::Config::Method.new list_config
768
991
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
769
992
  @patch = ::Gapic::Config::Method.new patch_config
993
+ withdraw_config = parent_rpcs.withdraw if parent_rpcs.respond_to? :withdraw
994
+ @withdraw = ::Gapic::Config::Method.new withdraw_config
770
995
 
771
996
  yield self if block_given?
772
997
  end
@@ -30,16 +30,66 @@ 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
+
55
+ ##
56
+ # Baseline implementation for the announce REST call
57
+ #
58
+ # @param request_pb [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest]
59
+ # A request object representing the call parameters. Required.
60
+ # @param options [::Gapic::CallOptions]
61
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
62
+ #
63
+ # @yield [result, operation] Access the result along with the TransportOperation object
64
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
65
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
66
+ #
67
+ # @return [::Google::Cloud::Compute::V1::Operation]
68
+ # A result object deserialized from the server's reply
69
+ def announce request_pb, options = nil
70
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
71
+
72
+ verb, uri, query_string_params, body = ServiceStub.transcode_announce_request request_pb
73
+ query_string_params = if query_string_params.any?
74
+ query_string_params.to_h { |p| p.split "=", 2 }
75
+ else
76
+ {}
77
+ end
78
+
79
+ response = @client_stub.make_http_request(
80
+ verb,
81
+ uri: uri,
82
+ body: body || "",
83
+ params: query_string_params,
84
+ options: options
85
+ )
86
+ operation = ::Gapic::Rest::TransportOperation.new response
87
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
88
+
89
+ yield result, operation if block_given?
90
+ result
91
+ end
92
+
43
93
  ##
44
94
  # Baseline implementation for the delete REST call
45
95
  #
@@ -230,6 +280,66 @@ module Google
230
280
  result
231
281
  end
232
282
 
283
+ ##
284
+ # Baseline implementation for the withdraw REST call
285
+ #
286
+ # @param request_pb [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest]
287
+ # A request object representing the call parameters. Required.
288
+ # @param options [::Gapic::CallOptions]
289
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
290
+ #
291
+ # @yield [result, operation] Access the result along with the TransportOperation object
292
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
293
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
294
+ #
295
+ # @return [::Google::Cloud::Compute::V1::Operation]
296
+ # A result object deserialized from the server's reply
297
+ def withdraw request_pb, options = nil
298
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
299
+
300
+ verb, uri, query_string_params, body = ServiceStub.transcode_withdraw_request request_pb
301
+ query_string_params = if query_string_params.any?
302
+ query_string_params.to_h { |p| p.split "=", 2 }
303
+ else
304
+ {}
305
+ end
306
+
307
+ response = @client_stub.make_http_request(
308
+ verb,
309
+ uri: uri,
310
+ body: body || "",
311
+ params: query_string_params,
312
+ options: options
313
+ )
314
+ operation = ::Gapic::Rest::TransportOperation.new response
315
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
316
+
317
+ yield result, operation if block_given?
318
+ result
319
+ end
320
+
321
+ ##
322
+ # @private
323
+ #
324
+ # GRPC transcoding helper method for the announce REST call
325
+ #
326
+ # @param request_pb [::Google::Cloud::Compute::V1::AnnouncePublicAdvertisedPrefixeRequest]
327
+ # A request object representing the call parameters. Required.
328
+ # @return [Array(String, [String, nil], Hash{String => String})]
329
+ # Uri, Body, Query string parameters
330
+ def self.transcode_announce_request request_pb
331
+ transcoder = Gapic::Rest::GrpcTranscoder.new
332
+ .with_bindings(
333
+ uri_method: :post,
334
+ uri_template: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/announce",
335
+ matches: [
336
+ ["project", %r{^[^/]+/?$}, false],
337
+ ["public_advertised_prefix", %r{^[^/]+/?$}, false]
338
+ ]
339
+ )
340
+ transcoder.transcode request_pb
341
+ end
342
+
233
343
  ##
234
344
  # @private
235
345
  #
@@ -339,6 +449,28 @@ module Google
339
449
  )
340
450
  transcoder.transcode request_pb
341
451
  end
452
+
453
+ ##
454
+ # @private
455
+ #
456
+ # GRPC transcoding helper method for the withdraw REST call
457
+ #
458
+ # @param request_pb [::Google::Cloud::Compute::V1::WithdrawPublicAdvertisedPrefixeRequest]
459
+ # A request object representing the call parameters. Required.
460
+ # @return [Array(String, [String, nil], Hash{String => String})]
461
+ # Uri, Body, Query string parameters
462
+ def self.transcode_withdraw_request request_pb
463
+ transcoder = Gapic::Rest::GrpcTranscoder.new
464
+ .with_bindings(
465
+ uri_method: :post,
466
+ uri_template: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/withdraw",
467
+ matches: [
468
+ ["project", %r{^[^/]+/?$}, false],
469
+ ["public_advertised_prefix", %r{^[^/]+/?$}, false]
470
+ ]
471
+ )
472
+ transcoder.transcode request_pb
473
+ end
342
474
  end
343
475
  end
344
476
  end