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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -101
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +311 -8
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +196 -2
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +230 -10
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +134 -2
- data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/images/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +41 -13
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +143 -11
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +128 -9
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +74 -2
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
- data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +37 -9
- data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +37 -10
- data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +236 -11
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +134 -2
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +242 -10
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +136 -2
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +335 -8
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +198 -2
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +38 -11
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
- data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +348 -11
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +199 -2
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +451 -12
- data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +260 -2
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +36 -9
- data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/rest.rb +1 -0
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +135 -11
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +75 -2
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +45 -13
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +507 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +179 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
- data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +39 -11
- data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +142 -10
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +76 -2
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -8
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +38 -10
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +34 -8
- data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +14 -2
- data/lib/google/cloud/compute/v1.rb +1 -0
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
- data/proto_docs/google/protobuf/any.rb +144 -0
- metadata +11 -5
@@ -33,6 +33,9 @@ module Google
|
|
33
33
|
# The RegionAutoscalers API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :region_autoscalers_stub
|
38
41
|
|
@@ -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
|
+
@region_autoscalers_stub.universe_domain
|
122
|
+
end
|
123
|
+
|
112
124
|
##
|
113
125
|
# Create a new RegionAutoscalers 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
|
140
|
-
|
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)
|
@@ -151,9 +164,15 @@ module Google
|
|
151
164
|
config.credentials = credentials
|
152
165
|
config.quota_project = @quota_project_id
|
153
166
|
config.endpoint = @config.endpoint
|
167
|
+
config.universe_domain = @config.universe_domain
|
154
168
|
end
|
155
169
|
|
156
|
-
@region_autoscalers_stub = ::Google::Cloud::Compute::V1::RegionAutoscalers::Rest::ServiceStub.new
|
170
|
+
@region_autoscalers_stub = ::Google::Cloud::Compute::V1::RegionAutoscalers::Rest::ServiceStub.new(
|
171
|
+
endpoint: @config.endpoint,
|
172
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
173
|
+
universe_domain: @config.universe_domain,
|
174
|
+
credentials: credentials
|
175
|
+
)
|
157
176
|
end
|
158
177
|
|
159
178
|
##
|
@@ -452,7 +471,7 @@ module Google
|
|
452
471
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
453
472
|
#
|
454
473
|
# @param filter [::String]
|
455
|
-
# 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
|
474
|
+
# 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.
|
456
475
|
# @param max_results [::Integer]
|
457
476
|
# 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`)
|
458
477
|
# @param order_by [::String]
|
@@ -744,9 +763,9 @@ module Google
|
|
744
763
|
# end
|
745
764
|
#
|
746
765
|
# @!attribute [rw] endpoint
|
747
|
-
#
|
748
|
-
#
|
749
|
-
# @return [::String]
|
766
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
767
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
768
|
+
# @return [::String,nil]
|
750
769
|
# @!attribute [rw] credentials
|
751
770
|
# Credentials to send with calls. You may provide any of the following types:
|
752
771
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -783,13 +802,20 @@ module Google
|
|
783
802
|
# @!attribute [rw] quota_project
|
784
803
|
# A separate project against which to charge quota.
|
785
804
|
# @return [::String]
|
805
|
+
# @!attribute [rw] universe_domain
|
806
|
+
# The universe domain within which to make requests. This determines the
|
807
|
+
# default endpoint URL. The default value of nil uses the environment
|
808
|
+
# universe (usually the default "googleapis.com" universe).
|
809
|
+
# @return [::String,nil]
|
786
810
|
#
|
787
811
|
class Configuration
|
788
812
|
extend ::Gapic::Config
|
789
813
|
|
814
|
+
# @private
|
815
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
790
816
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
791
817
|
|
792
|
-
config_attr :endpoint,
|
818
|
+
config_attr :endpoint, nil, ::String, nil
|
793
819
|
config_attr :credentials, nil do |value|
|
794
820
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
795
821
|
allowed.any? { |klass| klass === value }
|
@@ -801,6 +827,7 @@ module Google
|
|
801
827
|
config_attr :metadata, nil, ::Hash, nil
|
802
828
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
803
829
|
config_attr :quota_project, nil, ::String, nil
|
830
|
+
config_attr :universe_domain, nil, ::String, nil
|
804
831
|
|
805
832
|
# @private
|
806
833
|
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,
|
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 RegionBackendServices API.
|
34
34
|
#
|
35
35
|
class Client
|
36
|
+
# @private
|
37
|
+
DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
|
38
|
+
|
36
39
|
# @private
|
37
40
|
attr_reader :region_backend_services_stub
|
38
41
|
|
@@ -86,10 +89,19 @@ module Google
|
|
86
89
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
87
90
|
}
|
88
91
|
|
92
|
+
default_config.rpcs.list_usable.timeout = 600.0
|
93
|
+
default_config.rpcs.list_usable.retry_policy = {
|
94
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
95
|
+
}
|
96
|
+
|
89
97
|
default_config.rpcs.patch.timeout = 600.0
|
90
98
|
|
91
99
|
default_config.rpcs.set_iam_policy.timeout = 600.0
|
92
100
|
|
101
|
+
default_config.rpcs.set_security_policy.timeout = 600.0
|
102
|
+
|
103
|
+
default_config.rpcs.test_iam_permissions.timeout = 600.0
|
104
|
+
|
93
105
|
default_config.rpcs.update.timeout = 600.0
|
94
106
|
|
95
107
|
default_config
|
@@ -118,6 +130,15 @@ module Google
|
|
118
130
|
@config
|
119
131
|
end
|
120
132
|
|
133
|
+
##
|
134
|
+
# The effective universe domain
|
135
|
+
#
|
136
|
+
# @return [String]
|
137
|
+
#
|
138
|
+
def universe_domain
|
139
|
+
@region_backend_services_stub.universe_domain
|
140
|
+
end
|
141
|
+
|
121
142
|
##
|
122
143
|
# Create a new RegionBackendServices REST client object.
|
123
144
|
#
|
@@ -145,8 +166,9 @@ module Google
|
|
145
166
|
credentials = @config.credentials
|
146
167
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
147
168
|
# but only if the default endpoint does not have a region prefix.
|
148
|
-
enable_self_signed_jwt = @config.endpoint
|
149
|
-
|
169
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
170
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
171
|
+
!@config.endpoint.split(".").first.include?("-"))
|
150
172
|
credentials ||= Credentials.default scope: @config.scope,
|
151
173
|
enable_self_signed_jwt: enable_self_signed_jwt
|
152
174
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -160,9 +182,15 @@ module Google
|
|
160
182
|
config.credentials = credentials
|
161
183
|
config.quota_project = @quota_project_id
|
162
184
|
config.endpoint = @config.endpoint
|
185
|
+
config.universe_domain = @config.universe_domain
|
163
186
|
end
|
164
187
|
|
165
|
-
@region_backend_services_stub = ::Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub.new
|
188
|
+
@region_backend_services_stub = ::Google::Cloud::Compute::V1::RegionBackendServices::Rest::ServiceStub.new(
|
189
|
+
endpoint: @config.endpoint,
|
190
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
191
|
+
universe_domain: @config.universe_domain,
|
192
|
+
credentials: credentials
|
193
|
+
)
|
166
194
|
end
|
167
195
|
|
168
196
|
##
|
@@ -628,7 +656,7 @@ module Google
|
|
628
656
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
629
657
|
#
|
630
658
|
# @param filter [::String]
|
631
|
-
# 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
|
659
|
+
# 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.
|
632
660
|
# @param max_results [::Integer]
|
633
661
|
# 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`)
|
634
662
|
# @param order_by [::String]
|
@@ -700,6 +728,97 @@ module Google
|
|
700
728
|
raise ::Google::Cloud::Error.from_error(e)
|
701
729
|
end
|
702
730
|
|
731
|
+
##
|
732
|
+
# Retrieves an aggregated list of all usable backend services in the specified project in the given region.
|
733
|
+
#
|
734
|
+
# @overload list_usable(request, options = nil)
|
735
|
+
# Pass arguments to `list_usable` via a request object, either of type
|
736
|
+
# {::Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest} or an equivalent Hash.
|
737
|
+
#
|
738
|
+
# @param request [::Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest, ::Hash]
|
739
|
+
# A request object representing the call parameters. Required. To specify no
|
740
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
741
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
742
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
743
|
+
#
|
744
|
+
# @overload list_usable(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
|
745
|
+
# Pass arguments to `list_usable` via keyword arguments. Note that at
|
746
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
747
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
748
|
+
#
|
749
|
+
# @param filter [::String]
|
750
|
+
# 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.
|
751
|
+
# @param max_results [::Integer]
|
752
|
+
# 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`)
|
753
|
+
# @param order_by [::String]
|
754
|
+
# Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
|
755
|
+
# @param page_token [::String]
|
756
|
+
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
|
757
|
+
# @param project [::String]
|
758
|
+
# Project ID for this request.
|
759
|
+
# @param region [::String]
|
760
|
+
# Name of the region scoping this request. It must be a string that meets the requirements in RFC1035.
|
761
|
+
# @param return_partial_success [::Boolean]
|
762
|
+
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
763
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
764
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::BackendService>]
|
765
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
766
|
+
#
|
767
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::BackendService>]
|
768
|
+
#
|
769
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
770
|
+
#
|
771
|
+
# @example Basic example
|
772
|
+
# require "google/cloud/compute/v1"
|
773
|
+
#
|
774
|
+
# # Create a client object. The client can be reused for multiple calls.
|
775
|
+
# client = Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client.new
|
776
|
+
#
|
777
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
778
|
+
# request = Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest.new
|
779
|
+
#
|
780
|
+
# # Call the list_usable method.
|
781
|
+
# result = client.list_usable request
|
782
|
+
#
|
783
|
+
# # The returned object is of type Google::Cloud::Compute::V1::BackendServiceListUsable.
|
784
|
+
# p result
|
785
|
+
#
|
786
|
+
def list_usable request, options = nil
|
787
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
788
|
+
|
789
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListUsableRegionBackendServicesRequest
|
790
|
+
|
791
|
+
# Converts hash and nil to an options object
|
792
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
793
|
+
|
794
|
+
# Customize the options with defaults
|
795
|
+
call_metadata = @config.rpcs.list_usable.metadata.to_h
|
796
|
+
|
797
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
798
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
799
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
800
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
801
|
+
transports_version_send: [:rest]
|
802
|
+
|
803
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
804
|
+
|
805
|
+
options.apply_defaults timeout: @config.rpcs.list_usable.timeout,
|
806
|
+
metadata: call_metadata,
|
807
|
+
retry_policy: @config.rpcs.list_usable.retry_policy
|
808
|
+
|
809
|
+
options.apply_defaults timeout: @config.timeout,
|
810
|
+
metadata: @config.metadata,
|
811
|
+
retry_policy: @config.retry_policy
|
812
|
+
|
813
|
+
@region_backend_services_stub.list_usable request, options do |result, operation|
|
814
|
+
result = ::Gapic::Rest::PagedEnumerable.new @region_backend_services_stub, :list_usable, "items", request, result, options
|
815
|
+
yield result, operation if block_given?
|
816
|
+
return result
|
817
|
+
end
|
818
|
+
rescue ::Gapic::Rest::Error => e
|
819
|
+
raise ::Google::Cloud::Error.from_error(e)
|
820
|
+
end
|
821
|
+
|
703
822
|
##
|
704
823
|
# Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
|
705
824
|
#
|
@@ -879,6 +998,185 @@ module Google
|
|
879
998
|
raise ::Google::Cloud::Error.from_error(e)
|
880
999
|
end
|
881
1000
|
|
1001
|
+
##
|
1002
|
+
# Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview
|
1003
|
+
#
|
1004
|
+
# @overload set_security_policy(request, options = nil)
|
1005
|
+
# Pass arguments to `set_security_policy` via a request object, either of type
|
1006
|
+
# {::Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest} or an equivalent Hash.
|
1007
|
+
#
|
1008
|
+
# @param request [::Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest, ::Hash]
|
1009
|
+
# A request object representing the call parameters. Required. To specify no
|
1010
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1011
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1012
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1013
|
+
#
|
1014
|
+
# @overload set_security_policy(backend_service: nil, project: nil, region: nil, request_id: nil, security_policy_reference_resource: nil)
|
1015
|
+
# Pass arguments to `set_security_policy` via keyword arguments. Note that at
|
1016
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1017
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1018
|
+
#
|
1019
|
+
# @param backend_service [::String]
|
1020
|
+
# Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.
|
1021
|
+
# @param project [::String]
|
1022
|
+
# Project ID for this request.
|
1023
|
+
# @param region [::String]
|
1024
|
+
# Name of the region scoping this request.
|
1025
|
+
# @param request_id [::String]
|
1026
|
+
# 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).
|
1027
|
+
# @param security_policy_reference_resource [::Google::Cloud::Compute::V1::SecurityPolicyReference, ::Hash]
|
1028
|
+
# The body resource for this request
|
1029
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1030
|
+
# @yieldparam result [::Gapic::GenericLRO::Operation]
|
1031
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1032
|
+
#
|
1033
|
+
# @return [::Gapic::GenericLRO::Operation]
|
1034
|
+
#
|
1035
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1036
|
+
#
|
1037
|
+
# @example Basic example
|
1038
|
+
# require "google/cloud/compute/v1"
|
1039
|
+
#
|
1040
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1041
|
+
# client = Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client.new
|
1042
|
+
#
|
1043
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1044
|
+
# request = Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest.new
|
1045
|
+
#
|
1046
|
+
# # Call the set_security_policy method.
|
1047
|
+
# result = client.set_security_policy request
|
1048
|
+
#
|
1049
|
+
# # The returned object is of type Google::Cloud::Compute::V1::Operation.
|
1050
|
+
# p result
|
1051
|
+
#
|
1052
|
+
def set_security_policy request, options = nil
|
1053
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1054
|
+
|
1055
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSecurityPolicyRegionBackendServiceRequest
|
1056
|
+
|
1057
|
+
# Converts hash and nil to an options object
|
1058
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1059
|
+
|
1060
|
+
# Customize the options with defaults
|
1061
|
+
call_metadata = @config.rpcs.set_security_policy.metadata.to_h
|
1062
|
+
|
1063
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1064
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1065
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1066
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
1067
|
+
transports_version_send: [:rest]
|
1068
|
+
|
1069
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1070
|
+
|
1071
|
+
options.apply_defaults timeout: @config.rpcs.set_security_policy.timeout,
|
1072
|
+
metadata: call_metadata,
|
1073
|
+
retry_policy: @config.rpcs.set_security_policy.retry_policy
|
1074
|
+
|
1075
|
+
options.apply_defaults timeout: @config.timeout,
|
1076
|
+
metadata: @config.metadata,
|
1077
|
+
retry_policy: @config.retry_policy
|
1078
|
+
|
1079
|
+
@region_backend_services_stub.set_security_policy request, options do |result, response|
|
1080
|
+
result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
|
1081
|
+
operation: result,
|
1082
|
+
client: region_operations,
|
1083
|
+
request_values: {
|
1084
|
+
"project" => request.project,
|
1085
|
+
"region" => request.region
|
1086
|
+
},
|
1087
|
+
options: options
|
1088
|
+
)
|
1089
|
+
yield result, response if block_given?
|
1090
|
+
return result
|
1091
|
+
end
|
1092
|
+
rescue ::Gapic::Rest::Error => e
|
1093
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
##
|
1097
|
+
# Returns permissions that a caller has on the specified resource.
|
1098
|
+
#
|
1099
|
+
# @overload test_iam_permissions(request, options = nil)
|
1100
|
+
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
1101
|
+
# {::Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest} or an equivalent Hash.
|
1102
|
+
#
|
1103
|
+
# @param request [::Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest, ::Hash]
|
1104
|
+
# A request object representing the call parameters. Required. To specify no
|
1105
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1106
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1107
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1108
|
+
#
|
1109
|
+
# @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
|
1110
|
+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
|
1111
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1112
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1113
|
+
#
|
1114
|
+
# @param project [::String]
|
1115
|
+
# Project ID for this request.
|
1116
|
+
# @param region [::String]
|
1117
|
+
# The name of the region for this request.
|
1118
|
+
# @param resource [::String]
|
1119
|
+
# Name or id of the resource for this request.
|
1120
|
+
# @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
|
1121
|
+
# The body resource for this request
|
1122
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1123
|
+
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
|
1124
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1125
|
+
#
|
1126
|
+
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
|
1127
|
+
#
|
1128
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1129
|
+
#
|
1130
|
+
# @example Basic example
|
1131
|
+
# require "google/cloud/compute/v1"
|
1132
|
+
#
|
1133
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1134
|
+
# client = Google::Cloud::Compute::V1::RegionBackendServices::Rest::Client.new
|
1135
|
+
#
|
1136
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1137
|
+
# request = Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest.new
|
1138
|
+
#
|
1139
|
+
# # Call the test_iam_permissions method.
|
1140
|
+
# result = client.test_iam_permissions request
|
1141
|
+
#
|
1142
|
+
# # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
|
1143
|
+
# p result
|
1144
|
+
#
|
1145
|
+
def test_iam_permissions request, options = nil
|
1146
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1147
|
+
|
1148
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsRegionBackendServiceRequest
|
1149
|
+
|
1150
|
+
# Converts hash and nil to an options object
|
1151
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1152
|
+
|
1153
|
+
# Customize the options with defaults
|
1154
|
+
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
1155
|
+
|
1156
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1157
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1158
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1159
|
+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
1160
|
+
transports_version_send: [:rest]
|
1161
|
+
|
1162
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1163
|
+
|
1164
|
+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
1165
|
+
metadata: call_metadata,
|
1166
|
+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
1167
|
+
|
1168
|
+
options.apply_defaults timeout: @config.timeout,
|
1169
|
+
metadata: @config.metadata,
|
1170
|
+
retry_policy: @config.retry_policy
|
1171
|
+
|
1172
|
+
@region_backend_services_stub.test_iam_permissions request, options do |result, operation|
|
1173
|
+
yield result, operation if block_given?
|
1174
|
+
return result
|
1175
|
+
end
|
1176
|
+
rescue ::Gapic::Rest::Error => e
|
1177
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1178
|
+
end
|
1179
|
+
|
882
1180
|
##
|
883
1181
|
# Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview .
|
884
1182
|
#
|
@@ -1004,9 +1302,9 @@ module Google
|
|
1004
1302
|
# end
|
1005
1303
|
#
|
1006
1304
|
# @!attribute [rw] endpoint
|
1007
|
-
#
|
1008
|
-
#
|
1009
|
-
# @return [::String]
|
1305
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1306
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1307
|
+
# @return [::String,nil]
|
1010
1308
|
# @!attribute [rw] credentials
|
1011
1309
|
# Credentials to send with calls. You may provide any of the following types:
|
1012
1310
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1043,13 +1341,20 @@ module Google
|
|
1043
1341
|
# @!attribute [rw] quota_project
|
1044
1342
|
# A separate project against which to charge quota.
|
1045
1343
|
# @return [::String]
|
1344
|
+
# @!attribute [rw] universe_domain
|
1345
|
+
# The universe domain within which to make requests. This determines the
|
1346
|
+
# default endpoint URL. The default value of nil uses the environment
|
1347
|
+
# universe (usually the default "googleapis.com" universe).
|
1348
|
+
# @return [::String,nil]
|
1046
1349
|
#
|
1047
1350
|
class Configuration
|
1048
1351
|
extend ::Gapic::Config
|
1049
1352
|
|
1353
|
+
# @private
|
1354
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1050
1355
|
DEFAULT_ENDPOINT = "compute.googleapis.com"
|
1051
1356
|
|
1052
|
-
config_attr :endpoint,
|
1357
|
+
config_attr :endpoint, nil, ::String, nil
|
1053
1358
|
config_attr :credentials, nil do |value|
|
1054
1359
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1055
1360
|
allowed.any? { |klass| klass === value }
|
@@ -1061,6 +1366,7 @@ module Google
|
|
1061
1366
|
config_attr :metadata, nil, ::Hash, nil
|
1062
1367
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1063
1368
|
config_attr :quota_project, nil, ::String, nil
|
1369
|
+
config_attr :universe_domain, nil, ::String, nil
|
1064
1370
|
|
1065
1371
|
# @private
|
1066
1372
|
def initialize parent_config = nil
|
@@ -1130,6 +1436,11 @@ module Google
|
|
1130
1436
|
#
|
1131
1437
|
attr_reader :list
|
1132
1438
|
##
|
1439
|
+
# RPC-specific configuration for `list_usable`
|
1440
|
+
# @return [::Gapic::Config::Method]
|
1441
|
+
#
|
1442
|
+
attr_reader :list_usable
|
1443
|
+
##
|
1133
1444
|
# RPC-specific configuration for `patch`
|
1134
1445
|
# @return [::Gapic::Config::Method]
|
1135
1446
|
#
|
@@ -1140,6 +1451,16 @@ module Google
|
|
1140
1451
|
#
|
1141
1452
|
attr_reader :set_iam_policy
|
1142
1453
|
##
|
1454
|
+
# RPC-specific configuration for `set_security_policy`
|
1455
|
+
# @return [::Gapic::Config::Method]
|
1456
|
+
#
|
1457
|
+
attr_reader :set_security_policy
|
1458
|
+
##
|
1459
|
+
# RPC-specific configuration for `test_iam_permissions`
|
1460
|
+
# @return [::Gapic::Config::Method]
|
1461
|
+
#
|
1462
|
+
attr_reader :test_iam_permissions
|
1463
|
+
##
|
1143
1464
|
# RPC-specific configuration for `update`
|
1144
1465
|
# @return [::Gapic::Config::Method]
|
1145
1466
|
#
|
@@ -1159,10 +1480,16 @@ module Google
|
|
1159
1480
|
@insert = ::Gapic::Config::Method.new insert_config
|
1160
1481
|
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|
1161
1482
|
@list = ::Gapic::Config::Method.new list_config
|
1483
|
+
list_usable_config = parent_rpcs.list_usable if parent_rpcs.respond_to? :list_usable
|
1484
|
+
@list_usable = ::Gapic::Config::Method.new list_usable_config
|
1162
1485
|
patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
|
1163
1486
|
@patch = ::Gapic::Config::Method.new patch_config
|
1164
1487
|
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
1165
1488
|
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
1489
|
+
set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
|
1490
|
+
@set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
|
1491
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
1492
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
1166
1493
|
update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
|
1167
1494
|
@update = ::Gapic::Config::Method.new update_config
|
1168
1495
|
|