google-cloud-compute-v1 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +19 -37
- data/README.md +4 -30
- data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +127 -90
- data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +188 -0
- data/lib/google/cloud/compute/v1/accelerator_types/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/addresses/rest/client.rb +172 -130
- data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/addresses/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +218 -172
- data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +373 -0
- data/lib/google/cloud/compute/v1/autoscalers/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +236 -185
- data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +413 -0
- data/lib/google/cloud/compute/v1/backend_buckets/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +308 -253
- data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +553 -0
- data/lib/google/cloud/compute/v1/backend_services/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/compute_pb.rb +8507 -7466
- data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +127 -90
- data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +188 -0
- data/lib/google/cloud/compute/v1/disk_types/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/disks/rest/client.rb +345 -272
- data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +644 -0
- data/lib/google/cloud/compute/v1/disks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +184 -129
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +317 -0
- data/lib/google/cloud/compute/v1/external_vpn_gateways/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +476 -343
- data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +869 -0
- data/lib/google/cloud/compute/v1/firewall_policies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +191 -145
- data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +321 -0
- data/lib/google/cloud/compute/v1/firewalls/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +296 -171
- data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +417 -0
- data/lib/google/cloud/compute/v1/forwarding_rules/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +145 -103
- data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +229 -0
- data/lib/google/cloud/compute/v1/global_addresses/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +265 -144
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +365 -0
- data/lib/google/cloud/compute/v1/global_forwarding_rules/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +215 -172
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +370 -0
- data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +165 -118
- data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +274 -0
- data/lib/google/cloud/compute/v1/global_operations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +118 -76
- data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +186 -0
- data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +175 -124
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +275 -0
- data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +218 -172
- data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +371 -0
- data/lib/google/cloud/compute/v1/health_checks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/image_family_views/credentials.rb +53 -0
- data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +318 -0
- data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +89 -0
- data/lib/google/cloud/compute/v1/image_family_views/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/image_family_views.rb +44 -0
- data/lib/google/cloud/compute/v1/images/rest/client.rb +291 -209
- data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +542 -0
- data/lib/google/cloud/compute/v1/images/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +526 -477
- data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +974 -0
- data/lib/google/cloud/compute/v1/instance_group_managers/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +271 -233
- data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +467 -0
- data/lib/google/cloud/compute/v1/instance_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +202 -139
- data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +362 -0
- data/lib/google/cloud/compute/v1/instance_templates/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/instances/rest/client.rb +1186 -797
- data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +2018 -0
- data/lib/google/cloud/compute/v1/instances/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +195 -151
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +326 -0
- data/lib/google/cloud/compute/v1/interconnect_attachments/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +100 -63
- data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +138 -0
- data/lib/google/cloud/compute/v1/interconnect_locations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +189 -135
- data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +318 -0
- data/lib/google/cloud/compute/v1/interconnects/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +93 -50
- data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +133 -0
- data/lib/google/cloud/compute/v1/license_codes/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/licenses/rest/client.rb +209 -146
- data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +362 -0
- data/lib/google/cloud/compute/v1/licenses/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +127 -90
- data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +188 -0
- data/lib/google/cloud/compute/v1/machine_types/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +261 -213
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +465 -0
- data/lib/google/cloud/compute/v1/network_endpoint_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/networks/rest/client.rb +363 -234
- data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +553 -0
- data/lib/google/cloud/compute/v1/networks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +345 -277
- data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +646 -0
- data/lib/google/cloud/compute/v1/node_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +229 -166
- data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +412 -0
- data/lib/google/cloud/compute/v1/node_templates/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/node_types/rest/client.rb +127 -90
- data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +188 -0
- data/lib/google/cloud/compute/v1/node_types/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +213 -163
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +369 -0
- data/lib/google/cloud/compute/v1/packet_mirrorings/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/projects/rest/client.rb +351 -288
- data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +643 -0
- data/lib/google/cloud/compute/v1/projects/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +175 -124
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +275 -0
- data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +203 -151
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +325 -0
- data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +191 -145
- data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +323 -0
- data/lib/google/cloud/compute/v1/region_autoscalers/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +212 -160
- data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +365 -0
- data/lib/google/cloud/compute/v1/region_backend_services/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +151 -112
- data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +234 -0
- data/lib/google/cloud/compute/v1/region_commitments/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +100 -63
- data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +138 -0
- data/lib/google/cloud/compute/v1/region_disk_types/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +318 -245
- data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +593 -0
- data/lib/google/cloud/compute/v1/region_disks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +168 -124
- data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +275 -0
- data/lib/google/cloud/compute/v1/region_health_check_services/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +191 -145
- data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +321 -0
- data/lib/google/cloud/compute/v1/region_health_checks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +498 -445
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +924 -0
- data/lib/google/cloud/compute/v1/region_instance_group_managers/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +148 -113
- data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +234 -0
- data/lib/google/cloud/compute/v1/region_instance_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +76 -45
- data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +92 -0
- data/lib/google/cloud/compute/v1/region_instances/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +145 -103
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +229 -0
- data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +145 -103
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +229 -0
- data/lib/google/cloud/compute/v1/region_notification_endpoints/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +137 -90
- data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +224 -0
- data/lib/google/cloud/compute/v1/region_operations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +145 -103
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +229 -0
- data/lib/google/cloud/compute/v1/region_ssl_certificates/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +168 -124
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +275 -0
- data/lib/google/cloud/compute/v1/region_target_http_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +191 -145
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +321 -0
- data/lib/google/cloud/compute/v1/region_target_https_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +205 -137
- data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +365 -0
- data/lib/google/cloud/compute/v1/region_url_maps/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/regions/rest/client.rb +100 -63
- data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +138 -0
- data/lib/google/cloud/compute/v1/regions/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/reservations/rest/client.rb +252 -187
- data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +458 -0
- data/lib/google/cloud/compute/v1/reservations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +229 -166
- data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +412 -0
- data/lib/google/cloud/compute/v1/resource_policies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/routers/rest/client.rb +284 -222
- data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +507 -0
- data/lib/google/cloud/compute/v1/routers/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/routes/rest/client.rb +145 -103
- data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +229 -0
- data/lib/google/cloud/compute/v1/routes/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +277 -205
- data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +504 -0
- data/lib/google/cloud/compute/v1/security_policies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/service_attachments/credentials.rb +52 -0
- data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +954 -0
- data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +458 -0
- data/lib/google/cloud/compute/v1/service_attachments/rest.rb +33 -0
- data/lib/google/cloud/compute/v1/service_attachments.rb +44 -0
- data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +201 -135
- data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +360 -0
- data/lib/google/cloud/compute/v1/snapshots/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +172 -130
- data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/ssl_certificates/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +192 -149
- data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +324 -0
- data/lib/google/cloud/compute/v1/ssl_policies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +325 -256
- data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +600 -0
- data/lib/google/cloud/compute/v1/subnetworks/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +168 -124
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +275 -0
- data/lib/google/cloud/compute/v1/target_grpc_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +219 -173
- data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +371 -0
- data/lib/google/cloud/compute/v1/target_http_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +340 -213
- data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +509 -0
- data/lib/google/cloud/compute/v1/target_https_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +172 -130
- data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/target_instances/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +305 -247
- data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +554 -0
- data/lib/google/cloud/compute/v1/target_pools/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +237 -187
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +413 -0
- data/lib/google/cloud/compute/v1/target_ssl_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +191 -145
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +321 -0
- data/lib/google/cloud/compute/v1/target_tcp_proxies/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +172 -130
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/target_vpn_gateways/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +260 -208
- data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +461 -0
- data/lib/google/cloud/compute/v1/url_maps/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/version.rb +1 -1
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +234 -174
- data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +412 -0
- data/lib/google/cloud/compute/v1/vpn_gateways/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +172 -130
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +279 -0
- data/lib/google/cloud/compute/v1/vpn_tunnels/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +137 -90
- data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +224 -0
- data/lib/google/cloud/compute/v1/zone_operations/rest.rb +0 -2
- data/lib/google/cloud/compute/v1/zones/rest/client.rb +100 -63
- data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +138 -0
- data/lib/google/cloud/compute/v1/zones/rest.rb +0 -2
- data/lib/google/cloud/compute/v1.rb +7 -0
- data/proto_docs/README.md +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/compute/v1/compute.rb +18964 -19481
- data/proto_docs/google/cloud/extended_operations.rb +51 -0
- metadata +110 -9
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/compute/v1/compute_pb"
|
21
|
+
require "google/cloud/compute/v1/security_policies/rest/service_stub"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -31,8 +32,6 @@ module Google
|
|
31
32
|
# The SecurityPolicies API.
|
32
33
|
#
|
33
34
|
class Client
|
34
|
-
include GrpcTranscoding
|
35
|
-
|
36
35
|
# @private
|
37
36
|
attr_reader :security_policies_stub
|
38
37
|
|
@@ -42,13 +41,12 @@ module Google
|
|
42
41
|
# See {::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client::Configuration}
|
43
42
|
# for a description of the configuration fields.
|
44
43
|
#
|
45
|
-
#
|
44
|
+
# @example
|
46
45
|
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# end
|
46
|
+
# # Modify the configuration for all SecurityPolicies clients
|
47
|
+
# ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
52
50
|
#
|
53
51
|
# @yield [config] Configure the Client client.
|
54
52
|
# @yieldparam config [Client::Configuration]
|
@@ -66,6 +64,38 @@ module Google
|
|
66
64
|
end
|
67
65
|
default_config = Client::Configuration.new parent_config
|
68
66
|
|
67
|
+
default_config.rpcs.add_rule.timeout = 600.0
|
68
|
+
|
69
|
+
default_config.rpcs.delete.timeout = 600.0
|
70
|
+
|
71
|
+
default_config.rpcs.get.timeout = 600.0
|
72
|
+
default_config.rpcs.get.retry_policy = {
|
73
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
74
|
+
}
|
75
|
+
|
76
|
+
default_config.rpcs.get_rule.timeout = 600.0
|
77
|
+
default_config.rpcs.get_rule.retry_policy = {
|
78
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.insert.timeout = 600.0
|
82
|
+
|
83
|
+
default_config.rpcs.list.timeout = 600.0
|
84
|
+
default_config.rpcs.list.retry_policy = {
|
85
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
86
|
+
}
|
87
|
+
|
88
|
+
default_config.rpcs.list_preconfigured_expression_sets.timeout = 600.0
|
89
|
+
default_config.rpcs.list_preconfigured_expression_sets.retry_policy = {
|
90
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
91
|
+
}
|
92
|
+
|
93
|
+
default_config.rpcs.patch.timeout = 600.0
|
94
|
+
|
95
|
+
default_config.rpcs.patch_rule.timeout = 600.0
|
96
|
+
|
97
|
+
default_config.rpcs.remove_rule.timeout = 600.0
|
98
|
+
|
69
99
|
default_config
|
70
100
|
end
|
71
101
|
yield @configure if block_given?
|
@@ -95,28 +125,20 @@ module Google
|
|
95
125
|
##
|
96
126
|
# Create a new SecurityPolicies REST client object.
|
97
127
|
#
|
98
|
-
#
|
128
|
+
# @example
|
99
129
|
#
|
100
|
-
#
|
101
|
-
#
|
130
|
+
# # Create a client using the default configuration
|
131
|
+
# client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new
|
102
132
|
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
# client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new do |config|
|
109
|
-
# config.timeout = 10.0
|
110
|
-
# end
|
133
|
+
# # Create a client using a custom configuration
|
134
|
+
# client = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::Client.new do |config|
|
135
|
+
# config.timeout = 10.0
|
136
|
+
# end
|
111
137
|
#
|
112
138
|
# @yield [config] Configure the SecurityPolicies client.
|
113
139
|
# @yieldparam config [Client::Configuration]
|
114
140
|
#
|
115
141
|
def initialize
|
116
|
-
# These require statements are intentionally placed here to initialize
|
117
|
-
# the REST modules only when it's required.
|
118
|
-
require "gapic/rest"
|
119
|
-
|
120
142
|
# Create the configuration object
|
121
143
|
@config = Configuration.new Client.configure
|
122
144
|
|
@@ -126,11 +148,11 @@ module Google
|
|
126
148
|
# Create credentials
|
127
149
|
credentials = @config.credentials
|
128
150
|
credentials ||= Credentials.default scope: @config.scope
|
129
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
151
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
130
152
|
credentials = Credentials.new credentials, scope: @config.scope
|
131
153
|
end
|
132
154
|
|
133
|
-
@
|
155
|
+
@security_policies_stub = ::Google::Cloud::Compute::V1::SecurityPolicies::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
134
156
|
end
|
135
157
|
|
136
158
|
# Service calls
|
@@ -161,11 +183,11 @@ module Google
|
|
161
183
|
# Name of the security policy to update.
|
162
184
|
# @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
|
163
185
|
# The body resource for this request
|
164
|
-
# @yield [result,
|
165
|
-
# @yieldparam result [::
|
186
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
187
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
166
188
|
# @yieldparam response [::Faraday::Response]
|
167
189
|
#
|
168
|
-
# @return [::
|
190
|
+
# @return [::Gapic::Rest::BaseOperation]
|
169
191
|
#
|
170
192
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
171
193
|
def add_rule request, options = nil
|
@@ -177,7 +199,7 @@ module Google
|
|
177
199
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
178
200
|
|
179
201
|
# Customize the options with defaults
|
180
|
-
call_metadata =
|
202
|
+
call_metadata = @config.rpcs.add_rule.metadata.to_h
|
181
203
|
|
182
204
|
# Set x-goog-api-client header
|
183
205
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -185,19 +207,17 @@ module Google
|
|
185
207
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
186
208
|
transports_version_send: [:rest]
|
187
209
|
|
188
|
-
options.apply_defaults timeout: @config.timeout,
|
210
|
+
options.apply_defaults timeout: @config.rpcs.add_rule.timeout,
|
189
211
|
metadata: call_metadata
|
190
212
|
|
191
|
-
|
192
|
-
|
193
|
-
uri: uri,
|
194
|
-
body: body,
|
195
|
-
options: options
|
196
|
-
)
|
197
|
-
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
213
|
+
options.apply_defaults timeout: @config.timeout,
|
214
|
+
metadata: @config.metadata
|
198
215
|
|
199
|
-
|
200
|
-
|
216
|
+
@security_policies_stub.add_rule request, options do |result, response|
|
217
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
218
|
+
yield result, response if block_given?
|
219
|
+
return result
|
220
|
+
end
|
201
221
|
rescue ::Faraday::Error => e
|
202
222
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
203
223
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -226,18 +246,14 @@ module Google
|
|
226
246
|
# @param project [::String]
|
227
247
|
# Project ID for this request.
|
228
248
|
# @param request_id [::String]
|
229
|
-
# 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.
|
230
|
-
#
|
231
|
-
# 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.
|
232
|
-
#
|
233
|
-
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
249
|
+
# 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).
|
234
250
|
# @param security_policy [::String]
|
235
251
|
# Name of the security policy to delete.
|
236
|
-
# @yield [result,
|
237
|
-
# @yieldparam result [::
|
252
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
253
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
238
254
|
# @yieldparam response [::Faraday::Response]
|
239
255
|
#
|
240
|
-
# @return [::
|
256
|
+
# @return [::Gapic::Rest::BaseOperation]
|
241
257
|
#
|
242
258
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
243
259
|
def delete request, options = nil
|
@@ -249,7 +265,7 @@ module Google
|
|
249
265
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
250
266
|
|
251
267
|
# Customize the options with defaults
|
252
|
-
call_metadata =
|
268
|
+
call_metadata = @config.rpcs.delete.metadata.to_h
|
253
269
|
|
254
270
|
# Set x-goog-api-client header
|
255
271
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -257,19 +273,17 @@ module Google
|
|
257
273
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
258
274
|
transports_version_send: [:rest]
|
259
275
|
|
260
|
-
options.apply_defaults timeout: @config.timeout,
|
276
|
+
options.apply_defaults timeout: @config.rpcs.delete.timeout,
|
261
277
|
metadata: call_metadata
|
262
278
|
|
263
|
-
|
264
|
-
|
265
|
-
uri: uri,
|
266
|
-
params: query_string_params,
|
267
|
-
options: options
|
268
|
-
)
|
269
|
-
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
279
|
+
options.apply_defaults timeout: @config.timeout,
|
280
|
+
metadata: @config.metadata
|
270
281
|
|
271
|
-
|
272
|
-
|
282
|
+
@security_policies_stub.delete request, options do |result, response|
|
283
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
284
|
+
yield result, response if block_given?
|
285
|
+
return result
|
286
|
+
end
|
273
287
|
rescue ::Faraday::Error => e
|
274
288
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
275
289
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -299,7 +313,7 @@ module Google
|
|
299
313
|
# Project ID for this request.
|
300
314
|
# @param security_policy [::String]
|
301
315
|
# Name of the security policy to get.
|
302
|
-
# @yield [result,
|
316
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
303
317
|
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicy]
|
304
318
|
# @yieldparam response [::Faraday::Response]
|
305
319
|
#
|
@@ -315,7 +329,7 @@ module Google
|
|
315
329
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
316
330
|
|
317
331
|
# Customize the options with defaults
|
318
|
-
call_metadata =
|
332
|
+
call_metadata = @config.rpcs.get.metadata.to_h
|
319
333
|
|
320
334
|
# Set x-goog-api-client header
|
321
335
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -323,18 +337,16 @@ module Google
|
|
323
337
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
324
338
|
transports_version_send: [:rest]
|
325
339
|
|
326
|
-
options.apply_defaults timeout: @config.timeout,
|
340
|
+
options.apply_defaults timeout: @config.rpcs.get.timeout,
|
327
341
|
metadata: call_metadata
|
328
342
|
|
329
|
-
|
330
|
-
|
331
|
-
uri: uri,
|
332
|
-
options: options
|
333
|
-
)
|
334
|
-
result = ::Google::Cloud::Compute::V1::SecurityPolicy.decode_json response.body, ignore_unknown_fields: true
|
343
|
+
options.apply_defaults timeout: @config.timeout,
|
344
|
+
metadata: @config.metadata
|
335
345
|
|
336
|
-
|
337
|
-
|
346
|
+
@security_policies_stub.get request, options do |result, response|
|
347
|
+
yield result, response if block_given?
|
348
|
+
return result
|
349
|
+
end
|
338
350
|
rescue ::Faraday::Error => e
|
339
351
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
340
352
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -366,7 +378,7 @@ module Google
|
|
366
378
|
# Project ID for this request.
|
367
379
|
# @param security_policy [::String]
|
368
380
|
# Name of the security policy to which the queried rule belongs.
|
369
|
-
# @yield [result,
|
381
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
370
382
|
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPolicyRule]
|
371
383
|
# @yieldparam response [::Faraday::Response]
|
372
384
|
#
|
@@ -382,7 +394,7 @@ module Google
|
|
382
394
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
383
395
|
|
384
396
|
# Customize the options with defaults
|
385
|
-
call_metadata =
|
397
|
+
call_metadata = @config.rpcs.get_rule.metadata.to_h
|
386
398
|
|
387
399
|
# Set x-goog-api-client header
|
388
400
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -390,19 +402,16 @@ module Google
|
|
390
402
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
391
403
|
transports_version_send: [:rest]
|
392
404
|
|
393
|
-
options.apply_defaults timeout: @config.timeout,
|
405
|
+
options.apply_defaults timeout: @config.rpcs.get_rule.timeout,
|
394
406
|
metadata: call_metadata
|
395
407
|
|
396
|
-
|
397
|
-
|
398
|
-
uri: uri,
|
399
|
-
params: query_string_params,
|
400
|
-
options: options
|
401
|
-
)
|
402
|
-
result = ::Google::Cloud::Compute::V1::SecurityPolicyRule.decode_json response.body, ignore_unknown_fields: true
|
408
|
+
options.apply_defaults timeout: @config.timeout,
|
409
|
+
metadata: @config.metadata
|
403
410
|
|
404
|
-
|
405
|
-
|
411
|
+
@security_policies_stub.get_rule request, options do |result, response|
|
412
|
+
yield result, response if block_given?
|
413
|
+
return result
|
414
|
+
end
|
406
415
|
rescue ::Faraday::Error => e
|
407
416
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
408
417
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -431,18 +440,14 @@ module Google
|
|
431
440
|
# @param project [::String]
|
432
441
|
# Project ID for this request.
|
433
442
|
# @param request_id [::String]
|
434
|
-
# 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.
|
435
|
-
#
|
436
|
-
# 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.
|
437
|
-
#
|
438
|
-
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
443
|
+
# 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).
|
439
444
|
# @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
|
440
445
|
# The body resource for this request
|
441
|
-
# @yield [result,
|
442
|
-
# @yieldparam result [::
|
446
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
447
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
443
448
|
# @yieldparam response [::Faraday::Response]
|
444
449
|
#
|
445
|
-
# @return [::
|
450
|
+
# @return [::Gapic::Rest::BaseOperation]
|
446
451
|
#
|
447
452
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
448
453
|
def insert request, options = nil
|
@@ -454,7 +459,7 @@ module Google
|
|
454
459
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
455
460
|
|
456
461
|
# Customize the options with defaults
|
457
|
-
call_metadata =
|
462
|
+
call_metadata = @config.rpcs.insert.metadata.to_h
|
458
463
|
|
459
464
|
# Set x-goog-api-client header
|
460
465
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -462,20 +467,17 @@ module Google
|
|
462
467
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
463
468
|
transports_version_send: [:rest]
|
464
469
|
|
465
|
-
options.apply_defaults timeout: @config.timeout,
|
470
|
+
options.apply_defaults timeout: @config.rpcs.insert.timeout,
|
466
471
|
metadata: call_metadata
|
467
472
|
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
yield result, response if block_given?
|
478
|
-
result
|
473
|
+
options.apply_defaults timeout: @config.timeout,
|
474
|
+
metadata: @config.metadata
|
475
|
+
|
476
|
+
@security_policies_stub.insert request, options do |result, response|
|
477
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
478
|
+
yield result, response if block_given?
|
479
|
+
return result
|
480
|
+
end
|
479
481
|
rescue ::Faraday::Error => e
|
480
482
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
481
483
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -502,32 +504,22 @@ module Google
|
|
502
504
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
503
505
|
#
|
504
506
|
# @param filter [::String]
|
505
|
-
# A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
|
506
|
-
#
|
507
|
-
# For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
|
508
|
-
#
|
509
|
-
# 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.
|
510
|
-
#
|
511
|
-
# 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) ```
|
507
|
+
# A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
|
512
508
|
# @param max_results [::Integer]
|
513
509
|
# 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`)
|
514
510
|
# @param order_by [::String]
|
515
|
-
# Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
|
516
|
-
#
|
517
|
-
# 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.
|
518
|
-
#
|
519
|
-
# Currently, only sorting by `name` or `creationTimestamp desc` is supported.
|
511
|
+
# 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.
|
520
512
|
# @param page_token [::String]
|
521
513
|
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
|
522
514
|
# @param project [::String]
|
523
515
|
# Project ID for this request.
|
524
516
|
# @param return_partial_success [::Boolean]
|
525
|
-
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false
|
526
|
-
# @yield [result,
|
527
|
-
# @yieldparam result [::Google::Cloud::Compute::V1::
|
517
|
+
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
518
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
519
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SecurityPolicy>]
|
528
520
|
# @yieldparam response [::Faraday::Response]
|
529
521
|
#
|
530
|
-
# @return [::Google::Cloud::Compute::V1::
|
522
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::SecurityPolicy>]
|
531
523
|
#
|
532
524
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
533
525
|
def list request, options = nil
|
@@ -539,7 +531,7 @@ module Google
|
|
539
531
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
540
532
|
|
541
533
|
# Customize the options with defaults
|
542
|
-
call_metadata =
|
534
|
+
call_metadata = @config.rpcs.list.metadata.to_h
|
543
535
|
|
544
536
|
# Set x-goog-api-client header
|
545
537
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -547,19 +539,17 @@ module Google
|
|
547
539
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
548
540
|
transports_version_send: [:rest]
|
549
541
|
|
550
|
-
options.apply_defaults timeout: @config.timeout,
|
542
|
+
options.apply_defaults timeout: @config.rpcs.list.timeout,
|
551
543
|
metadata: call_metadata
|
552
544
|
|
553
|
-
|
554
|
-
|
555
|
-
uri: uri,
|
556
|
-
params: query_string_params,
|
557
|
-
options: options
|
558
|
-
)
|
559
|
-
result = ::Google::Cloud::Compute::V1::SecurityPolicyList.decode_json response.body, ignore_unknown_fields: true
|
545
|
+
options.apply_defaults timeout: @config.timeout,
|
546
|
+
metadata: @config.metadata
|
560
547
|
|
561
|
-
|
562
|
-
|
548
|
+
@security_policies_stub.list request, options do |result, response|
|
549
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_policies_stub, :list, "items", request, result, options
|
550
|
+
yield result, response if block_given?
|
551
|
+
return result
|
552
|
+
end
|
563
553
|
rescue ::Faraday::Error => e
|
564
554
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
565
555
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -586,28 +576,18 @@ module Google
|
|
586
576
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
587
577
|
#
|
588
578
|
# @param filter [::String]
|
589
|
-
# A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`.
|
590
|
-
#
|
591
|
-
# For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
|
592
|
-
#
|
593
|
-
# 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.
|
594
|
-
#
|
595
|
-
# 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) ```
|
579
|
+
# A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison 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`. 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) ```
|
596
580
|
# @param max_results [::Integer]
|
597
581
|
# The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
|
598
582
|
# @param order_by [::String]
|
599
|
-
# Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
|
600
|
-
#
|
601
|
-
# 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.
|
602
|
-
#
|
603
|
-
# Currently, only sorting by `name` or `creationTimestamp desc` is supported.
|
583
|
+
# 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.
|
604
584
|
# @param page_token [::String]
|
605
585
|
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
|
606
586
|
# @param project [::String]
|
607
587
|
# Project ID for this request.
|
608
588
|
# @param return_partial_success [::Boolean]
|
609
|
-
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false
|
610
|
-
# @yield [result,
|
589
|
+
# Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
|
590
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
611
591
|
# @yieldparam result [::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse]
|
612
592
|
# @yieldparam response [::Faraday::Response]
|
613
593
|
#
|
@@ -623,7 +603,7 @@ module Google
|
|
623
603
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
624
604
|
|
625
605
|
# Customize the options with defaults
|
626
|
-
call_metadata =
|
606
|
+
call_metadata = @config.rpcs.list_preconfigured_expression_sets.metadata.to_h
|
627
607
|
|
628
608
|
# Set x-goog-api-client header
|
629
609
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -631,19 +611,16 @@ module Google
|
|
631
611
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
632
612
|
transports_version_send: [:rest]
|
633
613
|
|
634
|
-
options.apply_defaults timeout: @config.timeout,
|
614
|
+
options.apply_defaults timeout: @config.rpcs.list_preconfigured_expression_sets.timeout,
|
635
615
|
metadata: call_metadata
|
636
616
|
|
637
|
-
|
638
|
-
|
639
|
-
uri: uri,
|
640
|
-
params: query_string_params,
|
641
|
-
options: options
|
642
|
-
)
|
643
|
-
result = ::Google::Cloud::Compute::V1::SecurityPoliciesListPreconfiguredExpressionSetsResponse.decode_json response.body, ignore_unknown_fields: true
|
617
|
+
options.apply_defaults timeout: @config.timeout,
|
618
|
+
metadata: @config.metadata
|
644
619
|
|
645
|
-
|
646
|
-
|
620
|
+
@security_policies_stub.list_preconfigured_expression_sets request, options do |result, response|
|
621
|
+
yield result, response if block_given?
|
622
|
+
return result
|
623
|
+
end
|
647
624
|
rescue ::Faraday::Error => e
|
648
625
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
649
626
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -672,20 +649,16 @@ module Google
|
|
672
649
|
# @param project [::String]
|
673
650
|
# Project ID for this request.
|
674
651
|
# @param request_id [::String]
|
675
|
-
# 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.
|
676
|
-
#
|
677
|
-
# 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.
|
678
|
-
#
|
679
|
-
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
|
652
|
+
# 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).
|
680
653
|
# @param security_policy [::String]
|
681
654
|
# Name of the security policy to update.
|
682
655
|
# @param security_policy_resource [::Google::Cloud::Compute::V1::SecurityPolicy, ::Hash]
|
683
656
|
# The body resource for this request
|
684
|
-
# @yield [result,
|
685
|
-
# @yieldparam result [::
|
657
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
658
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
686
659
|
# @yieldparam response [::Faraday::Response]
|
687
660
|
#
|
688
|
-
# @return [::
|
661
|
+
# @return [::Gapic::Rest::BaseOperation]
|
689
662
|
#
|
690
663
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
691
664
|
def patch request, options = nil
|
@@ -697,7 +670,7 @@ module Google
|
|
697
670
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
698
671
|
|
699
672
|
# Customize the options with defaults
|
700
|
-
call_metadata =
|
673
|
+
call_metadata = @config.rpcs.patch.metadata.to_h
|
701
674
|
|
702
675
|
# Set x-goog-api-client header
|
703
676
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -705,20 +678,17 @@ module Google
|
|
705
678
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
706
679
|
transports_version_send: [:rest]
|
707
680
|
|
708
|
-
options.apply_defaults timeout: @config.timeout,
|
681
|
+
options.apply_defaults timeout: @config.rpcs.patch.timeout,
|
709
682
|
metadata: call_metadata
|
710
683
|
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
yield result, response if block_given?
|
721
|
-
result
|
684
|
+
options.apply_defaults timeout: @config.timeout,
|
685
|
+
metadata: @config.metadata
|
686
|
+
|
687
|
+
@security_policies_stub.patch request, options do |result, response|
|
688
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
689
|
+
yield result, response if block_given?
|
690
|
+
return result
|
691
|
+
end
|
722
692
|
rescue ::Faraday::Error => e
|
723
693
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
724
694
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -752,11 +722,11 @@ module Google
|
|
752
722
|
# Name of the security policy to update.
|
753
723
|
# @param security_policy_rule_resource [::Google::Cloud::Compute::V1::SecurityPolicyRule, ::Hash]
|
754
724
|
# The body resource for this request
|
755
|
-
# @yield [result,
|
756
|
-
# @yieldparam result [::
|
725
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
726
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
757
727
|
# @yieldparam response [::Faraday::Response]
|
758
728
|
#
|
759
|
-
# @return [::
|
729
|
+
# @return [::Gapic::Rest::BaseOperation]
|
760
730
|
#
|
761
731
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
762
732
|
def patch_rule request, options = nil
|
@@ -768,7 +738,7 @@ module Google
|
|
768
738
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
769
739
|
|
770
740
|
# Customize the options with defaults
|
771
|
-
call_metadata =
|
741
|
+
call_metadata = @config.rpcs.patch_rule.metadata.to_h
|
772
742
|
|
773
743
|
# Set x-goog-api-client header
|
774
744
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -776,20 +746,17 @@ module Google
|
|
776
746
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
777
747
|
transports_version_send: [:rest]
|
778
748
|
|
779
|
-
options.apply_defaults timeout: @config.timeout,
|
749
|
+
options.apply_defaults timeout: @config.rpcs.patch_rule.timeout,
|
780
750
|
metadata: call_metadata
|
781
751
|
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
yield result, response if block_given?
|
792
|
-
result
|
752
|
+
options.apply_defaults timeout: @config.timeout,
|
753
|
+
metadata: @config.metadata
|
754
|
+
|
755
|
+
@security_policies_stub.patch_rule request, options do |result, response|
|
756
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
757
|
+
yield result, response if block_given?
|
758
|
+
return result
|
759
|
+
end
|
793
760
|
rescue ::Faraday::Error => e
|
794
761
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
795
762
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -821,11 +788,11 @@ module Google
|
|
821
788
|
# Project ID for this request.
|
822
789
|
# @param security_policy [::String]
|
823
790
|
# Name of the security policy to update.
|
824
|
-
# @yield [result,
|
825
|
-
# @yieldparam result [::
|
791
|
+
# @yield [result, response] Access the result along with the Faraday response object
|
792
|
+
# @yieldparam result [::Gapic::Rest::BaseOperation]
|
826
793
|
# @yieldparam response [::Faraday::Response]
|
827
794
|
#
|
828
|
-
# @return [::
|
795
|
+
# @return [::Gapic::Rest::BaseOperation]
|
829
796
|
#
|
830
797
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
831
798
|
def remove_rule request, options = nil
|
@@ -837,7 +804,7 @@ module Google
|
|
837
804
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
838
805
|
|
839
806
|
# Customize the options with defaults
|
840
|
-
call_metadata =
|
807
|
+
call_metadata = @config.rpcs.remove_rule.metadata.to_h
|
841
808
|
|
842
809
|
# Set x-goog-api-client header
|
843
810
|
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -845,19 +812,17 @@ module Google
|
|
845
812
|
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
|
846
813
|
transports_version_send: [:rest]
|
847
814
|
|
848
|
-
options.apply_defaults timeout: @config.timeout,
|
815
|
+
options.apply_defaults timeout: @config.rpcs.remove_rule.timeout,
|
849
816
|
metadata: call_metadata
|
850
817
|
|
851
|
-
|
852
|
-
|
853
|
-
uri: uri,
|
854
|
-
params: query_string_params,
|
855
|
-
options: options
|
856
|
-
)
|
857
|
-
result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
|
818
|
+
options.apply_defaults timeout: @config.timeout,
|
819
|
+
metadata: @config.metadata
|
858
820
|
|
859
|
-
|
860
|
-
|
821
|
+
@security_policies_stub.remove_rule request, options do |result, response|
|
822
|
+
result = ::Gapic::Rest::BaseOperation.new result
|
823
|
+
yield result, response if block_given?
|
824
|
+
return result
|
825
|
+
end
|
861
826
|
rescue ::Faraday::Error => e
|
862
827
|
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
|
863
828
|
raise ::Google::Cloud::Error.from_error(gapic_error)
|
@@ -912,6 +877,9 @@ module Google
|
|
912
877
|
# @!attribute [rw] timeout
|
913
878
|
# The call timeout in seconds.
|
914
879
|
# @return [::Numeric]
|
880
|
+
# @!attribute [rw] metadata
|
881
|
+
# Additional REST headers to be sent with the call.
|
882
|
+
# @return [::Hash{::Symbol=>::String}]
|
915
883
|
#
|
916
884
|
class Configuration
|
917
885
|
extend ::Gapic::Config
|
@@ -925,6 +893,7 @@ module Google
|
|
925
893
|
config_attr :lib_name, nil, ::String, nil
|
926
894
|
config_attr :lib_version, nil, ::String, nil
|
927
895
|
config_attr :timeout, nil, ::Numeric, nil
|
896
|
+
config_attr :metadata, nil, ::Hash, nil
|
928
897
|
|
929
898
|
# @private
|
930
899
|
def initialize parent_config = nil
|
@@ -932,6 +901,109 @@ module Google
|
|
932
901
|
|
933
902
|
yield self if block_given?
|
934
903
|
end
|
904
|
+
|
905
|
+
##
|
906
|
+
# Configurations for individual RPCs
|
907
|
+
# @return [Rpcs]
|
908
|
+
#
|
909
|
+
def rpcs
|
910
|
+
@rpcs ||= begin
|
911
|
+
parent_rpcs = nil
|
912
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
913
|
+
Rpcs.new parent_rpcs
|
914
|
+
end
|
915
|
+
end
|
916
|
+
|
917
|
+
##
|
918
|
+
# Configuration RPC class for the SecurityPolicies API.
|
919
|
+
#
|
920
|
+
# Includes fields providing the configuration for each RPC in this service.
|
921
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
922
|
+
# the following configuration fields:
|
923
|
+
#
|
924
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
925
|
+
#
|
926
|
+
# there is one other field (`retry_policy`) that can be set
|
927
|
+
# but is currently not supported for REST Gapic libraries.
|
928
|
+
#
|
929
|
+
class Rpcs
|
930
|
+
##
|
931
|
+
# RPC-specific configuration for `add_rule`
|
932
|
+
# @return [::Gapic::Config::Method]
|
933
|
+
#
|
934
|
+
attr_reader :add_rule
|
935
|
+
##
|
936
|
+
# RPC-specific configuration for `delete`
|
937
|
+
# @return [::Gapic::Config::Method]
|
938
|
+
#
|
939
|
+
attr_reader :delete
|
940
|
+
##
|
941
|
+
# RPC-specific configuration for `get`
|
942
|
+
# @return [::Gapic::Config::Method]
|
943
|
+
#
|
944
|
+
attr_reader :get
|
945
|
+
##
|
946
|
+
# RPC-specific configuration for `get_rule`
|
947
|
+
# @return [::Gapic::Config::Method]
|
948
|
+
#
|
949
|
+
attr_reader :get_rule
|
950
|
+
##
|
951
|
+
# RPC-specific configuration for `insert`
|
952
|
+
# @return [::Gapic::Config::Method]
|
953
|
+
#
|
954
|
+
attr_reader :insert
|
955
|
+
##
|
956
|
+
# RPC-specific configuration for `list`
|
957
|
+
# @return [::Gapic::Config::Method]
|
958
|
+
#
|
959
|
+
attr_reader :list
|
960
|
+
##
|
961
|
+
# RPC-specific configuration for `list_preconfigured_expression_sets`
|
962
|
+
# @return [::Gapic::Config::Method]
|
963
|
+
#
|
964
|
+
attr_reader :list_preconfigured_expression_sets
|
965
|
+
##
|
966
|
+
# RPC-specific configuration for `patch`
|
967
|
+
# @return [::Gapic::Config::Method]
|
968
|
+
#
|
969
|
+
attr_reader :patch
|
970
|
+
##
|
971
|
+
# RPC-specific configuration for `patch_rule`
|
972
|
+
# @return [::Gapic::Config::Method]
|
973
|
+
#
|
974
|
+
attr_reader :patch_rule
|
975
|
+
##
|
976
|
+
# RPC-specific configuration for `remove_rule`
|
977
|
+
# @return [::Gapic::Config::Method]
|
978
|
+
#
|
979
|
+
attr_reader :remove_rule
|
980
|
+
|
981
|
+
# @private
|
982
|
+
def initialize parent_rpcs = nil
|
983
|
+
add_rule_config = parent_rpcs.add_rule if parent_rpcs.respond_to? :add_rule
|
984
|
+
@add_rule = ::Gapic::Config::Method.new add_rule_config
|
985
|
+
delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
|
986
|
+
@delete = ::Gapic::Config::Method.new delete_config
|
987
|
+
get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
|
988
|
+
@get = ::Gapic::Config::Method.new get_config
|
989
|
+
get_rule_config = parent_rpcs.get_rule if parent_rpcs.respond_to? :get_rule
|
990
|
+
@get_rule = ::Gapic::Config::Method.new get_rule_config
|
991
|
+
insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
|
992
|
+
@insert = ::Gapic::Config::Method.new insert_config
|
993
|
+
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
|
994
|
+
@list = ::Gapic::Config::Method.new list_config
|
995
|
+
list_preconfigured_expression_sets_config = parent_rpcs.list_preconfigured_expression_sets if parent_rpcs.respond_to? :list_preconfigured_expression_sets
|
996
|
+
@list_preconfigured_expression_sets = ::Gapic::Config::Method.new list_preconfigured_expression_sets_config
|
997
|
+
patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
|
998
|
+
@patch = ::Gapic::Config::Method.new patch_config
|
999
|
+
patch_rule_config = parent_rpcs.patch_rule if parent_rpcs.respond_to? :patch_rule
|
1000
|
+
@patch_rule = ::Gapic::Config::Method.new patch_rule_config
|
1001
|
+
remove_rule_config = parent_rpcs.remove_rule if parent_rpcs.respond_to? :remove_rule
|
1002
|
+
@remove_rule = ::Gapic::Config::Method.new remove_rule_config
|
1003
|
+
|
1004
|
+
yield self if block_given?
|
1005
|
+
end
|
1006
|
+
end
|
935
1007
|
end
|
936
1008
|
end
|
937
1009
|
end
|