google-cloud-compute 1.27.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/cloud/compute/__init__.py +3451 -0
- google/cloud/compute/gapic_version.py +16 -0
- google/cloud/compute/py.typed +2 -0
- google/cloud/compute_v1/__init__.py +3333 -0
- google/cloud/compute_v1/gapic_metadata.json +4850 -0
- google/cloud/compute_v1/gapic_version.py +16 -0
- google/cloud/compute_v1/py.typed +2 -0
- google/cloud/compute_v1/services/__init__.py +15 -0
- google/cloud/compute_v1/services/accelerator_types/__init__.py +18 -0
- google/cloud/compute_v1/services/accelerator_types/client.py +1118 -0
- google/cloud/compute_v1/services/accelerator_types/pagers.py +196 -0
- google/cloud/compute_v1/services/accelerator_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/accelerator_types/transports/base.py +196 -0
- google/cloud/compute_v1/services/accelerator_types/transports/rest.py +822 -0
- google/cloud/compute_v1/services/accelerator_types/transports/rest_base.py +229 -0
- google/cloud/compute_v1/services/addresses/__init__.py +18 -0
- google/cloud/compute_v1/services/addresses/client.py +2327 -0
- google/cloud/compute_v1/services/addresses/pagers.py +196 -0
- google/cloud/compute_v1/services/addresses/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/addresses/transports/base.py +261 -0
- google/cloud/compute_v1/services/addresses/transports/rest.py +1700 -0
- google/cloud/compute_v1/services/addresses/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/autoscalers/__init__.py +18 -0
- google/cloud/compute_v1/services/autoscalers/client.py +2251 -0
- google/cloud/compute_v1/services/autoscalers/pagers.py +196 -0
- google/cloud/compute_v1/services/autoscalers/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/autoscalers/transports/base.py +265 -0
- google/cloud/compute_v1/services/autoscalers/transports/rest.py +1721 -0
- google/cloud/compute_v1/services/autoscalers/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/backend_buckets/__init__.py +18 -0
- google/cloud/compute_v1/services/backend_buckets/client.py +3402 -0
- google/cloud/compute_v1/services/backend_buckets/pagers.py +117 -0
- google/cloud/compute_v1/services/backend_buckets/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/backend_buckets/transports/base.py +334 -0
- google/cloud/compute_v1/services/backend_buckets/transports/rest.py +2918 -0
- google/cloud/compute_v1/services/backend_buckets/transports/rest_base.py +715 -0
- google/cloud/compute_v1/services/backend_services/__init__.py +18 -0
- google/cloud/compute_v1/services/backend_services/client.py +4133 -0
- google/cloud/compute_v1/services/backend_services/pagers.py +272 -0
- google/cloud/compute_v1/services/backend_services/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/backend_services/transports/base.py +399 -0
- google/cloud/compute_v1/services/backend_services/transports/rest.py +3846 -0
- google/cloud/compute_v1/services/backend_services/transports/rest_base.py +919 -0
- google/cloud/compute_v1/services/disk_types/__init__.py +18 -0
- google/cloud/compute_v1/services/disk_types/client.py +1104 -0
- google/cloud/compute_v1/services/disk_types/pagers.py +196 -0
- google/cloud/compute_v1/services/disk_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/disk_types/transports/base.py +195 -0
- google/cloud/compute_v1/services/disk_types/transports/rest.py +801 -0
- google/cloud/compute_v1/services/disk_types/transports/rest_base.py +229 -0
- google/cloud/compute_v1/services/disks/__init__.py +18 -0
- google/cloud/compute_v1/services/disks/client.py +5322 -0
- google/cloud/compute_v1/services/disks/pagers.py +196 -0
- google/cloud/compute_v1/services/disks/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/disks/transports/base.py +416 -0
- google/cloud/compute_v1/services/disks/transports/rest.py +4248 -0
- google/cloud/compute_v1/services/disks/transports/rest_base.py +1039 -0
- google/cloud/compute_v1/services/external_vpn_gateways/__init__.py +18 -0
- google/cloud/compute_v1/services/external_vpn_gateways/client.py +1940 -0
- google/cloud/compute_v1/services/external_vpn_gateways/pagers.py +117 -0
- google/cloud/compute_v1/services/external_vpn_gateways/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/external_vpn_gateways/transports/base.py +252 -0
- google/cloud/compute_v1/services/external_vpn_gateways/transports/rest.py +1534 -0
- google/cloud/compute_v1/services/external_vpn_gateways/transports/rest_base.py +397 -0
- google/cloud/compute_v1/services/firewall_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/firewall_policies/client.py +4186 -0
- google/cloud/compute_v1/services/firewall_policies/pagers.py +117 -0
- google/cloud/compute_v1/services/firewall_policies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/firewall_policies/transports/base.py +432 -0
- google/cloud/compute_v1/services/firewall_policies/transports/rest.py +4253 -0
- google/cloud/compute_v1/services/firewall_policies/transports/rest_base.py +963 -0
- google/cloud/compute_v1/services/firewalls/__init__.py +18 -0
- google/cloud/compute_v1/services/firewalls/client.py +2051 -0
- google/cloud/compute_v1/services/firewalls/pagers.py +117 -0
- google/cloud/compute_v1/services/firewalls/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/firewalls/transports/base.py +248 -0
- google/cloud/compute_v1/services/firewalls/transports/rest.py +1481 -0
- google/cloud/compute_v1/services/firewalls/transports/rest_base.py +397 -0
- google/cloud/compute_v1/services/forwarding_rules/__init__.py +18 -0
- google/cloud/compute_v1/services/forwarding_rules/client.py +2666 -0
- google/cloud/compute_v1/services/forwarding_rules/pagers.py +196 -0
- google/cloud/compute_v1/services/forwarding_rules/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/forwarding_rules/transports/base.py +279 -0
- google/cloud/compute_v1/services/forwarding_rules/transports/rest.py +1993 -0
- google/cloud/compute_v1/services/forwarding_rules/transports/rest_base.py +499 -0
- google/cloud/compute_v1/services/global_addresses/__init__.py +18 -0
- google/cloud/compute_v1/services/global_addresses/client.py +2081 -0
- google/cloud/compute_v1/services/global_addresses/pagers.py +117 -0
- google/cloud/compute_v1/services/global_addresses/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/global_addresses/transports/base.py +248 -0
- google/cloud/compute_v1/services/global_addresses/transports/rest.py +1525 -0
- google/cloud/compute_v1/services/global_addresses/transports/rest_base.py +397 -0
- google/cloud/compute_v1/services/global_forwarding_rules/__init__.py +18 -0
- google/cloud/compute_v1/services/global_forwarding_rules/client.py +2400 -0
- google/cloud/compute_v1/services/global_forwarding_rules/pagers.py +117 -0
- google/cloud/compute_v1/services/global_forwarding_rules/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/global_forwarding_rules/transports/base.py +262 -0
- google/cloud/compute_v1/services/global_forwarding_rules/transports/rest.py +1768 -0
- google/cloud/compute_v1/services/global_forwarding_rules/transports/rest_base.py +453 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/client.py +2321 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/pagers.py +195 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/transports/base.py +268 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest.py +1783 -0
- google/cloud/compute_v1/services/global_network_endpoint_groups/transports/rest_base.py +457 -0
- google/cloud/compute_v1/services/global_operations/__init__.py +18 -0
- google/cloud/compute_v1/services/global_operations/client.py +1373 -0
- google/cloud/compute_v1/services/global_operations/pagers.py +196 -0
- google/cloud/compute_v1/services/global_operations/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/global_operations/transports/base.py +225 -0
- google/cloud/compute_v1/services/global_operations/transports/rest.py +1270 -0
- google/cloud/compute_v1/services/global_operations/transports/rest_base.py +321 -0
- google/cloud/compute_v1/services/global_organization_operations/__init__.py +18 -0
- google/cloud/compute_v1/services/global_organization_operations/client.py +1064 -0
- google/cloud/compute_v1/services/global_organization_operations/pagers.py +117 -0
- google/cloud/compute_v1/services/global_organization_operations/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/global_organization_operations/transports/base.py +195 -0
- google/cloud/compute_v1/services/global_organization_operations/transports/rest.py +840 -0
- google/cloud/compute_v1/services/global_organization_operations/transports/rest_base.py +216 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/__init__.py +18 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/client.py +1840 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/pagers.py +117 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/base.py +237 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest.py +1317 -0
- google/cloud/compute_v1/services/global_public_delegated_prefixes/transports/rest_base.py +343 -0
- google/cloud/compute_v1/services/health_checks/__init__.py +18 -0
- google/cloud/compute_v1/services/health_checks/client.py +2200 -0
- google/cloud/compute_v1/services/health_checks/pagers.py +196 -0
- google/cloud/compute_v1/services/health_checks/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/health_checks/transports/base.py +265 -0
- google/cloud/compute_v1/services/health_checks/transports/rest.py +1736 -0
- google/cloud/compute_v1/services/health_checks/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/image_family_views/__init__.py +18 -0
- google/cloud/compute_v1/services/image_family_views/client.py +845 -0
- google/cloud/compute_v1/services/image_family_views/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/image_family_views/transports/base.py +165 -0
- google/cloud/compute_v1/services/image_family_views/transports/rest.py +384 -0
- google/cloud/compute_v1/services/image_family_views/transports/rest_base.py +137 -0
- google/cloud/compute_v1/services/images/__init__.py +18 -0
- google/cloud/compute_v1/services/images/client.py +2905 -0
- google/cloud/compute_v1/services/images/pagers.py +117 -0
- google/cloud/compute_v1/services/images/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/images/transports/base.py +319 -0
- google/cloud/compute_v1/services/images/transports/rest.py +2608 -0
- google/cloud/compute_v1/services/images/transports/rest_base.py +657 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/__init__.py +18 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/client.py +2079 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/pagers.py +117 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/transports/base.py +240 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/transports/rest.py +1329 -0
- google/cloud/compute_v1/services/instance_group_manager_resize_requests/transports/rest_base.py +341 -0
- google/cloud/compute_v1/services/instance_group_managers/__init__.py +18 -0
- google/cloud/compute_v1/services/instance_group_managers/client.py +7985 -0
- google/cloud/compute_v1/services/instance_group_managers/pagers.py +434 -0
- google/cloud/compute_v1/services/instance_group_managers/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/instance_group_managers/transports/base.py +515 -0
- google/cloud/compute_v1/services/instance_group_managers/transports/rest.py +5764 -0
- google/cloud/compute_v1/services/instance_group_managers/transports/rest_base.py +1373 -0
- google/cloud/compute_v1/services/instance_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/instance_groups/client.py +2899 -0
- google/cloud/compute_v1/services/instance_groups/pagers.py +272 -0
- google/cloud/compute_v1/services/instance_groups/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/instance_groups/transports/base.py +296 -0
- google/cloud/compute_v1/services/instance_groups/transports/rest.py +2204 -0
- google/cloud/compute_v1/services/instance_groups/transports/rest_base.py +555 -0
- google/cloud/compute_v1/services/instance_settings_service/__init__.py +18 -0
- google/cloud/compute_v1/services/instance_settings_service/client.py +1132 -0
- google/cloud/compute_v1/services/instance_settings_service/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/instance_settings_service/transports/base.py +192 -0
- google/cloud/compute_v1/services/instance_settings_service/transports/rest.py +622 -0
- google/cloud/compute_v1/services/instance_settings_service/transports/rest_base.py +193 -0
- google/cloud/compute_v1/services/instance_templates/__init__.py +18 -0
- google/cloud/compute_v1/services/instance_templates/client.py +2080 -0
- google/cloud/compute_v1/services/instance_templates/pagers.py +196 -0
- google/cloud/compute_v1/services/instance_templates/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/instance_templates/transports/base.py +281 -0
- google/cloud/compute_v1/services/instance_templates/transports/rest.py +1991 -0
- google/cloud/compute_v1/services/instance_templates/transports/rest_base.py +489 -0
- google/cloud/compute_v1/services/instances/__init__.py +18 -0
- google/cloud/compute_v1/services/instances/client.py +14145 -0
- google/cloud/compute_v1/services/instances/pagers.py +272 -0
- google/cloud/compute_v1/services/instances/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/instances/transports/base.py +863 -0
- google/cloud/compute_v1/services/instances/transports/rest.py +11363 -0
- google/cloud/compute_v1/services/instances/transports/rest_base.py +2623 -0
- google/cloud/compute_v1/services/instant_snapshots/__init__.py +18 -0
- google/cloud/compute_v1/services/instant_snapshots/client.py +2499 -0
- google/cloud/compute_v1/services/instant_snapshots/pagers.py +196 -0
- google/cloud/compute_v1/services/instant_snapshots/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/instant_snapshots/transports/base.py +295 -0
- google/cloud/compute_v1/services/instant_snapshots/transports/rest.py +2209 -0
- google/cloud/compute_v1/services/instant_snapshots/transports/rest_base.py +545 -0
- google/cloud/compute_v1/services/interconnect_attachments/__init__.py +18 -0
- google/cloud/compute_v1/services/interconnect_attachments/client.py +2388 -0
- google/cloud/compute_v1/services/interconnect_attachments/pagers.py +198 -0
- google/cloud/compute_v1/services/interconnect_attachments/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/interconnect_attachments/transports/base.py +270 -0
- google/cloud/compute_v1/services/interconnect_attachments/transports/rest.py +1763 -0
- google/cloud/compute_v1/services/interconnect_attachments/transports/rest_base.py +445 -0
- google/cloud/compute_v1/services/interconnect_locations/__init__.py +18 -0
- google/cloud/compute_v1/services/interconnect_locations/client.py +968 -0
- google/cloud/compute_v1/services/interconnect_locations/pagers.py +117 -0
- google/cloud/compute_v1/services/interconnect_locations/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/interconnect_locations/transports/base.py +182 -0
- google/cloud/compute_v1/services/interconnect_locations/transports/rest.py +613 -0
- google/cloud/compute_v1/services/interconnect_locations/transports/rest_base.py +183 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/__init__.py +18 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/client.py +979 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/pagers.py +117 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/transports/base.py +185 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/transports/rest.py +620 -0
- google/cloud/compute_v1/services/interconnect_remote_locations/transports/rest_base.py +185 -0
- google/cloud/compute_v1/services/interconnects/__init__.py +18 -0
- google/cloud/compute_v1/services/interconnects/client.py +2321 -0
- google/cloud/compute_v1/services/interconnects/pagers.py +117 -0
- google/cloud/compute_v1/services/interconnects/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/interconnects/transports/base.py +282 -0
- google/cloud/compute_v1/services/interconnects/transports/rest.py +1964 -0
- google/cloud/compute_v1/services/interconnects/transports/rest_base.py +489 -0
- google/cloud/compute_v1/services/license_codes/__init__.py +18 -0
- google/cloud/compute_v1/services/license_codes/client.py +968 -0
- google/cloud/compute_v1/services/license_codes/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/license_codes/transports/base.py +181 -0
- google/cloud/compute_v1/services/license_codes/transports/rest.py +606 -0
- google/cloud/compute_v1/services/license_codes/transports/rest_base.py +193 -0
- google/cloud/compute_v1/services/licenses/__init__.py +18 -0
- google/cloud/compute_v1/services/licenses/client.py +1931 -0
- google/cloud/compute_v1/services/licenses/pagers.py +117 -0
- google/cloud/compute_v1/services/licenses/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/licenses/transports/base.py +263 -0
- google/cloud/compute_v1/services/licenses/transports/rest.py +1726 -0
- google/cloud/compute_v1/services/licenses/transports/rest_base.py +447 -0
- google/cloud/compute_v1/services/machine_images/__init__.py +18 -0
- google/cloud/compute_v1/services/machine_images/client.py +1931 -0
- google/cloud/compute_v1/services/machine_images/pagers.py +117 -0
- google/cloud/compute_v1/services/machine_images/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/machine_images/transports/base.py +264 -0
- google/cloud/compute_v1/services/machine_images/transports/rest.py +1743 -0
- google/cloud/compute_v1/services/machine_images/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/machine_types/__init__.py +18 -0
- google/cloud/compute_v1/services/machine_types/client.py +1102 -0
- google/cloud/compute_v1/services/machine_types/pagers.py +196 -0
- google/cloud/compute_v1/services/machine_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/machine_types/transports/base.py +196 -0
- google/cloud/compute_v1/services/machine_types/transports/rest.py +806 -0
- google/cloud/compute_v1/services/machine_types/transports/rest_base.py +229 -0
- google/cloud/compute_v1/services/network_attachments/__init__.py +18 -0
- google/cloud/compute_v1/services/network_attachments/client.py +2501 -0
- google/cloud/compute_v1/services/network_attachments/pagers.py +196 -0
- google/cloud/compute_v1/services/network_attachments/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/network_attachments/transports/base.py +295 -0
- google/cloud/compute_v1/services/network_attachments/transports/rest.py +2223 -0
- google/cloud/compute_v1/services/network_attachments/transports/rest_base.py +545 -0
- google/cloud/compute_v1/services/network_edge_security_services/__init__.py +18 -0
- google/cloud/compute_v1/services/network_edge_security_services/client.py +1940 -0
- google/cloud/compute_v1/services/network_edge_security_services/pagers.py +124 -0
- google/cloud/compute_v1/services/network_edge_security_services/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/network_edge_security_services/transports/base.py +240 -0
- google/cloud/compute_v1/services/network_edge_security_services/transports/rest.py +1314 -0
- google/cloud/compute_v1/services/network_edge_security_services/transports/rest_base.py +345 -0
- google/cloud/compute_v1/services/network_endpoint_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/network_endpoint_groups/client.py +2747 -0
- google/cloud/compute_v1/services/network_endpoint_groups/pagers.py +274 -0
- google/cloud/compute_v1/services/network_endpoint_groups/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/network_endpoint_groups/transports/base.py +301 -0
- google/cloud/compute_v1/services/network_endpoint_groups/transports/rest.py +2228 -0
- google/cloud/compute_v1/services/network_endpoint_groups/transports/rest_base.py +563 -0
- google/cloud/compute_v1/services/network_firewall_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/network_firewall_policies/client.py +5356 -0
- google/cloud/compute_v1/services/network_firewall_policies/pagers.py +196 -0
- google/cloud/compute_v1/services/network_firewall_policies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/network_firewall_policies/transports/base.py +466 -0
- google/cloud/compute_v1/services/network_firewall_policies/transports/rest.py +4978 -0
- google/cloud/compute_v1/services/network_firewall_policies/transports/rest_base.py +1163 -0
- google/cloud/compute_v1/services/network_profiles/__init__.py +18 -0
- google/cloud/compute_v1/services/network_profiles/client.py +956 -0
- google/cloud/compute_v1/services/network_profiles/pagers.py +117 -0
- google/cloud/compute_v1/services/network_profiles/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/network_profiles/transports/base.py +182 -0
- google/cloud/compute_v1/services/network_profiles/transports/rest.py +602 -0
- google/cloud/compute_v1/services/network_profiles/transports/rest_base.py +183 -0
- google/cloud/compute_v1/services/networks/__init__.py +18 -0
- google/cloud/compute_v1/services/networks/client.py +3167 -0
- google/cloud/compute_v1/services/networks/pagers.py +193 -0
- google/cloud/compute_v1/services/networks/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/networks/transports/base.py +323 -0
- google/cloud/compute_v1/services/networks/transports/rest.py +2624 -0
- google/cloud/compute_v1/services/networks/transports/rest_base.py +647 -0
- google/cloud/compute_v1/services/node_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/node_groups/client.py +4307 -0
- google/cloud/compute_v1/services/node_groups/pagers.py +272 -0
- google/cloud/compute_v1/services/node_groups/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/node_groups/transports/base.py +378 -0
- google/cloud/compute_v1/services/node_groups/transports/rest.py +3568 -0
- google/cloud/compute_v1/services/node_groups/transports/rest_base.py +873 -0
- google/cloud/compute_v1/services/node_templates/__init__.py +18 -0
- google/cloud/compute_v1/services/node_templates/client.py +2174 -0
- google/cloud/compute_v1/services/node_templates/pagers.py +196 -0
- google/cloud/compute_v1/services/node_templates/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/node_templates/transports/base.py +281 -0
- google/cloud/compute_v1/services/node_templates/transports/rest.py +1957 -0
- google/cloud/compute_v1/services/node_templates/transports/rest_base.py +489 -0
- google/cloud/compute_v1/services/node_types/__init__.py +18 -0
- google/cloud/compute_v1/services/node_types/client.py +1103 -0
- google/cloud/compute_v1/services/node_types/pagers.py +196 -0
- google/cloud/compute_v1/services/node_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/node_types/transports/base.py +195 -0
- google/cloud/compute_v1/services/node_types/transports/rest.py +800 -0
- google/cloud/compute_v1/services/node_types/transports/rest_base.py +229 -0
- google/cloud/compute_v1/services/packet_mirrorings/__init__.py +18 -0
- google/cloud/compute_v1/services/packet_mirrorings/client.py +2172 -0
- google/cloud/compute_v1/services/packet_mirrorings/pagers.py +196 -0
- google/cloud/compute_v1/services/packet_mirrorings/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/packet_mirrorings/transports/base.py +267 -0
- google/cloud/compute_v1/services/packet_mirrorings/transports/rest.py +1750 -0
- google/cloud/compute_v1/services/packet_mirrorings/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/projects/__init__.py +18 -0
- google/cloud/compute_v1/services/projects/client.py +3790 -0
- google/cloud/compute_v1/services/projects/pagers.py +193 -0
- google/cloud/compute_v1/services/projects/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/projects/transports/base.py +361 -0
- google/cloud/compute_v1/services/projects/transports/rest.py +3368 -0
- google/cloud/compute_v1/services/projects/transports/rest_base.py +825 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/__init__.py +18 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/client.py +2376 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/pagers.py +117 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/transports/base.py +267 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest.py +1758 -0
- google/cloud/compute_v1/services/public_advertised_prefixes/transports/rest_base.py +433 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/__init__.py +18 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/client.py +2663 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/pagers.py +198 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/transports/base.py +282 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest.py +1982 -0
- google/cloud/compute_v1/services/public_delegated_prefixes/transports/rest_base.py +481 -0
- google/cloud/compute_v1/services/region_autoscalers/__init__.py +18 -0
- google/cloud/compute_v1/services/region_autoscalers/client.py +2159 -0
- google/cloud/compute_v1/services/region_autoscalers/pagers.py +117 -0
- google/cloud/compute_v1/services/region_autoscalers/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_autoscalers/transports/base.py +248 -0
- google/cloud/compute_v1/services/region_autoscalers/transports/rest.py +1546 -0
- google/cloud/compute_v1/services/region_autoscalers/transports/rest_base.py +397 -0
- google/cloud/compute_v1/services/region_backend_services/__init__.py +18 -0
- google/cloud/compute_v1/services/region_backend_services/client.py +3369 -0
- google/cloud/compute_v1/services/region_backend_services/pagers.py +193 -0
- google/cloud/compute_v1/services/region_backend_services/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_backend_services/transports/base.py +340 -0
- google/cloud/compute_v1/services/region_backend_services/transports/rest.py +2924 -0
- google/cloud/compute_v1/services/region_backend_services/transports/rest_base.py +717 -0
- google/cloud/compute_v1/services/region_commitments/__init__.py +18 -0
- google/cloud/compute_v1/services/region_commitments/client.py +1714 -0
- google/cloud/compute_v1/services/region_commitments/pagers.py +196 -0
- google/cloud/compute_v1/services/region_commitments/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_commitments/transports/base.py +237 -0
- google/cloud/compute_v1/services/region_commitments/transports/rest.py +1297 -0
- google/cloud/compute_v1/services/region_commitments/transports/rest_base.py +341 -0
- google/cloud/compute_v1/services/region_disk_types/__init__.py +18 -0
- google/cloud/compute_v1/services/region_disk_types/client.py +989 -0
- google/cloud/compute_v1/services/region_disk_types/pagers.py +117 -0
- google/cloud/compute_v1/services/region_disk_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_disk_types/transports/base.py +179 -0
- google/cloud/compute_v1/services/region_disk_types/transports/rest.py +603 -0
- google/cloud/compute_v1/services/region_disk_types/transports/rest_base.py +183 -0
- google/cloud/compute_v1/services/region_disks/__init__.py +18 -0
- google/cloud/compute_v1/services/region_disks/client.py +5220 -0
- google/cloud/compute_v1/services/region_disks/pagers.py +117 -0
- google/cloud/compute_v1/services/region_disks/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_disks/transports/base.py +403 -0
- google/cloud/compute_v1/services/region_disks/transports/rest.py +4080 -0
- google/cloud/compute_v1/services/region_disks/transports/rest_base.py +993 -0
- google/cloud/compute_v1/services/region_health_check_services/__init__.py +18 -0
- google/cloud/compute_v1/services/region_health_check_services/client.py +1928 -0
- google/cloud/compute_v1/services/region_health_check_services/pagers.py +117 -0
- google/cloud/compute_v1/services/region_health_check_services/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_health_check_services/transports/base.py +236 -0
- google/cloud/compute_v1/services/region_health_check_services/transports/rest.py +1299 -0
- google/cloud/compute_v1/services/region_health_check_services/transports/rest_base.py +341 -0
- google/cloud/compute_v1/services/region_health_checks/__init__.py +18 -0
- google/cloud/compute_v1/services/region_health_checks/client.py +2219 -0
- google/cloud/compute_v1/services/region_health_checks/pagers.py +117 -0
- google/cloud/compute_v1/services/region_health_checks/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/region_health_checks/transports/base.py +248 -0
- google/cloud/compute_v1/services/region_health_checks/transports/rest.py +1549 -0
- google/cloud/compute_v1/services/region_health_checks/transports/rest_base.py +397 -0
- google/cloud/compute_v1/services/region_instance_group_managers/__init__.py +18 -0
- google/cloud/compute_v1/services/region_instance_group_managers/client.py +7897 -0
- google/cloud/compute_v1/services/region_instance_group_managers/pagers.py +355 -0
- google/cloud/compute_v1/services/region_instance_group_managers/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py +498 -0
- google/cloud/compute_v1/services/region_instance_group_managers/transports/rest.py +5563 -0
- google/cloud/compute_v1/services/region_instance_group_managers/transports/rest_base.py +1359 -0
- google/cloud/compute_v1/services/region_instance_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/region_instance_groups/client.py +1508 -0
- google/cloud/compute_v1/services/region_instance_groups/pagers.py +193 -0
- google/cloud/compute_v1/services/region_instance_groups/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/region_instance_groups/transports/base.py +225 -0
- google/cloud/compute_v1/services/region_instance_groups/transports/rest.py +1075 -0
- google/cloud/compute_v1/services/region_instance_groups/transports/rest_base.py +295 -0
- google/cloud/compute_v1/services/region_instance_templates/__init__.py +18 -0
- google/cloud/compute_v1/services/region_instance_templates/client.py +1601 -0
- google/cloud/compute_v1/services/region_instance_templates/pagers.py +117 -0
- google/cloud/compute_v1/services/region_instance_templates/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_instance_templates/transports/base.py +220 -0
- google/cloud/compute_v1/services/region_instance_templates/transports/rest.py +1069 -0
- google/cloud/compute_v1/services/region_instance_templates/transports/rest_base.py +285 -0
- google/cloud/compute_v1/services/region_instances/__init__.py +18 -0
- google/cloud/compute_v1/services/region_instances/client.py +1009 -0
- google/cloud/compute_v1/services/region_instances/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_instances/transports/base.py +178 -0
- google/cloud/compute_v1/services/region_instances/transports/rest.py +407 -0
- google/cloud/compute_v1/services/region_instances/transports/rest_base.py +147 -0
- google/cloud/compute_v1/services/region_instant_snapshots/__init__.py +18 -0
- google/cloud/compute_v1/services/region_instant_snapshots/client.py +2417 -0
- google/cloud/compute_v1/services/region_instant_snapshots/pagers.py +117 -0
- google/cloud/compute_v1/services/region_instant_snapshots/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_instant_snapshots/transports/base.py +278 -0
- google/cloud/compute_v1/services/region_instant_snapshots/transports/rest.py +1992 -0
- google/cloud/compute_v1/services/region_instant_snapshots/transports/rest_base.py +501 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/__init__.py +18 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/client.py +2485 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/pagers.py +195 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/transports/base.py +268 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest.py +1783 -0
- google/cloud/compute_v1/services/region_network_endpoint_groups/transports/rest_base.py +457 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/client.py +4722 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/transports/base.py +412 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest.py +4076 -0
- google/cloud/compute_v1/services/region_network_firewall_policies/transports/rest_base.py +967 -0
- google/cloud/compute_v1/services/region_notification_endpoints/__init__.py +18 -0
- google/cloud/compute_v1/services/region_notification_endpoints/client.py +1602 -0
- google/cloud/compute_v1/services/region_notification_endpoints/pagers.py +117 -0
- google/cloud/compute_v1/services/region_notification_endpoints/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_notification_endpoints/transports/base.py +223 -0
- google/cloud/compute_v1/services/region_notification_endpoints/transports/rest.py +1074 -0
- google/cloud/compute_v1/services/region_notification_endpoints/transports/rest_base.py +287 -0
- google/cloud/compute_v1/services/region_operations/__init__.py +18 -0
- google/cloud/compute_v1/services/region_operations/client.py +1295 -0
- google/cloud/compute_v1/services/region_operations/pagers.py +117 -0
- google/cloud/compute_v1/services/region_operations/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_operations/transports/base.py +209 -0
- google/cloud/compute_v1/services/region_operations/transports/rest.py +1055 -0
- google/cloud/compute_v1/services/region_operations/transports/rest_base.py +275 -0
- google/cloud/compute_v1/services/region_security_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_security_policies/client.py +3331 -0
- google/cloud/compute_v1/services/region_security_policies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_security_policies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_security_policies/transports/base.py +304 -0
- google/cloud/compute_v1/services/region_security_policies/transports/rest.py +2438 -0
- google/cloud/compute_v1/services/region_security_policies/transports/rest_base.py +601 -0
- google/cloud/compute_v1/services/region_ssl_certificates/__init__.py +18 -0
- google/cloud/compute_v1/services/region_ssl_certificates/client.py +1609 -0
- google/cloud/compute_v1/services/region_ssl_certificates/pagers.py +117 -0
- google/cloud/compute_v1/services/region_ssl_certificates/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_ssl_certificates/transports/base.py +220 -0
- google/cloud/compute_v1/services/region_ssl_certificates/transports/rest.py +1077 -0
- google/cloud/compute_v1/services/region_ssl_certificates/transports/rest_base.py +285 -0
- google/cloud/compute_v1/services/region_ssl_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_ssl_policies/client.py +2026 -0
- google/cloud/compute_v1/services/region_ssl_policies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_ssl_policies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_ssl_policies/transports/base.py +251 -0
- google/cloud/compute_v1/services/region_ssl_policies/transports/rest.py +1528 -0
- google/cloud/compute_v1/services/region_ssl_policies/transports/rest_base.py +389 -0
- google/cloud/compute_v1/services/region_target_http_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_target_http_proxies/client.py +1931 -0
- google/cloud/compute_v1/services/region_target_http_proxies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_target_http_proxies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_target_http_proxies/transports/base.py +234 -0
- google/cloud/compute_v1/services/region_target_http_proxies/transports/rest.py +1304 -0
- google/cloud/compute_v1/services/region_target_http_proxies/transports/rest_base.py +341 -0
- google/cloud/compute_v1/services/region_target_https_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_target_https_proxies/client.py +2601 -0
- google/cloud/compute_v1/services/region_target_https_proxies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_target_https_proxies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py +262 -0
- google/cloud/compute_v1/services/region_target_https_proxies/transports/rest.py +1781 -0
- google/cloud/compute_v1/services/region_target_https_proxies/transports/rest_base.py +455 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/client.py +1594 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/pagers.py +117 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/transports/base.py +220 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/transports/rest.py +1065 -0
- google/cloud/compute_v1/services/region_target_tcp_proxies/transports/rest_base.py +285 -0
- google/cloud/compute_v1/services/region_url_maps/__init__.py +18 -0
- google/cloud/compute_v1/services/region_url_maps/client.py +2368 -0
- google/cloud/compute_v1/services/region_url_maps/pagers.py +117 -0
- google/cloud/compute_v1/services/region_url_maps/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_url_maps/transports/base.py +264 -0
- google/cloud/compute_v1/services/region_url_maps/transports/rest.py +1755 -0
- google/cloud/compute_v1/services/region_url_maps/transports/rest_base.py +453 -0
- google/cloud/compute_v1/services/region_zones/__init__.py +18 -0
- google/cloud/compute_v1/services/region_zones/client.py +840 -0
- google/cloud/compute_v1/services/region_zones/pagers.py +117 -0
- google/cloud/compute_v1/services/region_zones/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/region_zones/transports/base.py +165 -0
- google/cloud/compute_v1/services/region_zones/transports/rest.py +378 -0
- google/cloud/compute_v1/services/region_zones/transports/rest_base.py +137 -0
- google/cloud/compute_v1/services/regions/__init__.py +18 -0
- google/cloud/compute_v1/services/regions/client.py +980 -0
- google/cloud/compute_v1/services/regions/pagers.py +117 -0
- google/cloud/compute_v1/services/regions/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/regions/transports/base.py +178 -0
- google/cloud/compute_v1/services/regions/transports/rest.py +578 -0
- google/cloud/compute_v1/services/regions/transports/rest_base.py +183 -0
- google/cloud/compute_v1/services/reservations/__init__.py +18 -0
- google/cloud/compute_v1/services/reservations/client.py +2773 -0
- google/cloud/compute_v1/services/reservations/pagers.py +196 -0
- google/cloud/compute_v1/services/reservations/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/reservations/transports/base.py +309 -0
- google/cloud/compute_v1/services/reservations/transports/rest.py +2422 -0
- google/cloud/compute_v1/services/reservations/transports/rest_base.py +601 -0
- google/cloud/compute_v1/services/resource_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/resource_policies/client.py +2477 -0
- google/cloud/compute_v1/services/resource_policies/pagers.py +196 -0
- google/cloud/compute_v1/services/resource_policies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/resource_policies/transports/base.py +295 -0
- google/cloud/compute_v1/services/resource_policies/transports/rest.py +2214 -0
- google/cloud/compute_v1/services/resource_policies/transports/rest_base.py +545 -0
- google/cloud/compute_v1/services/routers/__init__.py +18 -0
- google/cloud/compute_v1/services/routers/client.py +4175 -0
- google/cloud/compute_v1/services/routers/pagers.py +424 -0
- google/cloud/compute_v1/services/routers/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/routers/transports/base.py +412 -0
- google/cloud/compute_v1/services/routers/transports/rest.py +3908 -0
- google/cloud/compute_v1/services/routers/transports/rest_base.py +933 -0
- google/cloud/compute_v1/services/routes/__init__.py +18 -0
- google/cloud/compute_v1/services/routes/client.py +1470 -0
- google/cloud/compute_v1/services/routes/pagers.py +117 -0
- google/cloud/compute_v1/services/routes/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/routes/transports/base.py +219 -0
- google/cloud/compute_v1/services/routes/transports/rest.py +1020 -0
- google/cloud/compute_v1/services/routes/transports/rest_base.py +285 -0
- google/cloud/compute_v1/services/security_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/security_policies/client.py +3291 -0
- google/cloud/compute_v1/services/security_policies/pagers.py +196 -0
- google/cloud/compute_v1/services/security_policies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/security_policies/transports/base.py +338 -0
- google/cloud/compute_v1/services/security_policies/transports/rest.py +2892 -0
- google/cloud/compute_v1/services/security_policies/transports/rest_base.py +697 -0
- google/cloud/compute_v1/services/service_attachments/__init__.py +18 -0
- google/cloud/compute_v1/services/service_attachments/client.py +2517 -0
- google/cloud/compute_v1/services/service_attachments/pagers.py +196 -0
- google/cloud/compute_v1/services/service_attachments/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/service_attachments/transports/base.py +295 -0
- google/cloud/compute_v1/services/service_attachments/transports/rest.py +2229 -0
- google/cloud/compute_v1/services/service_attachments/transports/rest_base.py +545 -0
- google/cloud/compute_v1/services/snapshot_settings_service/__init__.py +18 -0
- google/cloud/compute_v1/services/snapshot_settings_service/client.py +1078 -0
- google/cloud/compute_v1/services/snapshot_settings_service/transports/__init__.py +35 -0
- google/cloud/compute_v1/services/snapshot_settings_service/transports/base.py +192 -0
- google/cloud/compute_v1/services/snapshot_settings_service/transports/rest.py +615 -0
- google/cloud/compute_v1/services/snapshot_settings_service/transports/rest_base.py +193 -0
- google/cloud/compute_v1/services/snapshots/__init__.py +18 -0
- google/cloud/compute_v1/services/snapshots/client.py +2231 -0
- google/cloud/compute_v1/services/snapshots/pagers.py +117 -0
- google/cloud/compute_v1/services/snapshots/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/snapshots/transports/base.py +278 -0
- google/cloud/compute_v1/services/snapshots/transports/rest.py +1961 -0
- google/cloud/compute_v1/services/snapshots/transports/rest_base.py +499 -0
- google/cloud/compute_v1/services/ssl_certificates/__init__.py +18 -0
- google/cloud/compute_v1/services/ssl_certificates/client.py +1630 -0
- google/cloud/compute_v1/services/ssl_certificates/pagers.py +196 -0
- google/cloud/compute_v1/services/ssl_certificates/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/ssl_certificates/transports/base.py +237 -0
- google/cloud/compute_v1/services/ssl_certificates/transports/rest.py +1298 -0
- google/cloud/compute_v1/services/ssl_certificates/transports/rest_base.py +331 -0
- google/cloud/compute_v1/services/ssl_policies/__init__.py +18 -0
- google/cloud/compute_v1/services/ssl_policies/client.py +2010 -0
- google/cloud/compute_v1/services/ssl_policies/pagers.py +196 -0
- google/cloud/compute_v1/services/ssl_policies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/ssl_policies/transports/base.py +268 -0
- google/cloud/compute_v1/services/ssl_policies/transports/rest.py +1704 -0
- google/cloud/compute_v1/services/ssl_policies/transports/rest_base.py +433 -0
- google/cloud/compute_v1/services/storage_pool_types/__init__.py +18 -0
- google/cloud/compute_v1/services/storage_pool_types/client.py +1107 -0
- google/cloud/compute_v1/services/storage_pool_types/pagers.py +196 -0
- google/cloud/compute_v1/services/storage_pool_types/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/storage_pool_types/transports/base.py +196 -0
- google/cloud/compute_v1/services/storage_pool_types/transports/rest.py +814 -0
- google/cloud/compute_v1/services/storage_pool_types/transports/rest_base.py +229 -0
- google/cloud/compute_v1/services/storage_pools/__init__.py +18 -0
- google/cloud/compute_v1/services/storage_pools/client.py +2628 -0
- google/cloud/compute_v1/services/storage_pools/pagers.py +272 -0
- google/cloud/compute_v1/services/storage_pools/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/storage_pools/transports/base.py +309 -0
- google/cloud/compute_v1/services/storage_pools/transports/rest.py +2401 -0
- google/cloud/compute_v1/services/storage_pools/transports/rest_base.py +591 -0
- google/cloud/compute_v1/services/subnetworks/__init__.py +18 -0
- google/cloud/compute_v1/services/subnetworks/client.py +3285 -0
- google/cloud/compute_v1/services/subnetworks/pagers.py +272 -0
- google/cloud/compute_v1/services/subnetworks/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/subnetworks/transports/base.py +340 -0
- google/cloud/compute_v1/services/subnetworks/transports/rest.py +2883 -0
- google/cloud/compute_v1/services/subnetworks/transports/rest_base.py +703 -0
- google/cloud/compute_v1/services/target_grpc_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/target_grpc_proxies/client.py +1788 -0
- google/cloud/compute_v1/services/target_grpc_proxies/pagers.py +117 -0
- google/cloud/compute_v1/services/target_grpc_proxies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_grpc_proxies/transports/base.py +234 -0
- google/cloud/compute_v1/services/target_grpc_proxies/transports/rest.py +1306 -0
- google/cloud/compute_v1/services/target_grpc_proxies/transports/rest_base.py +341 -0
- google/cloud/compute_v1/services/target_http_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/target_http_proxies/client.py +2207 -0
- google/cloud/compute_v1/services/target_http_proxies/pagers.py +196 -0
- google/cloud/compute_v1/services/target_http_proxies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_http_proxies/transports/base.py +265 -0
- google/cloud/compute_v1/services/target_http_proxies/transports/rest.py +1765 -0
- google/cloud/compute_v1/services/target_http_proxies/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/target_https_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/target_https_proxies/client.py +3433 -0
- google/cloud/compute_v1/services/target_https_proxies/pagers.py +196 -0
- google/cloud/compute_v1/services/target_https_proxies/transports/__init__.py +32 -0
- google/cloud/compute_v1/services/target_https_proxies/transports/base.py +321 -0
- google/cloud/compute_v1/services/target_https_proxies/transports/rest.py +2716 -0
- google/cloud/compute_v1/services/target_https_proxies/transports/rest_base.py +667 -0
- google/cloud/compute_v1/services/target_instances/__init__.py +18 -0
- google/cloud/compute_v1/services/target_instances/client.py +2040 -0
- google/cloud/compute_v1/services/target_instances/pagers.py +196 -0
- google/cloud/compute_v1/services/target_instances/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_instances/transports/base.py +251 -0
- google/cloud/compute_v1/services/target_instances/transports/rest.py +1523 -0
- google/cloud/compute_v1/services/target_instances/transports/rest_base.py +387 -0
- google/cloud/compute_v1/services/target_pools/__init__.py +18 -0
- google/cloud/compute_v1/services/target_pools/client.py +3801 -0
- google/cloud/compute_v1/services/target_pools/pagers.py +196 -0
- google/cloud/compute_v1/services/target_pools/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_pools/transports/base.py +338 -0
- google/cloud/compute_v1/services/target_pools/transports/rest.py +2891 -0
- google/cloud/compute_v1/services/target_pools/transports/rest_base.py +723 -0
- google/cloud/compute_v1/services/target_ssl_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/target_ssl_proxies/client.py +3026 -0
- google/cloud/compute_v1/services/target_ssl_proxies/pagers.py +117 -0
- google/cloud/compute_v1/services/target_ssl_proxies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_ssl_proxies/transports/base.py +290 -0
- google/cloud/compute_v1/services/target_ssl_proxies/transports/rest.py +2247 -0
- google/cloud/compute_v1/services/target_ssl_proxies/transports/rest_base.py +565 -0
- google/cloud/compute_v1/services/target_tcp_proxies/__init__.py +18 -0
- google/cloud/compute_v1/services/target_tcp_proxies/client.py +2233 -0
- google/cloud/compute_v1/services/target_tcp_proxies/pagers.py +196 -0
- google/cloud/compute_v1/services/target_tcp_proxies/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_tcp_proxies/transports/base.py +265 -0
- google/cloud/compute_v1/services/target_tcp_proxies/transports/rest.py +1759 -0
- google/cloud/compute_v1/services/target_tcp_proxies/transports/rest_base.py +443 -0
- google/cloud/compute_v1/services/target_vpn_gateways/__init__.py +18 -0
- google/cloud/compute_v1/services/target_vpn_gateways/client.py +2016 -0
- google/cloud/compute_v1/services/target_vpn_gateways/pagers.py +196 -0
- google/cloud/compute_v1/services/target_vpn_gateways/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/target_vpn_gateways/transports/base.py +251 -0
- google/cloud/compute_v1/services/target_vpn_gateways/transports/rest.py +1520 -0
- google/cloud/compute_v1/services/target_vpn_gateways/transports/rest_base.py +387 -0
- google/cloud/compute_v1/services/url_maps/__init__.py +18 -0
- google/cloud/compute_v1/services/url_maps/client.py +2627 -0
- google/cloud/compute_v1/services/url_maps/pagers.py +196 -0
- google/cloud/compute_v1/services/url_maps/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/url_maps/transports/base.py +291 -0
- google/cloud/compute_v1/services/url_maps/transports/rest.py +2160 -0
- google/cloud/compute_v1/services/url_maps/transports/rest_base.py +555 -0
- google/cloud/compute_v1/services/vpn_gateways/__init__.py +18 -0
- google/cloud/compute_v1/services/vpn_gateways/client.py +2284 -0
- google/cloud/compute_v1/services/vpn_gateways/pagers.py +196 -0
- google/cloud/compute_v1/services/vpn_gateways/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/vpn_gateways/transports/base.py +284 -0
- google/cloud/compute_v1/services/vpn_gateways/transports/rest.py +1936 -0
- google/cloud/compute_v1/services/vpn_gateways/transports/rest_base.py +489 -0
- google/cloud/compute_v1/services/vpn_tunnels/__init__.py +18 -0
- google/cloud/compute_v1/services/vpn_tunnels/client.py +2001 -0
- google/cloud/compute_v1/services/vpn_tunnels/pagers.py +196 -0
- google/cloud/compute_v1/services/vpn_tunnels/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/vpn_tunnels/transports/base.py +250 -0
- google/cloud/compute_v1/services/vpn_tunnels/transports/rest.py +1479 -0
- google/cloud/compute_v1/services/vpn_tunnels/transports/rest_base.py +387 -0
- google/cloud/compute_v1/services/zone_operations/__init__.py +18 -0
- google/cloud/compute_v1/services/zone_operations/client.py +1291 -0
- google/cloud/compute_v1/services/zone_operations/pagers.py +117 -0
- google/cloud/compute_v1/services/zone_operations/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/zone_operations/transports/base.py +209 -0
- google/cloud/compute_v1/services/zone_operations/transports/rest.py +1051 -0
- google/cloud/compute_v1/services/zone_operations/transports/rest_base.py +275 -0
- google/cloud/compute_v1/services/zones/__init__.py +18 -0
- google/cloud/compute_v1/services/zones/client.py +949 -0
- google/cloud/compute_v1/services/zones/pagers.py +117 -0
- google/cloud/compute_v1/services/zones/transports/__init__.py +30 -0
- google/cloud/compute_v1/services/zones/transports/base.py +177 -0
- google/cloud/compute_v1/services/zones/transports/rest.py +578 -0
- google/cloud/compute_v1/services/zones/transports/rest_base.py +183 -0
- google/cloud/compute_v1/types/__init__.py +3124 -0
- google/cloud/compute_v1/types/compute.py +116433 -0
- google_cloud_compute-1.27.0.dist-info/LICENSE +202 -0
- google_cloud_compute-1.27.0.dist-info/METADATA +237 -0
- google_cloud_compute-1.27.0.dist-info/RECORD +703 -0
- google_cloud_compute-1.27.0.dist-info/WHEEL +5 -0
- google_cloud_compute-1.27.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2892 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2024 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import dataclasses
|
|
17
|
+
import json # type: ignore
|
|
18
|
+
import logging
|
|
19
|
+
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
|
|
20
|
+
import warnings
|
|
21
|
+
|
|
22
|
+
from google.api_core import exceptions as core_exceptions
|
|
23
|
+
from google.api_core import gapic_v1, rest_helpers, rest_streaming
|
|
24
|
+
from google.api_core import retry as retries
|
|
25
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
26
|
+
from google.auth.transport.requests import AuthorizedSession # type: ignore
|
|
27
|
+
from google.protobuf import json_format
|
|
28
|
+
from requests import __version__ as requests_version
|
|
29
|
+
|
|
30
|
+
from google.cloud.compute_v1.types import compute
|
|
31
|
+
|
|
32
|
+
from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO
|
|
33
|
+
from .rest_base import _BaseSecurityPoliciesRestTransport
|
|
34
|
+
|
|
35
|
+
try:
|
|
36
|
+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
|
|
37
|
+
except AttributeError: # pragma: NO COVER
|
|
38
|
+
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
from google.api_core import client_logging # type: ignore
|
|
42
|
+
|
|
43
|
+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
|
|
44
|
+
except ImportError: # pragma: NO COVER
|
|
45
|
+
CLIENT_LOGGING_SUPPORTED = False
|
|
46
|
+
|
|
47
|
+
_LOGGER = logging.getLogger(__name__)
|
|
48
|
+
|
|
49
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
50
|
+
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
|
|
51
|
+
grpc_version=None,
|
|
52
|
+
rest_version=f"requests@{requests_version}",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class SecurityPoliciesRestInterceptor:
|
|
57
|
+
"""Interceptor for SecurityPolicies.
|
|
58
|
+
|
|
59
|
+
Interceptors are used to manipulate requests, request metadata, and responses
|
|
60
|
+
in arbitrary ways.
|
|
61
|
+
Example use cases include:
|
|
62
|
+
* Logging
|
|
63
|
+
* Verifying requests according to service or custom semantics
|
|
64
|
+
* Stripping extraneous information from responses
|
|
65
|
+
|
|
66
|
+
These use cases and more can be enabled by injecting an
|
|
67
|
+
instance of a custom subclass when constructing the SecurityPoliciesRestTransport.
|
|
68
|
+
|
|
69
|
+
.. code-block:: python
|
|
70
|
+
class MyCustomSecurityPoliciesInterceptor(SecurityPoliciesRestInterceptor):
|
|
71
|
+
def pre_add_rule(self, request, metadata):
|
|
72
|
+
logging.log(f"Received request: {request}")
|
|
73
|
+
return request, metadata
|
|
74
|
+
|
|
75
|
+
def post_add_rule(self, response):
|
|
76
|
+
logging.log(f"Received response: {response}")
|
|
77
|
+
return response
|
|
78
|
+
|
|
79
|
+
def pre_aggregated_list(self, request, metadata):
|
|
80
|
+
logging.log(f"Received request: {request}")
|
|
81
|
+
return request, metadata
|
|
82
|
+
|
|
83
|
+
def post_aggregated_list(self, response):
|
|
84
|
+
logging.log(f"Received response: {response}")
|
|
85
|
+
return response
|
|
86
|
+
|
|
87
|
+
def pre_delete(self, request, metadata):
|
|
88
|
+
logging.log(f"Received request: {request}")
|
|
89
|
+
return request, metadata
|
|
90
|
+
|
|
91
|
+
def post_delete(self, response):
|
|
92
|
+
logging.log(f"Received response: {response}")
|
|
93
|
+
return response
|
|
94
|
+
|
|
95
|
+
def pre_get(self, request, metadata):
|
|
96
|
+
logging.log(f"Received request: {request}")
|
|
97
|
+
return request, metadata
|
|
98
|
+
|
|
99
|
+
def post_get(self, response):
|
|
100
|
+
logging.log(f"Received response: {response}")
|
|
101
|
+
return response
|
|
102
|
+
|
|
103
|
+
def pre_get_rule(self, request, metadata):
|
|
104
|
+
logging.log(f"Received request: {request}")
|
|
105
|
+
return request, metadata
|
|
106
|
+
|
|
107
|
+
def post_get_rule(self, response):
|
|
108
|
+
logging.log(f"Received response: {response}")
|
|
109
|
+
return response
|
|
110
|
+
|
|
111
|
+
def pre_insert(self, request, metadata):
|
|
112
|
+
logging.log(f"Received request: {request}")
|
|
113
|
+
return request, metadata
|
|
114
|
+
|
|
115
|
+
def post_insert(self, response):
|
|
116
|
+
logging.log(f"Received response: {response}")
|
|
117
|
+
return response
|
|
118
|
+
|
|
119
|
+
def pre_list(self, request, metadata):
|
|
120
|
+
logging.log(f"Received request: {request}")
|
|
121
|
+
return request, metadata
|
|
122
|
+
|
|
123
|
+
def post_list(self, response):
|
|
124
|
+
logging.log(f"Received response: {response}")
|
|
125
|
+
return response
|
|
126
|
+
|
|
127
|
+
def pre_list_preconfigured_expression_sets(self, request, metadata):
|
|
128
|
+
logging.log(f"Received request: {request}")
|
|
129
|
+
return request, metadata
|
|
130
|
+
|
|
131
|
+
def post_list_preconfigured_expression_sets(self, response):
|
|
132
|
+
logging.log(f"Received response: {response}")
|
|
133
|
+
return response
|
|
134
|
+
|
|
135
|
+
def pre_patch(self, request, metadata):
|
|
136
|
+
logging.log(f"Received request: {request}")
|
|
137
|
+
return request, metadata
|
|
138
|
+
|
|
139
|
+
def post_patch(self, response):
|
|
140
|
+
logging.log(f"Received response: {response}")
|
|
141
|
+
return response
|
|
142
|
+
|
|
143
|
+
def pre_patch_rule(self, request, metadata):
|
|
144
|
+
logging.log(f"Received request: {request}")
|
|
145
|
+
return request, metadata
|
|
146
|
+
|
|
147
|
+
def post_patch_rule(self, response):
|
|
148
|
+
logging.log(f"Received response: {response}")
|
|
149
|
+
return response
|
|
150
|
+
|
|
151
|
+
def pre_remove_rule(self, request, metadata):
|
|
152
|
+
logging.log(f"Received request: {request}")
|
|
153
|
+
return request, metadata
|
|
154
|
+
|
|
155
|
+
def post_remove_rule(self, response):
|
|
156
|
+
logging.log(f"Received response: {response}")
|
|
157
|
+
return response
|
|
158
|
+
|
|
159
|
+
def pre_set_labels(self, request, metadata):
|
|
160
|
+
logging.log(f"Received request: {request}")
|
|
161
|
+
return request, metadata
|
|
162
|
+
|
|
163
|
+
def post_set_labels(self, response):
|
|
164
|
+
logging.log(f"Received response: {response}")
|
|
165
|
+
return response
|
|
166
|
+
|
|
167
|
+
transport = SecurityPoliciesRestTransport(interceptor=MyCustomSecurityPoliciesInterceptor())
|
|
168
|
+
client = SecurityPoliciesClient(transport=transport)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
def pre_add_rule(
|
|
174
|
+
self,
|
|
175
|
+
request: compute.AddRuleSecurityPolicyRequest,
|
|
176
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
177
|
+
) -> Tuple[
|
|
178
|
+
compute.AddRuleSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
179
|
+
]:
|
|
180
|
+
"""Pre-rpc interceptor for add_rule
|
|
181
|
+
|
|
182
|
+
Override in a subclass to manipulate the request or metadata
|
|
183
|
+
before they are sent to the SecurityPolicies server.
|
|
184
|
+
"""
|
|
185
|
+
return request, metadata
|
|
186
|
+
|
|
187
|
+
def post_add_rule(self, response: compute.Operation) -> compute.Operation:
|
|
188
|
+
"""Post-rpc interceptor for add_rule
|
|
189
|
+
|
|
190
|
+
DEPRECATED. Please use the `post_add_rule_with_metadata`
|
|
191
|
+
interceptor instead.
|
|
192
|
+
|
|
193
|
+
Override in a subclass to read or manipulate the response
|
|
194
|
+
after it is returned by the SecurityPolicies server but before
|
|
195
|
+
it is returned to user code. This `post_add_rule` interceptor runs
|
|
196
|
+
before the `post_add_rule_with_metadata` interceptor.
|
|
197
|
+
"""
|
|
198
|
+
return response
|
|
199
|
+
|
|
200
|
+
def post_add_rule_with_metadata(
|
|
201
|
+
self,
|
|
202
|
+
response: compute.Operation,
|
|
203
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
204
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
205
|
+
"""Post-rpc interceptor for add_rule
|
|
206
|
+
|
|
207
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
208
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
209
|
+
|
|
210
|
+
We recommend only using this `post_add_rule_with_metadata`
|
|
211
|
+
interceptor in new development instead of the `post_add_rule` interceptor.
|
|
212
|
+
When both interceptors are used, this `post_add_rule_with_metadata` interceptor runs after the
|
|
213
|
+
`post_add_rule` interceptor. The (possibly modified) response returned by
|
|
214
|
+
`post_add_rule` will be passed to
|
|
215
|
+
`post_add_rule_with_metadata`.
|
|
216
|
+
"""
|
|
217
|
+
return response, metadata
|
|
218
|
+
|
|
219
|
+
def pre_aggregated_list(
|
|
220
|
+
self,
|
|
221
|
+
request: compute.AggregatedListSecurityPoliciesRequest,
|
|
222
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
223
|
+
) -> Tuple[
|
|
224
|
+
compute.AggregatedListSecurityPoliciesRequest,
|
|
225
|
+
Sequence[Tuple[str, Union[str, bytes]]],
|
|
226
|
+
]:
|
|
227
|
+
"""Pre-rpc interceptor for aggregated_list
|
|
228
|
+
|
|
229
|
+
Override in a subclass to manipulate the request or metadata
|
|
230
|
+
before they are sent to the SecurityPolicies server.
|
|
231
|
+
"""
|
|
232
|
+
return request, metadata
|
|
233
|
+
|
|
234
|
+
def post_aggregated_list(
|
|
235
|
+
self, response: compute.SecurityPoliciesAggregatedList
|
|
236
|
+
) -> compute.SecurityPoliciesAggregatedList:
|
|
237
|
+
"""Post-rpc interceptor for aggregated_list
|
|
238
|
+
|
|
239
|
+
DEPRECATED. Please use the `post_aggregated_list_with_metadata`
|
|
240
|
+
interceptor instead.
|
|
241
|
+
|
|
242
|
+
Override in a subclass to read or manipulate the response
|
|
243
|
+
after it is returned by the SecurityPolicies server but before
|
|
244
|
+
it is returned to user code. This `post_aggregated_list` interceptor runs
|
|
245
|
+
before the `post_aggregated_list_with_metadata` interceptor.
|
|
246
|
+
"""
|
|
247
|
+
return response
|
|
248
|
+
|
|
249
|
+
def post_aggregated_list_with_metadata(
|
|
250
|
+
self,
|
|
251
|
+
response: compute.SecurityPoliciesAggregatedList,
|
|
252
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
253
|
+
) -> Tuple[
|
|
254
|
+
compute.SecurityPoliciesAggregatedList, Sequence[Tuple[str, Union[str, bytes]]]
|
|
255
|
+
]:
|
|
256
|
+
"""Post-rpc interceptor for aggregated_list
|
|
257
|
+
|
|
258
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
259
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
260
|
+
|
|
261
|
+
We recommend only using this `post_aggregated_list_with_metadata`
|
|
262
|
+
interceptor in new development instead of the `post_aggregated_list` interceptor.
|
|
263
|
+
When both interceptors are used, this `post_aggregated_list_with_metadata` interceptor runs after the
|
|
264
|
+
`post_aggregated_list` interceptor. The (possibly modified) response returned by
|
|
265
|
+
`post_aggregated_list` will be passed to
|
|
266
|
+
`post_aggregated_list_with_metadata`.
|
|
267
|
+
"""
|
|
268
|
+
return response, metadata
|
|
269
|
+
|
|
270
|
+
def pre_delete(
|
|
271
|
+
self,
|
|
272
|
+
request: compute.DeleteSecurityPolicyRequest,
|
|
273
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
274
|
+
) -> Tuple[
|
|
275
|
+
compute.DeleteSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
276
|
+
]:
|
|
277
|
+
"""Pre-rpc interceptor for delete
|
|
278
|
+
|
|
279
|
+
Override in a subclass to manipulate the request or metadata
|
|
280
|
+
before they are sent to the SecurityPolicies server.
|
|
281
|
+
"""
|
|
282
|
+
return request, metadata
|
|
283
|
+
|
|
284
|
+
def post_delete(self, response: compute.Operation) -> compute.Operation:
|
|
285
|
+
"""Post-rpc interceptor for delete
|
|
286
|
+
|
|
287
|
+
DEPRECATED. Please use the `post_delete_with_metadata`
|
|
288
|
+
interceptor instead.
|
|
289
|
+
|
|
290
|
+
Override in a subclass to read or manipulate the response
|
|
291
|
+
after it is returned by the SecurityPolicies server but before
|
|
292
|
+
it is returned to user code. This `post_delete` interceptor runs
|
|
293
|
+
before the `post_delete_with_metadata` interceptor.
|
|
294
|
+
"""
|
|
295
|
+
return response
|
|
296
|
+
|
|
297
|
+
def post_delete_with_metadata(
|
|
298
|
+
self,
|
|
299
|
+
response: compute.Operation,
|
|
300
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
301
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
302
|
+
"""Post-rpc interceptor for delete
|
|
303
|
+
|
|
304
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
305
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
306
|
+
|
|
307
|
+
We recommend only using this `post_delete_with_metadata`
|
|
308
|
+
interceptor in new development instead of the `post_delete` interceptor.
|
|
309
|
+
When both interceptors are used, this `post_delete_with_metadata` interceptor runs after the
|
|
310
|
+
`post_delete` interceptor. The (possibly modified) response returned by
|
|
311
|
+
`post_delete` will be passed to
|
|
312
|
+
`post_delete_with_metadata`.
|
|
313
|
+
"""
|
|
314
|
+
return response, metadata
|
|
315
|
+
|
|
316
|
+
def pre_get(
|
|
317
|
+
self,
|
|
318
|
+
request: compute.GetSecurityPolicyRequest,
|
|
319
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
320
|
+
) -> Tuple[
|
|
321
|
+
compute.GetSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
322
|
+
]:
|
|
323
|
+
"""Pre-rpc interceptor for get
|
|
324
|
+
|
|
325
|
+
Override in a subclass to manipulate the request or metadata
|
|
326
|
+
before they are sent to the SecurityPolicies server.
|
|
327
|
+
"""
|
|
328
|
+
return request, metadata
|
|
329
|
+
|
|
330
|
+
def post_get(self, response: compute.SecurityPolicy) -> compute.SecurityPolicy:
|
|
331
|
+
"""Post-rpc interceptor for get
|
|
332
|
+
|
|
333
|
+
DEPRECATED. Please use the `post_get_with_metadata`
|
|
334
|
+
interceptor instead.
|
|
335
|
+
|
|
336
|
+
Override in a subclass to read or manipulate the response
|
|
337
|
+
after it is returned by the SecurityPolicies server but before
|
|
338
|
+
it is returned to user code. This `post_get` interceptor runs
|
|
339
|
+
before the `post_get_with_metadata` interceptor.
|
|
340
|
+
"""
|
|
341
|
+
return response
|
|
342
|
+
|
|
343
|
+
def post_get_with_metadata(
|
|
344
|
+
self,
|
|
345
|
+
response: compute.SecurityPolicy,
|
|
346
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
347
|
+
) -> Tuple[compute.SecurityPolicy, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
348
|
+
"""Post-rpc interceptor for get
|
|
349
|
+
|
|
350
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
351
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
352
|
+
|
|
353
|
+
We recommend only using this `post_get_with_metadata`
|
|
354
|
+
interceptor in new development instead of the `post_get` interceptor.
|
|
355
|
+
When both interceptors are used, this `post_get_with_metadata` interceptor runs after the
|
|
356
|
+
`post_get` interceptor. The (possibly modified) response returned by
|
|
357
|
+
`post_get` will be passed to
|
|
358
|
+
`post_get_with_metadata`.
|
|
359
|
+
"""
|
|
360
|
+
return response, metadata
|
|
361
|
+
|
|
362
|
+
def pre_get_rule(
|
|
363
|
+
self,
|
|
364
|
+
request: compute.GetRuleSecurityPolicyRequest,
|
|
365
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
366
|
+
) -> Tuple[
|
|
367
|
+
compute.GetRuleSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
368
|
+
]:
|
|
369
|
+
"""Pre-rpc interceptor for get_rule
|
|
370
|
+
|
|
371
|
+
Override in a subclass to manipulate the request or metadata
|
|
372
|
+
before they are sent to the SecurityPolicies server.
|
|
373
|
+
"""
|
|
374
|
+
return request, metadata
|
|
375
|
+
|
|
376
|
+
def post_get_rule(
|
|
377
|
+
self, response: compute.SecurityPolicyRule
|
|
378
|
+
) -> compute.SecurityPolicyRule:
|
|
379
|
+
"""Post-rpc interceptor for get_rule
|
|
380
|
+
|
|
381
|
+
DEPRECATED. Please use the `post_get_rule_with_metadata`
|
|
382
|
+
interceptor instead.
|
|
383
|
+
|
|
384
|
+
Override in a subclass to read or manipulate the response
|
|
385
|
+
after it is returned by the SecurityPolicies server but before
|
|
386
|
+
it is returned to user code. This `post_get_rule` interceptor runs
|
|
387
|
+
before the `post_get_rule_with_metadata` interceptor.
|
|
388
|
+
"""
|
|
389
|
+
return response
|
|
390
|
+
|
|
391
|
+
def post_get_rule_with_metadata(
|
|
392
|
+
self,
|
|
393
|
+
response: compute.SecurityPolicyRule,
|
|
394
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
395
|
+
) -> Tuple[compute.SecurityPolicyRule, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
396
|
+
"""Post-rpc interceptor for get_rule
|
|
397
|
+
|
|
398
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
399
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
400
|
+
|
|
401
|
+
We recommend only using this `post_get_rule_with_metadata`
|
|
402
|
+
interceptor in new development instead of the `post_get_rule` interceptor.
|
|
403
|
+
When both interceptors are used, this `post_get_rule_with_metadata` interceptor runs after the
|
|
404
|
+
`post_get_rule` interceptor. The (possibly modified) response returned by
|
|
405
|
+
`post_get_rule` will be passed to
|
|
406
|
+
`post_get_rule_with_metadata`.
|
|
407
|
+
"""
|
|
408
|
+
return response, metadata
|
|
409
|
+
|
|
410
|
+
def pre_insert(
|
|
411
|
+
self,
|
|
412
|
+
request: compute.InsertSecurityPolicyRequest,
|
|
413
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
414
|
+
) -> Tuple[
|
|
415
|
+
compute.InsertSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
416
|
+
]:
|
|
417
|
+
"""Pre-rpc interceptor for insert
|
|
418
|
+
|
|
419
|
+
Override in a subclass to manipulate the request or metadata
|
|
420
|
+
before they are sent to the SecurityPolicies server.
|
|
421
|
+
"""
|
|
422
|
+
return request, metadata
|
|
423
|
+
|
|
424
|
+
def post_insert(self, response: compute.Operation) -> compute.Operation:
|
|
425
|
+
"""Post-rpc interceptor for insert
|
|
426
|
+
|
|
427
|
+
DEPRECATED. Please use the `post_insert_with_metadata`
|
|
428
|
+
interceptor instead.
|
|
429
|
+
|
|
430
|
+
Override in a subclass to read or manipulate the response
|
|
431
|
+
after it is returned by the SecurityPolicies server but before
|
|
432
|
+
it is returned to user code. This `post_insert` interceptor runs
|
|
433
|
+
before the `post_insert_with_metadata` interceptor.
|
|
434
|
+
"""
|
|
435
|
+
return response
|
|
436
|
+
|
|
437
|
+
def post_insert_with_metadata(
|
|
438
|
+
self,
|
|
439
|
+
response: compute.Operation,
|
|
440
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
441
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
442
|
+
"""Post-rpc interceptor for insert
|
|
443
|
+
|
|
444
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
445
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
446
|
+
|
|
447
|
+
We recommend only using this `post_insert_with_metadata`
|
|
448
|
+
interceptor in new development instead of the `post_insert` interceptor.
|
|
449
|
+
When both interceptors are used, this `post_insert_with_metadata` interceptor runs after the
|
|
450
|
+
`post_insert` interceptor. The (possibly modified) response returned by
|
|
451
|
+
`post_insert` will be passed to
|
|
452
|
+
`post_insert_with_metadata`.
|
|
453
|
+
"""
|
|
454
|
+
return response, metadata
|
|
455
|
+
|
|
456
|
+
def pre_list(
|
|
457
|
+
self,
|
|
458
|
+
request: compute.ListSecurityPoliciesRequest,
|
|
459
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
460
|
+
) -> Tuple[
|
|
461
|
+
compute.ListSecurityPoliciesRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
462
|
+
]:
|
|
463
|
+
"""Pre-rpc interceptor for list
|
|
464
|
+
|
|
465
|
+
Override in a subclass to manipulate the request or metadata
|
|
466
|
+
before they are sent to the SecurityPolicies server.
|
|
467
|
+
"""
|
|
468
|
+
return request, metadata
|
|
469
|
+
|
|
470
|
+
def post_list(
|
|
471
|
+
self, response: compute.SecurityPolicyList
|
|
472
|
+
) -> compute.SecurityPolicyList:
|
|
473
|
+
"""Post-rpc interceptor for list
|
|
474
|
+
|
|
475
|
+
DEPRECATED. Please use the `post_list_with_metadata`
|
|
476
|
+
interceptor instead.
|
|
477
|
+
|
|
478
|
+
Override in a subclass to read or manipulate the response
|
|
479
|
+
after it is returned by the SecurityPolicies server but before
|
|
480
|
+
it is returned to user code. This `post_list` interceptor runs
|
|
481
|
+
before the `post_list_with_metadata` interceptor.
|
|
482
|
+
"""
|
|
483
|
+
return response
|
|
484
|
+
|
|
485
|
+
def post_list_with_metadata(
|
|
486
|
+
self,
|
|
487
|
+
response: compute.SecurityPolicyList,
|
|
488
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
489
|
+
) -> Tuple[compute.SecurityPolicyList, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
490
|
+
"""Post-rpc interceptor for list
|
|
491
|
+
|
|
492
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
493
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
494
|
+
|
|
495
|
+
We recommend only using this `post_list_with_metadata`
|
|
496
|
+
interceptor in new development instead of the `post_list` interceptor.
|
|
497
|
+
When both interceptors are used, this `post_list_with_metadata` interceptor runs after the
|
|
498
|
+
`post_list` interceptor. The (possibly modified) response returned by
|
|
499
|
+
`post_list` will be passed to
|
|
500
|
+
`post_list_with_metadata`.
|
|
501
|
+
"""
|
|
502
|
+
return response, metadata
|
|
503
|
+
|
|
504
|
+
def pre_list_preconfigured_expression_sets(
|
|
505
|
+
self,
|
|
506
|
+
request: compute.ListPreconfiguredExpressionSetsSecurityPoliciesRequest,
|
|
507
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
508
|
+
) -> Tuple[
|
|
509
|
+
compute.ListPreconfiguredExpressionSetsSecurityPoliciesRequest,
|
|
510
|
+
Sequence[Tuple[str, Union[str, bytes]]],
|
|
511
|
+
]:
|
|
512
|
+
"""Pre-rpc interceptor for list_preconfigured_expression_sets
|
|
513
|
+
|
|
514
|
+
Override in a subclass to manipulate the request or metadata
|
|
515
|
+
before they are sent to the SecurityPolicies server.
|
|
516
|
+
"""
|
|
517
|
+
return request, metadata
|
|
518
|
+
|
|
519
|
+
def post_list_preconfigured_expression_sets(
|
|
520
|
+
self, response: compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse
|
|
521
|
+
) -> compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse:
|
|
522
|
+
"""Post-rpc interceptor for list_preconfigured_expression_sets
|
|
523
|
+
|
|
524
|
+
DEPRECATED. Please use the `post_list_preconfigured_expression_sets_with_metadata`
|
|
525
|
+
interceptor instead.
|
|
526
|
+
|
|
527
|
+
Override in a subclass to read or manipulate the response
|
|
528
|
+
after it is returned by the SecurityPolicies server but before
|
|
529
|
+
it is returned to user code. This `post_list_preconfigured_expression_sets` interceptor runs
|
|
530
|
+
before the `post_list_preconfigured_expression_sets_with_metadata` interceptor.
|
|
531
|
+
"""
|
|
532
|
+
return response
|
|
533
|
+
|
|
534
|
+
def post_list_preconfigured_expression_sets_with_metadata(
|
|
535
|
+
self,
|
|
536
|
+
response: compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse,
|
|
537
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
538
|
+
) -> Tuple[
|
|
539
|
+
compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse,
|
|
540
|
+
Sequence[Tuple[str, Union[str, bytes]]],
|
|
541
|
+
]:
|
|
542
|
+
"""Post-rpc interceptor for list_preconfigured_expression_sets
|
|
543
|
+
|
|
544
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
545
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
546
|
+
|
|
547
|
+
We recommend only using this `post_list_preconfigured_expression_sets_with_metadata`
|
|
548
|
+
interceptor in new development instead of the `post_list_preconfigured_expression_sets` interceptor.
|
|
549
|
+
When both interceptors are used, this `post_list_preconfigured_expression_sets_with_metadata` interceptor runs after the
|
|
550
|
+
`post_list_preconfigured_expression_sets` interceptor. The (possibly modified) response returned by
|
|
551
|
+
`post_list_preconfigured_expression_sets` will be passed to
|
|
552
|
+
`post_list_preconfigured_expression_sets_with_metadata`.
|
|
553
|
+
"""
|
|
554
|
+
return response, metadata
|
|
555
|
+
|
|
556
|
+
def pre_patch(
|
|
557
|
+
self,
|
|
558
|
+
request: compute.PatchSecurityPolicyRequest,
|
|
559
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
560
|
+
) -> Tuple[
|
|
561
|
+
compute.PatchSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
562
|
+
]:
|
|
563
|
+
"""Pre-rpc interceptor for patch
|
|
564
|
+
|
|
565
|
+
Override in a subclass to manipulate the request or metadata
|
|
566
|
+
before they are sent to the SecurityPolicies server.
|
|
567
|
+
"""
|
|
568
|
+
return request, metadata
|
|
569
|
+
|
|
570
|
+
def post_patch(self, response: compute.Operation) -> compute.Operation:
|
|
571
|
+
"""Post-rpc interceptor for patch
|
|
572
|
+
|
|
573
|
+
DEPRECATED. Please use the `post_patch_with_metadata`
|
|
574
|
+
interceptor instead.
|
|
575
|
+
|
|
576
|
+
Override in a subclass to read or manipulate the response
|
|
577
|
+
after it is returned by the SecurityPolicies server but before
|
|
578
|
+
it is returned to user code. This `post_patch` interceptor runs
|
|
579
|
+
before the `post_patch_with_metadata` interceptor.
|
|
580
|
+
"""
|
|
581
|
+
return response
|
|
582
|
+
|
|
583
|
+
def post_patch_with_metadata(
|
|
584
|
+
self,
|
|
585
|
+
response: compute.Operation,
|
|
586
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
587
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
588
|
+
"""Post-rpc interceptor for patch
|
|
589
|
+
|
|
590
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
591
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
592
|
+
|
|
593
|
+
We recommend only using this `post_patch_with_metadata`
|
|
594
|
+
interceptor in new development instead of the `post_patch` interceptor.
|
|
595
|
+
When both interceptors are used, this `post_patch_with_metadata` interceptor runs after the
|
|
596
|
+
`post_patch` interceptor. The (possibly modified) response returned by
|
|
597
|
+
`post_patch` will be passed to
|
|
598
|
+
`post_patch_with_metadata`.
|
|
599
|
+
"""
|
|
600
|
+
return response, metadata
|
|
601
|
+
|
|
602
|
+
def pre_patch_rule(
|
|
603
|
+
self,
|
|
604
|
+
request: compute.PatchRuleSecurityPolicyRequest,
|
|
605
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
606
|
+
) -> Tuple[
|
|
607
|
+
compute.PatchRuleSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
608
|
+
]:
|
|
609
|
+
"""Pre-rpc interceptor for patch_rule
|
|
610
|
+
|
|
611
|
+
Override in a subclass to manipulate the request or metadata
|
|
612
|
+
before they are sent to the SecurityPolicies server.
|
|
613
|
+
"""
|
|
614
|
+
return request, metadata
|
|
615
|
+
|
|
616
|
+
def post_patch_rule(self, response: compute.Operation) -> compute.Operation:
|
|
617
|
+
"""Post-rpc interceptor for patch_rule
|
|
618
|
+
|
|
619
|
+
DEPRECATED. Please use the `post_patch_rule_with_metadata`
|
|
620
|
+
interceptor instead.
|
|
621
|
+
|
|
622
|
+
Override in a subclass to read or manipulate the response
|
|
623
|
+
after it is returned by the SecurityPolicies server but before
|
|
624
|
+
it is returned to user code. This `post_patch_rule` interceptor runs
|
|
625
|
+
before the `post_patch_rule_with_metadata` interceptor.
|
|
626
|
+
"""
|
|
627
|
+
return response
|
|
628
|
+
|
|
629
|
+
def post_patch_rule_with_metadata(
|
|
630
|
+
self,
|
|
631
|
+
response: compute.Operation,
|
|
632
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
633
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
634
|
+
"""Post-rpc interceptor for patch_rule
|
|
635
|
+
|
|
636
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
637
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
638
|
+
|
|
639
|
+
We recommend only using this `post_patch_rule_with_metadata`
|
|
640
|
+
interceptor in new development instead of the `post_patch_rule` interceptor.
|
|
641
|
+
When both interceptors are used, this `post_patch_rule_with_metadata` interceptor runs after the
|
|
642
|
+
`post_patch_rule` interceptor. The (possibly modified) response returned by
|
|
643
|
+
`post_patch_rule` will be passed to
|
|
644
|
+
`post_patch_rule_with_metadata`.
|
|
645
|
+
"""
|
|
646
|
+
return response, metadata
|
|
647
|
+
|
|
648
|
+
def pre_remove_rule(
|
|
649
|
+
self,
|
|
650
|
+
request: compute.RemoveRuleSecurityPolicyRequest,
|
|
651
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
652
|
+
) -> Tuple[
|
|
653
|
+
compute.RemoveRuleSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
654
|
+
]:
|
|
655
|
+
"""Pre-rpc interceptor for remove_rule
|
|
656
|
+
|
|
657
|
+
Override in a subclass to manipulate the request or metadata
|
|
658
|
+
before they are sent to the SecurityPolicies server.
|
|
659
|
+
"""
|
|
660
|
+
return request, metadata
|
|
661
|
+
|
|
662
|
+
def post_remove_rule(self, response: compute.Operation) -> compute.Operation:
|
|
663
|
+
"""Post-rpc interceptor for remove_rule
|
|
664
|
+
|
|
665
|
+
DEPRECATED. Please use the `post_remove_rule_with_metadata`
|
|
666
|
+
interceptor instead.
|
|
667
|
+
|
|
668
|
+
Override in a subclass to read or manipulate the response
|
|
669
|
+
after it is returned by the SecurityPolicies server but before
|
|
670
|
+
it is returned to user code. This `post_remove_rule` interceptor runs
|
|
671
|
+
before the `post_remove_rule_with_metadata` interceptor.
|
|
672
|
+
"""
|
|
673
|
+
return response
|
|
674
|
+
|
|
675
|
+
def post_remove_rule_with_metadata(
|
|
676
|
+
self,
|
|
677
|
+
response: compute.Operation,
|
|
678
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
679
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
680
|
+
"""Post-rpc interceptor for remove_rule
|
|
681
|
+
|
|
682
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
683
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
684
|
+
|
|
685
|
+
We recommend only using this `post_remove_rule_with_metadata`
|
|
686
|
+
interceptor in new development instead of the `post_remove_rule` interceptor.
|
|
687
|
+
When both interceptors are used, this `post_remove_rule_with_metadata` interceptor runs after the
|
|
688
|
+
`post_remove_rule` interceptor. The (possibly modified) response returned by
|
|
689
|
+
`post_remove_rule` will be passed to
|
|
690
|
+
`post_remove_rule_with_metadata`.
|
|
691
|
+
"""
|
|
692
|
+
return response, metadata
|
|
693
|
+
|
|
694
|
+
def pre_set_labels(
|
|
695
|
+
self,
|
|
696
|
+
request: compute.SetLabelsSecurityPolicyRequest,
|
|
697
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
698
|
+
) -> Tuple[
|
|
699
|
+
compute.SetLabelsSecurityPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]]
|
|
700
|
+
]:
|
|
701
|
+
"""Pre-rpc interceptor for set_labels
|
|
702
|
+
|
|
703
|
+
Override in a subclass to manipulate the request or metadata
|
|
704
|
+
before they are sent to the SecurityPolicies server.
|
|
705
|
+
"""
|
|
706
|
+
return request, metadata
|
|
707
|
+
|
|
708
|
+
def post_set_labels(self, response: compute.Operation) -> compute.Operation:
|
|
709
|
+
"""Post-rpc interceptor for set_labels
|
|
710
|
+
|
|
711
|
+
DEPRECATED. Please use the `post_set_labels_with_metadata`
|
|
712
|
+
interceptor instead.
|
|
713
|
+
|
|
714
|
+
Override in a subclass to read or manipulate the response
|
|
715
|
+
after it is returned by the SecurityPolicies server but before
|
|
716
|
+
it is returned to user code. This `post_set_labels` interceptor runs
|
|
717
|
+
before the `post_set_labels_with_metadata` interceptor.
|
|
718
|
+
"""
|
|
719
|
+
return response
|
|
720
|
+
|
|
721
|
+
def post_set_labels_with_metadata(
|
|
722
|
+
self,
|
|
723
|
+
response: compute.Operation,
|
|
724
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
725
|
+
) -> Tuple[compute.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
726
|
+
"""Post-rpc interceptor for set_labels
|
|
727
|
+
|
|
728
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
729
|
+
is returned by the SecurityPolicies server but before it is returned to user code.
|
|
730
|
+
|
|
731
|
+
We recommend only using this `post_set_labels_with_metadata`
|
|
732
|
+
interceptor in new development instead of the `post_set_labels` interceptor.
|
|
733
|
+
When both interceptors are used, this `post_set_labels_with_metadata` interceptor runs after the
|
|
734
|
+
`post_set_labels` interceptor. The (possibly modified) response returned by
|
|
735
|
+
`post_set_labels` will be passed to
|
|
736
|
+
`post_set_labels_with_metadata`.
|
|
737
|
+
"""
|
|
738
|
+
return response, metadata
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
@dataclasses.dataclass
|
|
742
|
+
class SecurityPoliciesRestStub:
|
|
743
|
+
_session: AuthorizedSession
|
|
744
|
+
_host: str
|
|
745
|
+
_interceptor: SecurityPoliciesRestInterceptor
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
class SecurityPoliciesRestTransport(_BaseSecurityPoliciesRestTransport):
|
|
749
|
+
"""REST backend synchronous transport for SecurityPolicies.
|
|
750
|
+
|
|
751
|
+
The SecurityPolicies API.
|
|
752
|
+
|
|
753
|
+
This class defines the same methods as the primary client, so the
|
|
754
|
+
primary client can load the underlying transport implementation
|
|
755
|
+
and call it.
|
|
756
|
+
|
|
757
|
+
It sends JSON representations of protocol buffers over HTTP/1.1
|
|
758
|
+
"""
|
|
759
|
+
|
|
760
|
+
def __init__(
|
|
761
|
+
self,
|
|
762
|
+
*,
|
|
763
|
+
host: str = "compute.googleapis.com",
|
|
764
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
765
|
+
credentials_file: Optional[str] = None,
|
|
766
|
+
scopes: Optional[Sequence[str]] = None,
|
|
767
|
+
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
|
|
768
|
+
quota_project_id: Optional[str] = None,
|
|
769
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
770
|
+
always_use_jwt_access: Optional[bool] = False,
|
|
771
|
+
url_scheme: str = "https",
|
|
772
|
+
interceptor: Optional[SecurityPoliciesRestInterceptor] = None,
|
|
773
|
+
api_audience: Optional[str] = None,
|
|
774
|
+
) -> None:
|
|
775
|
+
"""Instantiate the transport.
|
|
776
|
+
|
|
777
|
+
NOTE: This REST transport functionality is currently in a beta
|
|
778
|
+
state (preview). We welcome your feedback via a GitHub issue in
|
|
779
|
+
this library's repository. Thank you!
|
|
780
|
+
|
|
781
|
+
Args:
|
|
782
|
+
host (Optional[str]):
|
|
783
|
+
The hostname to connect to (default: 'compute.googleapis.com').
|
|
784
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
785
|
+
authorization credentials to attach to requests. These
|
|
786
|
+
credentials identify the application to the service; if none
|
|
787
|
+
are specified, the client will attempt to ascertain the
|
|
788
|
+
credentials from the environment.
|
|
789
|
+
|
|
790
|
+
credentials_file (Optional[str]): A file with credentials that can
|
|
791
|
+
be loaded with :func:`google.auth.load_credentials_from_file`.
|
|
792
|
+
This argument is ignored if ``channel`` is provided.
|
|
793
|
+
scopes (Optional(Sequence[str])): A list of scopes. This argument is
|
|
794
|
+
ignored if ``channel`` is provided.
|
|
795
|
+
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
|
|
796
|
+
certificate to configure mutual TLS HTTP channel. It is ignored
|
|
797
|
+
if ``channel`` is provided.
|
|
798
|
+
quota_project_id (Optional[str]): An optional project to use for billing
|
|
799
|
+
and quota.
|
|
800
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
801
|
+
The client info used to send a user-agent string along with
|
|
802
|
+
API requests. If ``None``, then default info will be used.
|
|
803
|
+
Generally, you only need to set this if you are developing
|
|
804
|
+
your own client library.
|
|
805
|
+
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
|
|
806
|
+
be used for service account credentials.
|
|
807
|
+
url_scheme: the protocol scheme for the API endpoint. Normally
|
|
808
|
+
"https", but for testing or local servers,
|
|
809
|
+
"http" can be specified.
|
|
810
|
+
"""
|
|
811
|
+
# Run the base constructor
|
|
812
|
+
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
|
|
813
|
+
# TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the
|
|
814
|
+
# credentials object
|
|
815
|
+
super().__init__(
|
|
816
|
+
host=host,
|
|
817
|
+
credentials=credentials,
|
|
818
|
+
client_info=client_info,
|
|
819
|
+
always_use_jwt_access=always_use_jwt_access,
|
|
820
|
+
url_scheme=url_scheme,
|
|
821
|
+
api_audience=api_audience,
|
|
822
|
+
)
|
|
823
|
+
self._session = AuthorizedSession(
|
|
824
|
+
self._credentials, default_host=self.DEFAULT_HOST
|
|
825
|
+
)
|
|
826
|
+
if client_cert_source_for_mtls:
|
|
827
|
+
self._session.configure_mtls_channel(client_cert_source_for_mtls)
|
|
828
|
+
self._interceptor = interceptor or SecurityPoliciesRestInterceptor()
|
|
829
|
+
self._prep_wrapped_messages(client_info)
|
|
830
|
+
|
|
831
|
+
class _AddRule(
|
|
832
|
+
_BaseSecurityPoliciesRestTransport._BaseAddRule, SecurityPoliciesRestStub
|
|
833
|
+
):
|
|
834
|
+
def __hash__(self):
|
|
835
|
+
return hash("SecurityPoliciesRestTransport.AddRule")
|
|
836
|
+
|
|
837
|
+
@staticmethod
|
|
838
|
+
def _get_response(
|
|
839
|
+
host,
|
|
840
|
+
metadata,
|
|
841
|
+
query_params,
|
|
842
|
+
session,
|
|
843
|
+
timeout,
|
|
844
|
+
transcoded_request,
|
|
845
|
+
body=None,
|
|
846
|
+
):
|
|
847
|
+
uri = transcoded_request["uri"]
|
|
848
|
+
method = transcoded_request["method"]
|
|
849
|
+
headers = dict(metadata)
|
|
850
|
+
headers["Content-Type"] = "application/json"
|
|
851
|
+
response = getattr(session, method)(
|
|
852
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
853
|
+
timeout=timeout,
|
|
854
|
+
headers=headers,
|
|
855
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
856
|
+
data=body,
|
|
857
|
+
)
|
|
858
|
+
return response
|
|
859
|
+
|
|
860
|
+
def __call__(
|
|
861
|
+
self,
|
|
862
|
+
request: compute.AddRuleSecurityPolicyRequest,
|
|
863
|
+
*,
|
|
864
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
865
|
+
timeout: Optional[float] = None,
|
|
866
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
867
|
+
) -> compute.Operation:
|
|
868
|
+
r"""Call the add rule method over HTTP.
|
|
869
|
+
|
|
870
|
+
Args:
|
|
871
|
+
request (~.compute.AddRuleSecurityPolicyRequest):
|
|
872
|
+
The request object. A request message for
|
|
873
|
+
SecurityPolicies.AddRule. See the method
|
|
874
|
+
description for details.
|
|
875
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
876
|
+
should be retried.
|
|
877
|
+
timeout (float): The timeout for this request.
|
|
878
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
879
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
880
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
881
|
+
be of type `bytes`.
|
|
882
|
+
|
|
883
|
+
Returns:
|
|
884
|
+
~.compute.Operation:
|
|
885
|
+
Represents an Operation resource. Google Compute Engine
|
|
886
|
+
has three Operation resources: \*
|
|
887
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
888
|
+
\*
|
|
889
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
890
|
+
\*
|
|
891
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
892
|
+
You can use an operation resource to manage asynchronous
|
|
893
|
+
API requests. For more information, read Handling API
|
|
894
|
+
responses. Operations can be global, regional or zonal.
|
|
895
|
+
- For global operations, use the ``globalOperations``
|
|
896
|
+
resource. - For regional operations, use the
|
|
897
|
+
``regionOperations`` resource. - For zonal operations,
|
|
898
|
+
use the ``zoneOperations`` resource. For more
|
|
899
|
+
information, read Global, Regional, and Zonal Resources.
|
|
900
|
+
Note that completed Operation resources have a limited
|
|
901
|
+
retention period.
|
|
902
|
+
|
|
903
|
+
"""
|
|
904
|
+
|
|
905
|
+
http_options = (
|
|
906
|
+
_BaseSecurityPoliciesRestTransport._BaseAddRule._get_http_options()
|
|
907
|
+
)
|
|
908
|
+
|
|
909
|
+
request, metadata = self._interceptor.pre_add_rule(request, metadata)
|
|
910
|
+
transcoded_request = (
|
|
911
|
+
_BaseSecurityPoliciesRestTransport._BaseAddRule._get_transcoded_request(
|
|
912
|
+
http_options, request
|
|
913
|
+
)
|
|
914
|
+
)
|
|
915
|
+
|
|
916
|
+
body = (
|
|
917
|
+
_BaseSecurityPoliciesRestTransport._BaseAddRule._get_request_body_json(
|
|
918
|
+
transcoded_request
|
|
919
|
+
)
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
# Jsonify the query params
|
|
923
|
+
query_params = (
|
|
924
|
+
_BaseSecurityPoliciesRestTransport._BaseAddRule._get_query_params_json(
|
|
925
|
+
transcoded_request
|
|
926
|
+
)
|
|
927
|
+
)
|
|
928
|
+
|
|
929
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
930
|
+
logging.DEBUG
|
|
931
|
+
): # pragma: NO COVER
|
|
932
|
+
request_url = "{host}{uri}".format(
|
|
933
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
934
|
+
)
|
|
935
|
+
method = transcoded_request["method"]
|
|
936
|
+
try:
|
|
937
|
+
request_payload = type(request).to_json(request)
|
|
938
|
+
except:
|
|
939
|
+
request_payload = None
|
|
940
|
+
http_request = {
|
|
941
|
+
"payload": request_payload,
|
|
942
|
+
"requestMethod": method,
|
|
943
|
+
"requestUrl": request_url,
|
|
944
|
+
"headers": dict(metadata),
|
|
945
|
+
}
|
|
946
|
+
_LOGGER.debug(
|
|
947
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.AddRule",
|
|
948
|
+
extra={
|
|
949
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
950
|
+
"rpcName": "AddRule",
|
|
951
|
+
"httpRequest": http_request,
|
|
952
|
+
"metadata": http_request["headers"],
|
|
953
|
+
},
|
|
954
|
+
)
|
|
955
|
+
|
|
956
|
+
# Send the request
|
|
957
|
+
response = SecurityPoliciesRestTransport._AddRule._get_response(
|
|
958
|
+
self._host,
|
|
959
|
+
metadata,
|
|
960
|
+
query_params,
|
|
961
|
+
self._session,
|
|
962
|
+
timeout,
|
|
963
|
+
transcoded_request,
|
|
964
|
+
body,
|
|
965
|
+
)
|
|
966
|
+
|
|
967
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
968
|
+
# subclass.
|
|
969
|
+
if response.status_code >= 400:
|
|
970
|
+
raise core_exceptions.from_http_response(response)
|
|
971
|
+
|
|
972
|
+
# Return the response
|
|
973
|
+
resp = compute.Operation()
|
|
974
|
+
pb_resp = compute.Operation.pb(resp)
|
|
975
|
+
|
|
976
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
977
|
+
|
|
978
|
+
resp = self._interceptor.post_add_rule(resp)
|
|
979
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
980
|
+
resp, _ = self._interceptor.post_add_rule_with_metadata(
|
|
981
|
+
resp, response_metadata
|
|
982
|
+
)
|
|
983
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
984
|
+
logging.DEBUG
|
|
985
|
+
): # pragma: NO COVER
|
|
986
|
+
try:
|
|
987
|
+
response_payload = compute.Operation.to_json(response)
|
|
988
|
+
except:
|
|
989
|
+
response_payload = None
|
|
990
|
+
http_response = {
|
|
991
|
+
"payload": response_payload,
|
|
992
|
+
"headers": dict(response.headers),
|
|
993
|
+
"status": response.status_code,
|
|
994
|
+
}
|
|
995
|
+
_LOGGER.debug(
|
|
996
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.add_rule",
|
|
997
|
+
extra={
|
|
998
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
999
|
+
"rpcName": "AddRule",
|
|
1000
|
+
"metadata": http_response["headers"],
|
|
1001
|
+
"httpResponse": http_response,
|
|
1002
|
+
},
|
|
1003
|
+
)
|
|
1004
|
+
return resp
|
|
1005
|
+
|
|
1006
|
+
class _AggregatedList(
|
|
1007
|
+
_BaseSecurityPoliciesRestTransport._BaseAggregatedList, SecurityPoliciesRestStub
|
|
1008
|
+
):
|
|
1009
|
+
def __hash__(self):
|
|
1010
|
+
return hash("SecurityPoliciesRestTransport.AggregatedList")
|
|
1011
|
+
|
|
1012
|
+
@staticmethod
|
|
1013
|
+
def _get_response(
|
|
1014
|
+
host,
|
|
1015
|
+
metadata,
|
|
1016
|
+
query_params,
|
|
1017
|
+
session,
|
|
1018
|
+
timeout,
|
|
1019
|
+
transcoded_request,
|
|
1020
|
+
body=None,
|
|
1021
|
+
):
|
|
1022
|
+
uri = transcoded_request["uri"]
|
|
1023
|
+
method = transcoded_request["method"]
|
|
1024
|
+
headers = dict(metadata)
|
|
1025
|
+
headers["Content-Type"] = "application/json"
|
|
1026
|
+
response = getattr(session, method)(
|
|
1027
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1028
|
+
timeout=timeout,
|
|
1029
|
+
headers=headers,
|
|
1030
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1031
|
+
)
|
|
1032
|
+
return response
|
|
1033
|
+
|
|
1034
|
+
def __call__(
|
|
1035
|
+
self,
|
|
1036
|
+
request: compute.AggregatedListSecurityPoliciesRequest,
|
|
1037
|
+
*,
|
|
1038
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1039
|
+
timeout: Optional[float] = None,
|
|
1040
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1041
|
+
) -> compute.SecurityPoliciesAggregatedList:
|
|
1042
|
+
r"""Call the aggregated list method over HTTP.
|
|
1043
|
+
|
|
1044
|
+
Args:
|
|
1045
|
+
request (~.compute.AggregatedListSecurityPoliciesRequest):
|
|
1046
|
+
The request object. A request message for
|
|
1047
|
+
SecurityPolicies.AggregatedList. See the
|
|
1048
|
+
method description for details.
|
|
1049
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1050
|
+
should be retried.
|
|
1051
|
+
timeout (float): The timeout for this request.
|
|
1052
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1053
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1054
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1055
|
+
be of type `bytes`.
|
|
1056
|
+
|
|
1057
|
+
Returns:
|
|
1058
|
+
~.compute.SecurityPoliciesAggregatedList:
|
|
1059
|
+
|
|
1060
|
+
"""
|
|
1061
|
+
|
|
1062
|
+
http_options = (
|
|
1063
|
+
_BaseSecurityPoliciesRestTransport._BaseAggregatedList._get_http_options()
|
|
1064
|
+
)
|
|
1065
|
+
|
|
1066
|
+
request, metadata = self._interceptor.pre_aggregated_list(request, metadata)
|
|
1067
|
+
transcoded_request = _BaseSecurityPoliciesRestTransport._BaseAggregatedList._get_transcoded_request(
|
|
1068
|
+
http_options, request
|
|
1069
|
+
)
|
|
1070
|
+
|
|
1071
|
+
# Jsonify the query params
|
|
1072
|
+
query_params = _BaseSecurityPoliciesRestTransport._BaseAggregatedList._get_query_params_json(
|
|
1073
|
+
transcoded_request
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1077
|
+
logging.DEBUG
|
|
1078
|
+
): # pragma: NO COVER
|
|
1079
|
+
request_url = "{host}{uri}".format(
|
|
1080
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1081
|
+
)
|
|
1082
|
+
method = transcoded_request["method"]
|
|
1083
|
+
try:
|
|
1084
|
+
request_payload = type(request).to_json(request)
|
|
1085
|
+
except:
|
|
1086
|
+
request_payload = None
|
|
1087
|
+
http_request = {
|
|
1088
|
+
"payload": request_payload,
|
|
1089
|
+
"requestMethod": method,
|
|
1090
|
+
"requestUrl": request_url,
|
|
1091
|
+
"headers": dict(metadata),
|
|
1092
|
+
}
|
|
1093
|
+
_LOGGER.debug(
|
|
1094
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.AggregatedList",
|
|
1095
|
+
extra={
|
|
1096
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1097
|
+
"rpcName": "AggregatedList",
|
|
1098
|
+
"httpRequest": http_request,
|
|
1099
|
+
"metadata": http_request["headers"],
|
|
1100
|
+
},
|
|
1101
|
+
)
|
|
1102
|
+
|
|
1103
|
+
# Send the request
|
|
1104
|
+
response = SecurityPoliciesRestTransport._AggregatedList._get_response(
|
|
1105
|
+
self._host,
|
|
1106
|
+
metadata,
|
|
1107
|
+
query_params,
|
|
1108
|
+
self._session,
|
|
1109
|
+
timeout,
|
|
1110
|
+
transcoded_request,
|
|
1111
|
+
)
|
|
1112
|
+
|
|
1113
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1114
|
+
# subclass.
|
|
1115
|
+
if response.status_code >= 400:
|
|
1116
|
+
raise core_exceptions.from_http_response(response)
|
|
1117
|
+
|
|
1118
|
+
# Return the response
|
|
1119
|
+
resp = compute.SecurityPoliciesAggregatedList()
|
|
1120
|
+
pb_resp = compute.SecurityPoliciesAggregatedList.pb(resp)
|
|
1121
|
+
|
|
1122
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1123
|
+
|
|
1124
|
+
resp = self._interceptor.post_aggregated_list(resp)
|
|
1125
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1126
|
+
resp, _ = self._interceptor.post_aggregated_list_with_metadata(
|
|
1127
|
+
resp, response_metadata
|
|
1128
|
+
)
|
|
1129
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1130
|
+
logging.DEBUG
|
|
1131
|
+
): # pragma: NO COVER
|
|
1132
|
+
try:
|
|
1133
|
+
response_payload = compute.SecurityPoliciesAggregatedList.to_json(
|
|
1134
|
+
response
|
|
1135
|
+
)
|
|
1136
|
+
except:
|
|
1137
|
+
response_payload = None
|
|
1138
|
+
http_response = {
|
|
1139
|
+
"payload": response_payload,
|
|
1140
|
+
"headers": dict(response.headers),
|
|
1141
|
+
"status": response.status_code,
|
|
1142
|
+
}
|
|
1143
|
+
_LOGGER.debug(
|
|
1144
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.aggregated_list",
|
|
1145
|
+
extra={
|
|
1146
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1147
|
+
"rpcName": "AggregatedList",
|
|
1148
|
+
"metadata": http_response["headers"],
|
|
1149
|
+
"httpResponse": http_response,
|
|
1150
|
+
},
|
|
1151
|
+
)
|
|
1152
|
+
return resp
|
|
1153
|
+
|
|
1154
|
+
class _Delete(
|
|
1155
|
+
_BaseSecurityPoliciesRestTransport._BaseDelete, SecurityPoliciesRestStub
|
|
1156
|
+
):
|
|
1157
|
+
def __hash__(self):
|
|
1158
|
+
return hash("SecurityPoliciesRestTransport.Delete")
|
|
1159
|
+
|
|
1160
|
+
@staticmethod
|
|
1161
|
+
def _get_response(
|
|
1162
|
+
host,
|
|
1163
|
+
metadata,
|
|
1164
|
+
query_params,
|
|
1165
|
+
session,
|
|
1166
|
+
timeout,
|
|
1167
|
+
transcoded_request,
|
|
1168
|
+
body=None,
|
|
1169
|
+
):
|
|
1170
|
+
uri = transcoded_request["uri"]
|
|
1171
|
+
method = transcoded_request["method"]
|
|
1172
|
+
headers = dict(metadata)
|
|
1173
|
+
headers["Content-Type"] = "application/json"
|
|
1174
|
+
response = getattr(session, method)(
|
|
1175
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1176
|
+
timeout=timeout,
|
|
1177
|
+
headers=headers,
|
|
1178
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1179
|
+
)
|
|
1180
|
+
return response
|
|
1181
|
+
|
|
1182
|
+
def __call__(
|
|
1183
|
+
self,
|
|
1184
|
+
request: compute.DeleteSecurityPolicyRequest,
|
|
1185
|
+
*,
|
|
1186
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1187
|
+
timeout: Optional[float] = None,
|
|
1188
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1189
|
+
) -> compute.Operation:
|
|
1190
|
+
r"""Call the delete method over HTTP.
|
|
1191
|
+
|
|
1192
|
+
Args:
|
|
1193
|
+
request (~.compute.DeleteSecurityPolicyRequest):
|
|
1194
|
+
The request object. A request message for
|
|
1195
|
+
SecurityPolicies.Delete. See the method
|
|
1196
|
+
description for details.
|
|
1197
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1198
|
+
should be retried.
|
|
1199
|
+
timeout (float): The timeout for this request.
|
|
1200
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1201
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1202
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1203
|
+
be of type `bytes`.
|
|
1204
|
+
|
|
1205
|
+
Returns:
|
|
1206
|
+
~.compute.Operation:
|
|
1207
|
+
Represents an Operation resource. Google Compute Engine
|
|
1208
|
+
has three Operation resources: \*
|
|
1209
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
1210
|
+
\*
|
|
1211
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
1212
|
+
\*
|
|
1213
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
1214
|
+
You can use an operation resource to manage asynchronous
|
|
1215
|
+
API requests. For more information, read Handling API
|
|
1216
|
+
responses. Operations can be global, regional or zonal.
|
|
1217
|
+
- For global operations, use the ``globalOperations``
|
|
1218
|
+
resource. - For regional operations, use the
|
|
1219
|
+
``regionOperations`` resource. - For zonal operations,
|
|
1220
|
+
use the ``zoneOperations`` resource. For more
|
|
1221
|
+
information, read Global, Regional, and Zonal Resources.
|
|
1222
|
+
Note that completed Operation resources have a limited
|
|
1223
|
+
retention period.
|
|
1224
|
+
|
|
1225
|
+
"""
|
|
1226
|
+
|
|
1227
|
+
http_options = (
|
|
1228
|
+
_BaseSecurityPoliciesRestTransport._BaseDelete._get_http_options()
|
|
1229
|
+
)
|
|
1230
|
+
|
|
1231
|
+
request, metadata = self._interceptor.pre_delete(request, metadata)
|
|
1232
|
+
transcoded_request = (
|
|
1233
|
+
_BaseSecurityPoliciesRestTransport._BaseDelete._get_transcoded_request(
|
|
1234
|
+
http_options, request
|
|
1235
|
+
)
|
|
1236
|
+
)
|
|
1237
|
+
|
|
1238
|
+
# Jsonify the query params
|
|
1239
|
+
query_params = (
|
|
1240
|
+
_BaseSecurityPoliciesRestTransport._BaseDelete._get_query_params_json(
|
|
1241
|
+
transcoded_request
|
|
1242
|
+
)
|
|
1243
|
+
)
|
|
1244
|
+
|
|
1245
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1246
|
+
logging.DEBUG
|
|
1247
|
+
): # pragma: NO COVER
|
|
1248
|
+
request_url = "{host}{uri}".format(
|
|
1249
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1250
|
+
)
|
|
1251
|
+
method = transcoded_request["method"]
|
|
1252
|
+
try:
|
|
1253
|
+
request_payload = type(request).to_json(request)
|
|
1254
|
+
except:
|
|
1255
|
+
request_payload = None
|
|
1256
|
+
http_request = {
|
|
1257
|
+
"payload": request_payload,
|
|
1258
|
+
"requestMethod": method,
|
|
1259
|
+
"requestUrl": request_url,
|
|
1260
|
+
"headers": dict(metadata),
|
|
1261
|
+
}
|
|
1262
|
+
_LOGGER.debug(
|
|
1263
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.Delete",
|
|
1264
|
+
extra={
|
|
1265
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1266
|
+
"rpcName": "Delete",
|
|
1267
|
+
"httpRequest": http_request,
|
|
1268
|
+
"metadata": http_request["headers"],
|
|
1269
|
+
},
|
|
1270
|
+
)
|
|
1271
|
+
|
|
1272
|
+
# Send the request
|
|
1273
|
+
response = SecurityPoliciesRestTransport._Delete._get_response(
|
|
1274
|
+
self._host,
|
|
1275
|
+
metadata,
|
|
1276
|
+
query_params,
|
|
1277
|
+
self._session,
|
|
1278
|
+
timeout,
|
|
1279
|
+
transcoded_request,
|
|
1280
|
+
)
|
|
1281
|
+
|
|
1282
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1283
|
+
# subclass.
|
|
1284
|
+
if response.status_code >= 400:
|
|
1285
|
+
raise core_exceptions.from_http_response(response)
|
|
1286
|
+
|
|
1287
|
+
# Return the response
|
|
1288
|
+
resp = compute.Operation()
|
|
1289
|
+
pb_resp = compute.Operation.pb(resp)
|
|
1290
|
+
|
|
1291
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1292
|
+
|
|
1293
|
+
resp = self._interceptor.post_delete(resp)
|
|
1294
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1295
|
+
resp, _ = self._interceptor.post_delete_with_metadata(
|
|
1296
|
+
resp, response_metadata
|
|
1297
|
+
)
|
|
1298
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1299
|
+
logging.DEBUG
|
|
1300
|
+
): # pragma: NO COVER
|
|
1301
|
+
try:
|
|
1302
|
+
response_payload = compute.Operation.to_json(response)
|
|
1303
|
+
except:
|
|
1304
|
+
response_payload = None
|
|
1305
|
+
http_response = {
|
|
1306
|
+
"payload": response_payload,
|
|
1307
|
+
"headers": dict(response.headers),
|
|
1308
|
+
"status": response.status_code,
|
|
1309
|
+
}
|
|
1310
|
+
_LOGGER.debug(
|
|
1311
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.delete",
|
|
1312
|
+
extra={
|
|
1313
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1314
|
+
"rpcName": "Delete",
|
|
1315
|
+
"metadata": http_response["headers"],
|
|
1316
|
+
"httpResponse": http_response,
|
|
1317
|
+
},
|
|
1318
|
+
)
|
|
1319
|
+
return resp
|
|
1320
|
+
|
|
1321
|
+
class _Get(_BaseSecurityPoliciesRestTransport._BaseGet, SecurityPoliciesRestStub):
|
|
1322
|
+
def __hash__(self):
|
|
1323
|
+
return hash("SecurityPoliciesRestTransport.Get")
|
|
1324
|
+
|
|
1325
|
+
@staticmethod
|
|
1326
|
+
def _get_response(
|
|
1327
|
+
host,
|
|
1328
|
+
metadata,
|
|
1329
|
+
query_params,
|
|
1330
|
+
session,
|
|
1331
|
+
timeout,
|
|
1332
|
+
transcoded_request,
|
|
1333
|
+
body=None,
|
|
1334
|
+
):
|
|
1335
|
+
uri = transcoded_request["uri"]
|
|
1336
|
+
method = transcoded_request["method"]
|
|
1337
|
+
headers = dict(metadata)
|
|
1338
|
+
headers["Content-Type"] = "application/json"
|
|
1339
|
+
response = getattr(session, method)(
|
|
1340
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1341
|
+
timeout=timeout,
|
|
1342
|
+
headers=headers,
|
|
1343
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1344
|
+
)
|
|
1345
|
+
return response
|
|
1346
|
+
|
|
1347
|
+
def __call__(
|
|
1348
|
+
self,
|
|
1349
|
+
request: compute.GetSecurityPolicyRequest,
|
|
1350
|
+
*,
|
|
1351
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1352
|
+
timeout: Optional[float] = None,
|
|
1353
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1354
|
+
) -> compute.SecurityPolicy:
|
|
1355
|
+
r"""Call the get method over HTTP.
|
|
1356
|
+
|
|
1357
|
+
Args:
|
|
1358
|
+
request (~.compute.GetSecurityPolicyRequest):
|
|
1359
|
+
The request object. A request message for
|
|
1360
|
+
SecurityPolicies.Get. See the method
|
|
1361
|
+
description for details.
|
|
1362
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1363
|
+
should be retried.
|
|
1364
|
+
timeout (float): The timeout for this request.
|
|
1365
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1366
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1367
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1368
|
+
be of type `bytes`.
|
|
1369
|
+
|
|
1370
|
+
Returns:
|
|
1371
|
+
~.compute.SecurityPolicy:
|
|
1372
|
+
Represents a Google Cloud Armor
|
|
1373
|
+
security policy resource. Only external
|
|
1374
|
+
backend services that use load balancers
|
|
1375
|
+
can reference a security policy. For
|
|
1376
|
+
more information, see Google Cloud Armor
|
|
1377
|
+
security policy overview.
|
|
1378
|
+
|
|
1379
|
+
"""
|
|
1380
|
+
|
|
1381
|
+
http_options = (
|
|
1382
|
+
_BaseSecurityPoliciesRestTransport._BaseGet._get_http_options()
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
request, metadata = self._interceptor.pre_get(request, metadata)
|
|
1386
|
+
transcoded_request = (
|
|
1387
|
+
_BaseSecurityPoliciesRestTransport._BaseGet._get_transcoded_request(
|
|
1388
|
+
http_options, request
|
|
1389
|
+
)
|
|
1390
|
+
)
|
|
1391
|
+
|
|
1392
|
+
# Jsonify the query params
|
|
1393
|
+
query_params = (
|
|
1394
|
+
_BaseSecurityPoliciesRestTransport._BaseGet._get_query_params_json(
|
|
1395
|
+
transcoded_request
|
|
1396
|
+
)
|
|
1397
|
+
)
|
|
1398
|
+
|
|
1399
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1400
|
+
logging.DEBUG
|
|
1401
|
+
): # pragma: NO COVER
|
|
1402
|
+
request_url = "{host}{uri}".format(
|
|
1403
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1404
|
+
)
|
|
1405
|
+
method = transcoded_request["method"]
|
|
1406
|
+
try:
|
|
1407
|
+
request_payload = type(request).to_json(request)
|
|
1408
|
+
except:
|
|
1409
|
+
request_payload = None
|
|
1410
|
+
http_request = {
|
|
1411
|
+
"payload": request_payload,
|
|
1412
|
+
"requestMethod": method,
|
|
1413
|
+
"requestUrl": request_url,
|
|
1414
|
+
"headers": dict(metadata),
|
|
1415
|
+
}
|
|
1416
|
+
_LOGGER.debug(
|
|
1417
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.Get",
|
|
1418
|
+
extra={
|
|
1419
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1420
|
+
"rpcName": "Get",
|
|
1421
|
+
"httpRequest": http_request,
|
|
1422
|
+
"metadata": http_request["headers"],
|
|
1423
|
+
},
|
|
1424
|
+
)
|
|
1425
|
+
|
|
1426
|
+
# Send the request
|
|
1427
|
+
response = SecurityPoliciesRestTransport._Get._get_response(
|
|
1428
|
+
self._host,
|
|
1429
|
+
metadata,
|
|
1430
|
+
query_params,
|
|
1431
|
+
self._session,
|
|
1432
|
+
timeout,
|
|
1433
|
+
transcoded_request,
|
|
1434
|
+
)
|
|
1435
|
+
|
|
1436
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1437
|
+
# subclass.
|
|
1438
|
+
if response.status_code >= 400:
|
|
1439
|
+
raise core_exceptions.from_http_response(response)
|
|
1440
|
+
|
|
1441
|
+
# Return the response
|
|
1442
|
+
resp = compute.SecurityPolicy()
|
|
1443
|
+
pb_resp = compute.SecurityPolicy.pb(resp)
|
|
1444
|
+
|
|
1445
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1446
|
+
|
|
1447
|
+
resp = self._interceptor.post_get(resp)
|
|
1448
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1449
|
+
resp, _ = self._interceptor.post_get_with_metadata(resp, response_metadata)
|
|
1450
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1451
|
+
logging.DEBUG
|
|
1452
|
+
): # pragma: NO COVER
|
|
1453
|
+
try:
|
|
1454
|
+
response_payload = compute.SecurityPolicy.to_json(response)
|
|
1455
|
+
except:
|
|
1456
|
+
response_payload = None
|
|
1457
|
+
http_response = {
|
|
1458
|
+
"payload": response_payload,
|
|
1459
|
+
"headers": dict(response.headers),
|
|
1460
|
+
"status": response.status_code,
|
|
1461
|
+
}
|
|
1462
|
+
_LOGGER.debug(
|
|
1463
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.get",
|
|
1464
|
+
extra={
|
|
1465
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1466
|
+
"rpcName": "Get",
|
|
1467
|
+
"metadata": http_response["headers"],
|
|
1468
|
+
"httpResponse": http_response,
|
|
1469
|
+
},
|
|
1470
|
+
)
|
|
1471
|
+
return resp
|
|
1472
|
+
|
|
1473
|
+
class _GetRule(
|
|
1474
|
+
_BaseSecurityPoliciesRestTransport._BaseGetRule, SecurityPoliciesRestStub
|
|
1475
|
+
):
|
|
1476
|
+
def __hash__(self):
|
|
1477
|
+
return hash("SecurityPoliciesRestTransport.GetRule")
|
|
1478
|
+
|
|
1479
|
+
@staticmethod
|
|
1480
|
+
def _get_response(
|
|
1481
|
+
host,
|
|
1482
|
+
metadata,
|
|
1483
|
+
query_params,
|
|
1484
|
+
session,
|
|
1485
|
+
timeout,
|
|
1486
|
+
transcoded_request,
|
|
1487
|
+
body=None,
|
|
1488
|
+
):
|
|
1489
|
+
uri = transcoded_request["uri"]
|
|
1490
|
+
method = transcoded_request["method"]
|
|
1491
|
+
headers = dict(metadata)
|
|
1492
|
+
headers["Content-Type"] = "application/json"
|
|
1493
|
+
response = getattr(session, method)(
|
|
1494
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1495
|
+
timeout=timeout,
|
|
1496
|
+
headers=headers,
|
|
1497
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1498
|
+
)
|
|
1499
|
+
return response
|
|
1500
|
+
|
|
1501
|
+
def __call__(
|
|
1502
|
+
self,
|
|
1503
|
+
request: compute.GetRuleSecurityPolicyRequest,
|
|
1504
|
+
*,
|
|
1505
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1506
|
+
timeout: Optional[float] = None,
|
|
1507
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1508
|
+
) -> compute.SecurityPolicyRule:
|
|
1509
|
+
r"""Call the get rule method over HTTP.
|
|
1510
|
+
|
|
1511
|
+
Args:
|
|
1512
|
+
request (~.compute.GetRuleSecurityPolicyRequest):
|
|
1513
|
+
The request object. A request message for
|
|
1514
|
+
SecurityPolicies.GetRule. See the method
|
|
1515
|
+
description for details.
|
|
1516
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1517
|
+
should be retried.
|
|
1518
|
+
timeout (float): The timeout for this request.
|
|
1519
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1520
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1521
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1522
|
+
be of type `bytes`.
|
|
1523
|
+
|
|
1524
|
+
Returns:
|
|
1525
|
+
~.compute.SecurityPolicyRule:
|
|
1526
|
+
Represents a rule that describes one
|
|
1527
|
+
or more match conditions along with the
|
|
1528
|
+
action to be taken when traffic matches
|
|
1529
|
+
this condition (allow or deny).
|
|
1530
|
+
|
|
1531
|
+
"""
|
|
1532
|
+
|
|
1533
|
+
http_options = (
|
|
1534
|
+
_BaseSecurityPoliciesRestTransport._BaseGetRule._get_http_options()
|
|
1535
|
+
)
|
|
1536
|
+
|
|
1537
|
+
request, metadata = self._interceptor.pre_get_rule(request, metadata)
|
|
1538
|
+
transcoded_request = (
|
|
1539
|
+
_BaseSecurityPoliciesRestTransport._BaseGetRule._get_transcoded_request(
|
|
1540
|
+
http_options, request
|
|
1541
|
+
)
|
|
1542
|
+
)
|
|
1543
|
+
|
|
1544
|
+
# Jsonify the query params
|
|
1545
|
+
query_params = (
|
|
1546
|
+
_BaseSecurityPoliciesRestTransport._BaseGetRule._get_query_params_json(
|
|
1547
|
+
transcoded_request
|
|
1548
|
+
)
|
|
1549
|
+
)
|
|
1550
|
+
|
|
1551
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1552
|
+
logging.DEBUG
|
|
1553
|
+
): # pragma: NO COVER
|
|
1554
|
+
request_url = "{host}{uri}".format(
|
|
1555
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1556
|
+
)
|
|
1557
|
+
method = transcoded_request["method"]
|
|
1558
|
+
try:
|
|
1559
|
+
request_payload = type(request).to_json(request)
|
|
1560
|
+
except:
|
|
1561
|
+
request_payload = None
|
|
1562
|
+
http_request = {
|
|
1563
|
+
"payload": request_payload,
|
|
1564
|
+
"requestMethod": method,
|
|
1565
|
+
"requestUrl": request_url,
|
|
1566
|
+
"headers": dict(metadata),
|
|
1567
|
+
}
|
|
1568
|
+
_LOGGER.debug(
|
|
1569
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.GetRule",
|
|
1570
|
+
extra={
|
|
1571
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1572
|
+
"rpcName": "GetRule",
|
|
1573
|
+
"httpRequest": http_request,
|
|
1574
|
+
"metadata": http_request["headers"],
|
|
1575
|
+
},
|
|
1576
|
+
)
|
|
1577
|
+
|
|
1578
|
+
# Send the request
|
|
1579
|
+
response = SecurityPoliciesRestTransport._GetRule._get_response(
|
|
1580
|
+
self._host,
|
|
1581
|
+
metadata,
|
|
1582
|
+
query_params,
|
|
1583
|
+
self._session,
|
|
1584
|
+
timeout,
|
|
1585
|
+
transcoded_request,
|
|
1586
|
+
)
|
|
1587
|
+
|
|
1588
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1589
|
+
# subclass.
|
|
1590
|
+
if response.status_code >= 400:
|
|
1591
|
+
raise core_exceptions.from_http_response(response)
|
|
1592
|
+
|
|
1593
|
+
# Return the response
|
|
1594
|
+
resp = compute.SecurityPolicyRule()
|
|
1595
|
+
pb_resp = compute.SecurityPolicyRule.pb(resp)
|
|
1596
|
+
|
|
1597
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1598
|
+
|
|
1599
|
+
resp = self._interceptor.post_get_rule(resp)
|
|
1600
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1601
|
+
resp, _ = self._interceptor.post_get_rule_with_metadata(
|
|
1602
|
+
resp, response_metadata
|
|
1603
|
+
)
|
|
1604
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1605
|
+
logging.DEBUG
|
|
1606
|
+
): # pragma: NO COVER
|
|
1607
|
+
try:
|
|
1608
|
+
response_payload = compute.SecurityPolicyRule.to_json(response)
|
|
1609
|
+
except:
|
|
1610
|
+
response_payload = None
|
|
1611
|
+
http_response = {
|
|
1612
|
+
"payload": response_payload,
|
|
1613
|
+
"headers": dict(response.headers),
|
|
1614
|
+
"status": response.status_code,
|
|
1615
|
+
}
|
|
1616
|
+
_LOGGER.debug(
|
|
1617
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.get_rule",
|
|
1618
|
+
extra={
|
|
1619
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1620
|
+
"rpcName": "GetRule",
|
|
1621
|
+
"metadata": http_response["headers"],
|
|
1622
|
+
"httpResponse": http_response,
|
|
1623
|
+
},
|
|
1624
|
+
)
|
|
1625
|
+
return resp
|
|
1626
|
+
|
|
1627
|
+
class _Insert(
|
|
1628
|
+
_BaseSecurityPoliciesRestTransport._BaseInsert, SecurityPoliciesRestStub
|
|
1629
|
+
):
|
|
1630
|
+
def __hash__(self):
|
|
1631
|
+
return hash("SecurityPoliciesRestTransport.Insert")
|
|
1632
|
+
|
|
1633
|
+
@staticmethod
|
|
1634
|
+
def _get_response(
|
|
1635
|
+
host,
|
|
1636
|
+
metadata,
|
|
1637
|
+
query_params,
|
|
1638
|
+
session,
|
|
1639
|
+
timeout,
|
|
1640
|
+
transcoded_request,
|
|
1641
|
+
body=None,
|
|
1642
|
+
):
|
|
1643
|
+
uri = transcoded_request["uri"]
|
|
1644
|
+
method = transcoded_request["method"]
|
|
1645
|
+
headers = dict(metadata)
|
|
1646
|
+
headers["Content-Type"] = "application/json"
|
|
1647
|
+
response = getattr(session, method)(
|
|
1648
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1649
|
+
timeout=timeout,
|
|
1650
|
+
headers=headers,
|
|
1651
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1652
|
+
data=body,
|
|
1653
|
+
)
|
|
1654
|
+
return response
|
|
1655
|
+
|
|
1656
|
+
def __call__(
|
|
1657
|
+
self,
|
|
1658
|
+
request: compute.InsertSecurityPolicyRequest,
|
|
1659
|
+
*,
|
|
1660
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1661
|
+
timeout: Optional[float] = None,
|
|
1662
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1663
|
+
) -> compute.Operation:
|
|
1664
|
+
r"""Call the insert method over HTTP.
|
|
1665
|
+
|
|
1666
|
+
Args:
|
|
1667
|
+
request (~.compute.InsertSecurityPolicyRequest):
|
|
1668
|
+
The request object. A request message for
|
|
1669
|
+
SecurityPolicies.Insert. See the method
|
|
1670
|
+
description for details.
|
|
1671
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1672
|
+
should be retried.
|
|
1673
|
+
timeout (float): The timeout for this request.
|
|
1674
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1675
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1676
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1677
|
+
be of type `bytes`.
|
|
1678
|
+
|
|
1679
|
+
Returns:
|
|
1680
|
+
~.compute.Operation:
|
|
1681
|
+
Represents an Operation resource. Google Compute Engine
|
|
1682
|
+
has three Operation resources: \*
|
|
1683
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
1684
|
+
\*
|
|
1685
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
1686
|
+
\*
|
|
1687
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
1688
|
+
You can use an operation resource to manage asynchronous
|
|
1689
|
+
API requests. For more information, read Handling API
|
|
1690
|
+
responses. Operations can be global, regional or zonal.
|
|
1691
|
+
- For global operations, use the ``globalOperations``
|
|
1692
|
+
resource. - For regional operations, use the
|
|
1693
|
+
``regionOperations`` resource. - For zonal operations,
|
|
1694
|
+
use the ``zoneOperations`` resource. For more
|
|
1695
|
+
information, read Global, Regional, and Zonal Resources.
|
|
1696
|
+
Note that completed Operation resources have a limited
|
|
1697
|
+
retention period.
|
|
1698
|
+
|
|
1699
|
+
"""
|
|
1700
|
+
|
|
1701
|
+
http_options = (
|
|
1702
|
+
_BaseSecurityPoliciesRestTransport._BaseInsert._get_http_options()
|
|
1703
|
+
)
|
|
1704
|
+
|
|
1705
|
+
request, metadata = self._interceptor.pre_insert(request, metadata)
|
|
1706
|
+
transcoded_request = (
|
|
1707
|
+
_BaseSecurityPoliciesRestTransport._BaseInsert._get_transcoded_request(
|
|
1708
|
+
http_options, request
|
|
1709
|
+
)
|
|
1710
|
+
)
|
|
1711
|
+
|
|
1712
|
+
body = (
|
|
1713
|
+
_BaseSecurityPoliciesRestTransport._BaseInsert._get_request_body_json(
|
|
1714
|
+
transcoded_request
|
|
1715
|
+
)
|
|
1716
|
+
)
|
|
1717
|
+
|
|
1718
|
+
# Jsonify the query params
|
|
1719
|
+
query_params = (
|
|
1720
|
+
_BaseSecurityPoliciesRestTransport._BaseInsert._get_query_params_json(
|
|
1721
|
+
transcoded_request
|
|
1722
|
+
)
|
|
1723
|
+
)
|
|
1724
|
+
|
|
1725
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1726
|
+
logging.DEBUG
|
|
1727
|
+
): # pragma: NO COVER
|
|
1728
|
+
request_url = "{host}{uri}".format(
|
|
1729
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1730
|
+
)
|
|
1731
|
+
method = transcoded_request["method"]
|
|
1732
|
+
try:
|
|
1733
|
+
request_payload = type(request).to_json(request)
|
|
1734
|
+
except:
|
|
1735
|
+
request_payload = None
|
|
1736
|
+
http_request = {
|
|
1737
|
+
"payload": request_payload,
|
|
1738
|
+
"requestMethod": method,
|
|
1739
|
+
"requestUrl": request_url,
|
|
1740
|
+
"headers": dict(metadata),
|
|
1741
|
+
}
|
|
1742
|
+
_LOGGER.debug(
|
|
1743
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.Insert",
|
|
1744
|
+
extra={
|
|
1745
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1746
|
+
"rpcName": "Insert",
|
|
1747
|
+
"httpRequest": http_request,
|
|
1748
|
+
"metadata": http_request["headers"],
|
|
1749
|
+
},
|
|
1750
|
+
)
|
|
1751
|
+
|
|
1752
|
+
# Send the request
|
|
1753
|
+
response = SecurityPoliciesRestTransport._Insert._get_response(
|
|
1754
|
+
self._host,
|
|
1755
|
+
metadata,
|
|
1756
|
+
query_params,
|
|
1757
|
+
self._session,
|
|
1758
|
+
timeout,
|
|
1759
|
+
transcoded_request,
|
|
1760
|
+
body,
|
|
1761
|
+
)
|
|
1762
|
+
|
|
1763
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1764
|
+
# subclass.
|
|
1765
|
+
if response.status_code >= 400:
|
|
1766
|
+
raise core_exceptions.from_http_response(response)
|
|
1767
|
+
|
|
1768
|
+
# Return the response
|
|
1769
|
+
resp = compute.Operation()
|
|
1770
|
+
pb_resp = compute.Operation.pb(resp)
|
|
1771
|
+
|
|
1772
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1773
|
+
|
|
1774
|
+
resp = self._interceptor.post_insert(resp)
|
|
1775
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1776
|
+
resp, _ = self._interceptor.post_insert_with_metadata(
|
|
1777
|
+
resp, response_metadata
|
|
1778
|
+
)
|
|
1779
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1780
|
+
logging.DEBUG
|
|
1781
|
+
): # pragma: NO COVER
|
|
1782
|
+
try:
|
|
1783
|
+
response_payload = compute.Operation.to_json(response)
|
|
1784
|
+
except:
|
|
1785
|
+
response_payload = None
|
|
1786
|
+
http_response = {
|
|
1787
|
+
"payload": response_payload,
|
|
1788
|
+
"headers": dict(response.headers),
|
|
1789
|
+
"status": response.status_code,
|
|
1790
|
+
}
|
|
1791
|
+
_LOGGER.debug(
|
|
1792
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.insert",
|
|
1793
|
+
extra={
|
|
1794
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1795
|
+
"rpcName": "Insert",
|
|
1796
|
+
"metadata": http_response["headers"],
|
|
1797
|
+
"httpResponse": http_response,
|
|
1798
|
+
},
|
|
1799
|
+
)
|
|
1800
|
+
return resp
|
|
1801
|
+
|
|
1802
|
+
class _List(_BaseSecurityPoliciesRestTransport._BaseList, SecurityPoliciesRestStub):
|
|
1803
|
+
def __hash__(self):
|
|
1804
|
+
return hash("SecurityPoliciesRestTransport.List")
|
|
1805
|
+
|
|
1806
|
+
@staticmethod
|
|
1807
|
+
def _get_response(
|
|
1808
|
+
host,
|
|
1809
|
+
metadata,
|
|
1810
|
+
query_params,
|
|
1811
|
+
session,
|
|
1812
|
+
timeout,
|
|
1813
|
+
transcoded_request,
|
|
1814
|
+
body=None,
|
|
1815
|
+
):
|
|
1816
|
+
uri = transcoded_request["uri"]
|
|
1817
|
+
method = transcoded_request["method"]
|
|
1818
|
+
headers = dict(metadata)
|
|
1819
|
+
headers["Content-Type"] = "application/json"
|
|
1820
|
+
response = getattr(session, method)(
|
|
1821
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1822
|
+
timeout=timeout,
|
|
1823
|
+
headers=headers,
|
|
1824
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1825
|
+
)
|
|
1826
|
+
return response
|
|
1827
|
+
|
|
1828
|
+
def __call__(
|
|
1829
|
+
self,
|
|
1830
|
+
request: compute.ListSecurityPoliciesRequest,
|
|
1831
|
+
*,
|
|
1832
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1833
|
+
timeout: Optional[float] = None,
|
|
1834
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1835
|
+
) -> compute.SecurityPolicyList:
|
|
1836
|
+
r"""Call the list method over HTTP.
|
|
1837
|
+
|
|
1838
|
+
Args:
|
|
1839
|
+
request (~.compute.ListSecurityPoliciesRequest):
|
|
1840
|
+
The request object. A request message for
|
|
1841
|
+
SecurityPolicies.List. See the method
|
|
1842
|
+
description for details.
|
|
1843
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1844
|
+
should be retried.
|
|
1845
|
+
timeout (float): The timeout for this request.
|
|
1846
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1847
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1848
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1849
|
+
be of type `bytes`.
|
|
1850
|
+
|
|
1851
|
+
Returns:
|
|
1852
|
+
~.compute.SecurityPolicyList:
|
|
1853
|
+
|
|
1854
|
+
"""
|
|
1855
|
+
|
|
1856
|
+
http_options = (
|
|
1857
|
+
_BaseSecurityPoliciesRestTransport._BaseList._get_http_options()
|
|
1858
|
+
)
|
|
1859
|
+
|
|
1860
|
+
request, metadata = self._interceptor.pre_list(request, metadata)
|
|
1861
|
+
transcoded_request = (
|
|
1862
|
+
_BaseSecurityPoliciesRestTransport._BaseList._get_transcoded_request(
|
|
1863
|
+
http_options, request
|
|
1864
|
+
)
|
|
1865
|
+
)
|
|
1866
|
+
|
|
1867
|
+
# Jsonify the query params
|
|
1868
|
+
query_params = (
|
|
1869
|
+
_BaseSecurityPoliciesRestTransport._BaseList._get_query_params_json(
|
|
1870
|
+
transcoded_request
|
|
1871
|
+
)
|
|
1872
|
+
)
|
|
1873
|
+
|
|
1874
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1875
|
+
logging.DEBUG
|
|
1876
|
+
): # pragma: NO COVER
|
|
1877
|
+
request_url = "{host}{uri}".format(
|
|
1878
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1879
|
+
)
|
|
1880
|
+
method = transcoded_request["method"]
|
|
1881
|
+
try:
|
|
1882
|
+
request_payload = type(request).to_json(request)
|
|
1883
|
+
except:
|
|
1884
|
+
request_payload = None
|
|
1885
|
+
http_request = {
|
|
1886
|
+
"payload": request_payload,
|
|
1887
|
+
"requestMethod": method,
|
|
1888
|
+
"requestUrl": request_url,
|
|
1889
|
+
"headers": dict(metadata),
|
|
1890
|
+
}
|
|
1891
|
+
_LOGGER.debug(
|
|
1892
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.List",
|
|
1893
|
+
extra={
|
|
1894
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1895
|
+
"rpcName": "List",
|
|
1896
|
+
"httpRequest": http_request,
|
|
1897
|
+
"metadata": http_request["headers"],
|
|
1898
|
+
},
|
|
1899
|
+
)
|
|
1900
|
+
|
|
1901
|
+
# Send the request
|
|
1902
|
+
response = SecurityPoliciesRestTransport._List._get_response(
|
|
1903
|
+
self._host,
|
|
1904
|
+
metadata,
|
|
1905
|
+
query_params,
|
|
1906
|
+
self._session,
|
|
1907
|
+
timeout,
|
|
1908
|
+
transcoded_request,
|
|
1909
|
+
)
|
|
1910
|
+
|
|
1911
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1912
|
+
# subclass.
|
|
1913
|
+
if response.status_code >= 400:
|
|
1914
|
+
raise core_exceptions.from_http_response(response)
|
|
1915
|
+
|
|
1916
|
+
# Return the response
|
|
1917
|
+
resp = compute.SecurityPolicyList()
|
|
1918
|
+
pb_resp = compute.SecurityPolicyList.pb(resp)
|
|
1919
|
+
|
|
1920
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1921
|
+
|
|
1922
|
+
resp = self._interceptor.post_list(resp)
|
|
1923
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1924
|
+
resp, _ = self._interceptor.post_list_with_metadata(resp, response_metadata)
|
|
1925
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1926
|
+
logging.DEBUG
|
|
1927
|
+
): # pragma: NO COVER
|
|
1928
|
+
try:
|
|
1929
|
+
response_payload = compute.SecurityPolicyList.to_json(response)
|
|
1930
|
+
except:
|
|
1931
|
+
response_payload = None
|
|
1932
|
+
http_response = {
|
|
1933
|
+
"payload": response_payload,
|
|
1934
|
+
"headers": dict(response.headers),
|
|
1935
|
+
"status": response.status_code,
|
|
1936
|
+
}
|
|
1937
|
+
_LOGGER.debug(
|
|
1938
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.list",
|
|
1939
|
+
extra={
|
|
1940
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
1941
|
+
"rpcName": "List",
|
|
1942
|
+
"metadata": http_response["headers"],
|
|
1943
|
+
"httpResponse": http_response,
|
|
1944
|
+
},
|
|
1945
|
+
)
|
|
1946
|
+
return resp
|
|
1947
|
+
|
|
1948
|
+
class _ListPreconfiguredExpressionSets(
|
|
1949
|
+
_BaseSecurityPoliciesRestTransport._BaseListPreconfiguredExpressionSets,
|
|
1950
|
+
SecurityPoliciesRestStub,
|
|
1951
|
+
):
|
|
1952
|
+
def __hash__(self):
|
|
1953
|
+
return hash("SecurityPoliciesRestTransport.ListPreconfiguredExpressionSets")
|
|
1954
|
+
|
|
1955
|
+
@staticmethod
|
|
1956
|
+
def _get_response(
|
|
1957
|
+
host,
|
|
1958
|
+
metadata,
|
|
1959
|
+
query_params,
|
|
1960
|
+
session,
|
|
1961
|
+
timeout,
|
|
1962
|
+
transcoded_request,
|
|
1963
|
+
body=None,
|
|
1964
|
+
):
|
|
1965
|
+
uri = transcoded_request["uri"]
|
|
1966
|
+
method = transcoded_request["method"]
|
|
1967
|
+
headers = dict(metadata)
|
|
1968
|
+
headers["Content-Type"] = "application/json"
|
|
1969
|
+
response = getattr(session, method)(
|
|
1970
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1971
|
+
timeout=timeout,
|
|
1972
|
+
headers=headers,
|
|
1973
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1974
|
+
)
|
|
1975
|
+
return response
|
|
1976
|
+
|
|
1977
|
+
def __call__(
|
|
1978
|
+
self,
|
|
1979
|
+
request: compute.ListPreconfiguredExpressionSetsSecurityPoliciesRequest,
|
|
1980
|
+
*,
|
|
1981
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1982
|
+
timeout: Optional[float] = None,
|
|
1983
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1984
|
+
) -> compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse:
|
|
1985
|
+
r"""Call the list preconfigured
|
|
1986
|
+
expression sets method over HTTP.
|
|
1987
|
+
|
|
1988
|
+
Args:
|
|
1989
|
+
request (~.compute.ListPreconfiguredExpressionSetsSecurityPoliciesRequest):
|
|
1990
|
+
The request object. A request message for
|
|
1991
|
+
SecurityPolicies.ListPreconfiguredExpressionSets.
|
|
1992
|
+
See the method description for details.
|
|
1993
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1994
|
+
should be retried.
|
|
1995
|
+
timeout (float): The timeout for this request.
|
|
1996
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1997
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1998
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1999
|
+
be of type `bytes`.
|
|
2000
|
+
|
|
2001
|
+
Returns:
|
|
2002
|
+
~.compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse:
|
|
2003
|
+
|
|
2004
|
+
"""
|
|
2005
|
+
|
|
2006
|
+
http_options = (
|
|
2007
|
+
_BaseSecurityPoliciesRestTransport._BaseListPreconfiguredExpressionSets._get_http_options()
|
|
2008
|
+
)
|
|
2009
|
+
|
|
2010
|
+
(
|
|
2011
|
+
request,
|
|
2012
|
+
metadata,
|
|
2013
|
+
) = self._interceptor.pre_list_preconfigured_expression_sets(
|
|
2014
|
+
request, metadata
|
|
2015
|
+
)
|
|
2016
|
+
transcoded_request = _BaseSecurityPoliciesRestTransport._BaseListPreconfiguredExpressionSets._get_transcoded_request(
|
|
2017
|
+
http_options, request
|
|
2018
|
+
)
|
|
2019
|
+
|
|
2020
|
+
# Jsonify the query params
|
|
2021
|
+
query_params = _BaseSecurityPoliciesRestTransport._BaseListPreconfiguredExpressionSets._get_query_params_json(
|
|
2022
|
+
transcoded_request
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2025
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2026
|
+
logging.DEBUG
|
|
2027
|
+
): # pragma: NO COVER
|
|
2028
|
+
request_url = "{host}{uri}".format(
|
|
2029
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
2030
|
+
)
|
|
2031
|
+
method = transcoded_request["method"]
|
|
2032
|
+
try:
|
|
2033
|
+
request_payload = type(request).to_json(request)
|
|
2034
|
+
except:
|
|
2035
|
+
request_payload = None
|
|
2036
|
+
http_request = {
|
|
2037
|
+
"payload": request_payload,
|
|
2038
|
+
"requestMethod": method,
|
|
2039
|
+
"requestUrl": request_url,
|
|
2040
|
+
"headers": dict(metadata),
|
|
2041
|
+
}
|
|
2042
|
+
_LOGGER.debug(
|
|
2043
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.ListPreconfiguredExpressionSets",
|
|
2044
|
+
extra={
|
|
2045
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2046
|
+
"rpcName": "ListPreconfiguredExpressionSets",
|
|
2047
|
+
"httpRequest": http_request,
|
|
2048
|
+
"metadata": http_request["headers"],
|
|
2049
|
+
},
|
|
2050
|
+
)
|
|
2051
|
+
|
|
2052
|
+
# Send the request
|
|
2053
|
+
response = SecurityPoliciesRestTransport._ListPreconfiguredExpressionSets._get_response(
|
|
2054
|
+
self._host,
|
|
2055
|
+
metadata,
|
|
2056
|
+
query_params,
|
|
2057
|
+
self._session,
|
|
2058
|
+
timeout,
|
|
2059
|
+
transcoded_request,
|
|
2060
|
+
)
|
|
2061
|
+
|
|
2062
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
2063
|
+
# subclass.
|
|
2064
|
+
if response.status_code >= 400:
|
|
2065
|
+
raise core_exceptions.from_http_response(response)
|
|
2066
|
+
|
|
2067
|
+
# Return the response
|
|
2068
|
+
resp = compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse()
|
|
2069
|
+
pb_resp = (
|
|
2070
|
+
compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse.pb(resp)
|
|
2071
|
+
)
|
|
2072
|
+
|
|
2073
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
2074
|
+
|
|
2075
|
+
resp = self._interceptor.post_list_preconfigured_expression_sets(resp)
|
|
2076
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
2077
|
+
(
|
|
2078
|
+
resp,
|
|
2079
|
+
_,
|
|
2080
|
+
) = self._interceptor.post_list_preconfigured_expression_sets_with_metadata(
|
|
2081
|
+
resp, response_metadata
|
|
2082
|
+
)
|
|
2083
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2084
|
+
logging.DEBUG
|
|
2085
|
+
): # pragma: NO COVER
|
|
2086
|
+
try:
|
|
2087
|
+
response_payload = compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse.to_json(
|
|
2088
|
+
response
|
|
2089
|
+
)
|
|
2090
|
+
except:
|
|
2091
|
+
response_payload = None
|
|
2092
|
+
http_response = {
|
|
2093
|
+
"payload": response_payload,
|
|
2094
|
+
"headers": dict(response.headers),
|
|
2095
|
+
"status": response.status_code,
|
|
2096
|
+
}
|
|
2097
|
+
_LOGGER.debug(
|
|
2098
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.list_preconfigured_expression_sets",
|
|
2099
|
+
extra={
|
|
2100
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2101
|
+
"rpcName": "ListPreconfiguredExpressionSets",
|
|
2102
|
+
"metadata": http_response["headers"],
|
|
2103
|
+
"httpResponse": http_response,
|
|
2104
|
+
},
|
|
2105
|
+
)
|
|
2106
|
+
return resp
|
|
2107
|
+
|
|
2108
|
+
class _Patch(
|
|
2109
|
+
_BaseSecurityPoliciesRestTransport._BasePatch, SecurityPoliciesRestStub
|
|
2110
|
+
):
|
|
2111
|
+
def __hash__(self):
|
|
2112
|
+
return hash("SecurityPoliciesRestTransport.Patch")
|
|
2113
|
+
|
|
2114
|
+
@staticmethod
|
|
2115
|
+
def _get_response(
|
|
2116
|
+
host,
|
|
2117
|
+
metadata,
|
|
2118
|
+
query_params,
|
|
2119
|
+
session,
|
|
2120
|
+
timeout,
|
|
2121
|
+
transcoded_request,
|
|
2122
|
+
body=None,
|
|
2123
|
+
):
|
|
2124
|
+
uri = transcoded_request["uri"]
|
|
2125
|
+
method = transcoded_request["method"]
|
|
2126
|
+
headers = dict(metadata)
|
|
2127
|
+
headers["Content-Type"] = "application/json"
|
|
2128
|
+
response = getattr(session, method)(
|
|
2129
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
2130
|
+
timeout=timeout,
|
|
2131
|
+
headers=headers,
|
|
2132
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
2133
|
+
data=body,
|
|
2134
|
+
)
|
|
2135
|
+
return response
|
|
2136
|
+
|
|
2137
|
+
def __call__(
|
|
2138
|
+
self,
|
|
2139
|
+
request: compute.PatchSecurityPolicyRequest,
|
|
2140
|
+
*,
|
|
2141
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2142
|
+
timeout: Optional[float] = None,
|
|
2143
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2144
|
+
) -> compute.Operation:
|
|
2145
|
+
r"""Call the patch method over HTTP.
|
|
2146
|
+
|
|
2147
|
+
Args:
|
|
2148
|
+
request (~.compute.PatchSecurityPolicyRequest):
|
|
2149
|
+
The request object. A request message for
|
|
2150
|
+
SecurityPolicies.Patch. See the method
|
|
2151
|
+
description for details.
|
|
2152
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
2153
|
+
should be retried.
|
|
2154
|
+
timeout (float): The timeout for this request.
|
|
2155
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2156
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2157
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2158
|
+
be of type `bytes`.
|
|
2159
|
+
|
|
2160
|
+
Returns:
|
|
2161
|
+
~.compute.Operation:
|
|
2162
|
+
Represents an Operation resource. Google Compute Engine
|
|
2163
|
+
has three Operation resources: \*
|
|
2164
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
2165
|
+
\*
|
|
2166
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
2167
|
+
\*
|
|
2168
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
2169
|
+
You can use an operation resource to manage asynchronous
|
|
2170
|
+
API requests. For more information, read Handling API
|
|
2171
|
+
responses. Operations can be global, regional or zonal.
|
|
2172
|
+
- For global operations, use the ``globalOperations``
|
|
2173
|
+
resource. - For regional operations, use the
|
|
2174
|
+
``regionOperations`` resource. - For zonal operations,
|
|
2175
|
+
use the ``zoneOperations`` resource. For more
|
|
2176
|
+
information, read Global, Regional, and Zonal Resources.
|
|
2177
|
+
Note that completed Operation resources have a limited
|
|
2178
|
+
retention period.
|
|
2179
|
+
|
|
2180
|
+
"""
|
|
2181
|
+
|
|
2182
|
+
http_options = (
|
|
2183
|
+
_BaseSecurityPoliciesRestTransport._BasePatch._get_http_options()
|
|
2184
|
+
)
|
|
2185
|
+
|
|
2186
|
+
request, metadata = self._interceptor.pre_patch(request, metadata)
|
|
2187
|
+
transcoded_request = (
|
|
2188
|
+
_BaseSecurityPoliciesRestTransport._BasePatch._get_transcoded_request(
|
|
2189
|
+
http_options, request
|
|
2190
|
+
)
|
|
2191
|
+
)
|
|
2192
|
+
|
|
2193
|
+
body = _BaseSecurityPoliciesRestTransport._BasePatch._get_request_body_json(
|
|
2194
|
+
transcoded_request
|
|
2195
|
+
)
|
|
2196
|
+
|
|
2197
|
+
# Jsonify the query params
|
|
2198
|
+
query_params = (
|
|
2199
|
+
_BaseSecurityPoliciesRestTransport._BasePatch._get_query_params_json(
|
|
2200
|
+
transcoded_request
|
|
2201
|
+
)
|
|
2202
|
+
)
|
|
2203
|
+
|
|
2204
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2205
|
+
logging.DEBUG
|
|
2206
|
+
): # pragma: NO COVER
|
|
2207
|
+
request_url = "{host}{uri}".format(
|
|
2208
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
2209
|
+
)
|
|
2210
|
+
method = transcoded_request["method"]
|
|
2211
|
+
try:
|
|
2212
|
+
request_payload = type(request).to_json(request)
|
|
2213
|
+
except:
|
|
2214
|
+
request_payload = None
|
|
2215
|
+
http_request = {
|
|
2216
|
+
"payload": request_payload,
|
|
2217
|
+
"requestMethod": method,
|
|
2218
|
+
"requestUrl": request_url,
|
|
2219
|
+
"headers": dict(metadata),
|
|
2220
|
+
}
|
|
2221
|
+
_LOGGER.debug(
|
|
2222
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.Patch",
|
|
2223
|
+
extra={
|
|
2224
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2225
|
+
"rpcName": "Patch",
|
|
2226
|
+
"httpRequest": http_request,
|
|
2227
|
+
"metadata": http_request["headers"],
|
|
2228
|
+
},
|
|
2229
|
+
)
|
|
2230
|
+
|
|
2231
|
+
# Send the request
|
|
2232
|
+
response = SecurityPoliciesRestTransport._Patch._get_response(
|
|
2233
|
+
self._host,
|
|
2234
|
+
metadata,
|
|
2235
|
+
query_params,
|
|
2236
|
+
self._session,
|
|
2237
|
+
timeout,
|
|
2238
|
+
transcoded_request,
|
|
2239
|
+
body,
|
|
2240
|
+
)
|
|
2241
|
+
|
|
2242
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
2243
|
+
# subclass.
|
|
2244
|
+
if response.status_code >= 400:
|
|
2245
|
+
raise core_exceptions.from_http_response(response)
|
|
2246
|
+
|
|
2247
|
+
# Return the response
|
|
2248
|
+
resp = compute.Operation()
|
|
2249
|
+
pb_resp = compute.Operation.pb(resp)
|
|
2250
|
+
|
|
2251
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
2252
|
+
|
|
2253
|
+
resp = self._interceptor.post_patch(resp)
|
|
2254
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
2255
|
+
resp, _ = self._interceptor.post_patch_with_metadata(
|
|
2256
|
+
resp, response_metadata
|
|
2257
|
+
)
|
|
2258
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2259
|
+
logging.DEBUG
|
|
2260
|
+
): # pragma: NO COVER
|
|
2261
|
+
try:
|
|
2262
|
+
response_payload = compute.Operation.to_json(response)
|
|
2263
|
+
except:
|
|
2264
|
+
response_payload = None
|
|
2265
|
+
http_response = {
|
|
2266
|
+
"payload": response_payload,
|
|
2267
|
+
"headers": dict(response.headers),
|
|
2268
|
+
"status": response.status_code,
|
|
2269
|
+
}
|
|
2270
|
+
_LOGGER.debug(
|
|
2271
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.patch",
|
|
2272
|
+
extra={
|
|
2273
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2274
|
+
"rpcName": "Patch",
|
|
2275
|
+
"metadata": http_response["headers"],
|
|
2276
|
+
"httpResponse": http_response,
|
|
2277
|
+
},
|
|
2278
|
+
)
|
|
2279
|
+
return resp
|
|
2280
|
+
|
|
2281
|
+
class _PatchRule(
|
|
2282
|
+
_BaseSecurityPoliciesRestTransport._BasePatchRule, SecurityPoliciesRestStub
|
|
2283
|
+
):
|
|
2284
|
+
def __hash__(self):
|
|
2285
|
+
return hash("SecurityPoliciesRestTransport.PatchRule")
|
|
2286
|
+
|
|
2287
|
+
@staticmethod
|
|
2288
|
+
def _get_response(
|
|
2289
|
+
host,
|
|
2290
|
+
metadata,
|
|
2291
|
+
query_params,
|
|
2292
|
+
session,
|
|
2293
|
+
timeout,
|
|
2294
|
+
transcoded_request,
|
|
2295
|
+
body=None,
|
|
2296
|
+
):
|
|
2297
|
+
uri = transcoded_request["uri"]
|
|
2298
|
+
method = transcoded_request["method"]
|
|
2299
|
+
headers = dict(metadata)
|
|
2300
|
+
headers["Content-Type"] = "application/json"
|
|
2301
|
+
response = getattr(session, method)(
|
|
2302
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
2303
|
+
timeout=timeout,
|
|
2304
|
+
headers=headers,
|
|
2305
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
2306
|
+
data=body,
|
|
2307
|
+
)
|
|
2308
|
+
return response
|
|
2309
|
+
|
|
2310
|
+
def __call__(
|
|
2311
|
+
self,
|
|
2312
|
+
request: compute.PatchRuleSecurityPolicyRequest,
|
|
2313
|
+
*,
|
|
2314
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2315
|
+
timeout: Optional[float] = None,
|
|
2316
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2317
|
+
) -> compute.Operation:
|
|
2318
|
+
r"""Call the patch rule method over HTTP.
|
|
2319
|
+
|
|
2320
|
+
Args:
|
|
2321
|
+
request (~.compute.PatchRuleSecurityPolicyRequest):
|
|
2322
|
+
The request object. A request message for
|
|
2323
|
+
SecurityPolicies.PatchRule. See the
|
|
2324
|
+
method description for details.
|
|
2325
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
2326
|
+
should be retried.
|
|
2327
|
+
timeout (float): The timeout for this request.
|
|
2328
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2329
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2330
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2331
|
+
be of type `bytes`.
|
|
2332
|
+
|
|
2333
|
+
Returns:
|
|
2334
|
+
~.compute.Operation:
|
|
2335
|
+
Represents an Operation resource. Google Compute Engine
|
|
2336
|
+
has three Operation resources: \*
|
|
2337
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
2338
|
+
\*
|
|
2339
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
2340
|
+
\*
|
|
2341
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
2342
|
+
You can use an operation resource to manage asynchronous
|
|
2343
|
+
API requests. For more information, read Handling API
|
|
2344
|
+
responses. Operations can be global, regional or zonal.
|
|
2345
|
+
- For global operations, use the ``globalOperations``
|
|
2346
|
+
resource. - For regional operations, use the
|
|
2347
|
+
``regionOperations`` resource. - For zonal operations,
|
|
2348
|
+
use the ``zoneOperations`` resource. For more
|
|
2349
|
+
information, read Global, Regional, and Zonal Resources.
|
|
2350
|
+
Note that completed Operation resources have a limited
|
|
2351
|
+
retention period.
|
|
2352
|
+
|
|
2353
|
+
"""
|
|
2354
|
+
|
|
2355
|
+
http_options = (
|
|
2356
|
+
_BaseSecurityPoliciesRestTransport._BasePatchRule._get_http_options()
|
|
2357
|
+
)
|
|
2358
|
+
|
|
2359
|
+
request, metadata = self._interceptor.pre_patch_rule(request, metadata)
|
|
2360
|
+
transcoded_request = _BaseSecurityPoliciesRestTransport._BasePatchRule._get_transcoded_request(
|
|
2361
|
+
http_options, request
|
|
2362
|
+
)
|
|
2363
|
+
|
|
2364
|
+
body = _BaseSecurityPoliciesRestTransport._BasePatchRule._get_request_body_json(
|
|
2365
|
+
transcoded_request
|
|
2366
|
+
)
|
|
2367
|
+
|
|
2368
|
+
# Jsonify the query params
|
|
2369
|
+
query_params = _BaseSecurityPoliciesRestTransport._BasePatchRule._get_query_params_json(
|
|
2370
|
+
transcoded_request
|
|
2371
|
+
)
|
|
2372
|
+
|
|
2373
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2374
|
+
logging.DEBUG
|
|
2375
|
+
): # pragma: NO COVER
|
|
2376
|
+
request_url = "{host}{uri}".format(
|
|
2377
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
2378
|
+
)
|
|
2379
|
+
method = transcoded_request["method"]
|
|
2380
|
+
try:
|
|
2381
|
+
request_payload = type(request).to_json(request)
|
|
2382
|
+
except:
|
|
2383
|
+
request_payload = None
|
|
2384
|
+
http_request = {
|
|
2385
|
+
"payload": request_payload,
|
|
2386
|
+
"requestMethod": method,
|
|
2387
|
+
"requestUrl": request_url,
|
|
2388
|
+
"headers": dict(metadata),
|
|
2389
|
+
}
|
|
2390
|
+
_LOGGER.debug(
|
|
2391
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.PatchRule",
|
|
2392
|
+
extra={
|
|
2393
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2394
|
+
"rpcName": "PatchRule",
|
|
2395
|
+
"httpRequest": http_request,
|
|
2396
|
+
"metadata": http_request["headers"],
|
|
2397
|
+
},
|
|
2398
|
+
)
|
|
2399
|
+
|
|
2400
|
+
# Send the request
|
|
2401
|
+
response = SecurityPoliciesRestTransport._PatchRule._get_response(
|
|
2402
|
+
self._host,
|
|
2403
|
+
metadata,
|
|
2404
|
+
query_params,
|
|
2405
|
+
self._session,
|
|
2406
|
+
timeout,
|
|
2407
|
+
transcoded_request,
|
|
2408
|
+
body,
|
|
2409
|
+
)
|
|
2410
|
+
|
|
2411
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
2412
|
+
# subclass.
|
|
2413
|
+
if response.status_code >= 400:
|
|
2414
|
+
raise core_exceptions.from_http_response(response)
|
|
2415
|
+
|
|
2416
|
+
# Return the response
|
|
2417
|
+
resp = compute.Operation()
|
|
2418
|
+
pb_resp = compute.Operation.pb(resp)
|
|
2419
|
+
|
|
2420
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
2421
|
+
|
|
2422
|
+
resp = self._interceptor.post_patch_rule(resp)
|
|
2423
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
2424
|
+
resp, _ = self._interceptor.post_patch_rule_with_metadata(
|
|
2425
|
+
resp, response_metadata
|
|
2426
|
+
)
|
|
2427
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2428
|
+
logging.DEBUG
|
|
2429
|
+
): # pragma: NO COVER
|
|
2430
|
+
try:
|
|
2431
|
+
response_payload = compute.Operation.to_json(response)
|
|
2432
|
+
except:
|
|
2433
|
+
response_payload = None
|
|
2434
|
+
http_response = {
|
|
2435
|
+
"payload": response_payload,
|
|
2436
|
+
"headers": dict(response.headers),
|
|
2437
|
+
"status": response.status_code,
|
|
2438
|
+
}
|
|
2439
|
+
_LOGGER.debug(
|
|
2440
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.patch_rule",
|
|
2441
|
+
extra={
|
|
2442
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2443
|
+
"rpcName": "PatchRule",
|
|
2444
|
+
"metadata": http_response["headers"],
|
|
2445
|
+
"httpResponse": http_response,
|
|
2446
|
+
},
|
|
2447
|
+
)
|
|
2448
|
+
return resp
|
|
2449
|
+
|
|
2450
|
+
class _RemoveRule(
|
|
2451
|
+
_BaseSecurityPoliciesRestTransport._BaseRemoveRule, SecurityPoliciesRestStub
|
|
2452
|
+
):
|
|
2453
|
+
def __hash__(self):
|
|
2454
|
+
return hash("SecurityPoliciesRestTransport.RemoveRule")
|
|
2455
|
+
|
|
2456
|
+
@staticmethod
|
|
2457
|
+
def _get_response(
|
|
2458
|
+
host,
|
|
2459
|
+
metadata,
|
|
2460
|
+
query_params,
|
|
2461
|
+
session,
|
|
2462
|
+
timeout,
|
|
2463
|
+
transcoded_request,
|
|
2464
|
+
body=None,
|
|
2465
|
+
):
|
|
2466
|
+
uri = transcoded_request["uri"]
|
|
2467
|
+
method = transcoded_request["method"]
|
|
2468
|
+
headers = dict(metadata)
|
|
2469
|
+
headers["Content-Type"] = "application/json"
|
|
2470
|
+
response = getattr(session, method)(
|
|
2471
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
2472
|
+
timeout=timeout,
|
|
2473
|
+
headers=headers,
|
|
2474
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
2475
|
+
)
|
|
2476
|
+
return response
|
|
2477
|
+
|
|
2478
|
+
def __call__(
|
|
2479
|
+
self,
|
|
2480
|
+
request: compute.RemoveRuleSecurityPolicyRequest,
|
|
2481
|
+
*,
|
|
2482
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2483
|
+
timeout: Optional[float] = None,
|
|
2484
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2485
|
+
) -> compute.Operation:
|
|
2486
|
+
r"""Call the remove rule method over HTTP.
|
|
2487
|
+
|
|
2488
|
+
Args:
|
|
2489
|
+
request (~.compute.RemoveRuleSecurityPolicyRequest):
|
|
2490
|
+
The request object. A request message for
|
|
2491
|
+
SecurityPolicies.RemoveRule. See the
|
|
2492
|
+
method description for details.
|
|
2493
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
2494
|
+
should be retried.
|
|
2495
|
+
timeout (float): The timeout for this request.
|
|
2496
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2497
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2498
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2499
|
+
be of type `bytes`.
|
|
2500
|
+
|
|
2501
|
+
Returns:
|
|
2502
|
+
~.compute.Operation:
|
|
2503
|
+
Represents an Operation resource. Google Compute Engine
|
|
2504
|
+
has three Operation resources: \*
|
|
2505
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
2506
|
+
\*
|
|
2507
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
2508
|
+
\*
|
|
2509
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
2510
|
+
You can use an operation resource to manage asynchronous
|
|
2511
|
+
API requests. For more information, read Handling API
|
|
2512
|
+
responses. Operations can be global, regional or zonal.
|
|
2513
|
+
- For global operations, use the ``globalOperations``
|
|
2514
|
+
resource. - For regional operations, use the
|
|
2515
|
+
``regionOperations`` resource. - For zonal operations,
|
|
2516
|
+
use the ``zoneOperations`` resource. For more
|
|
2517
|
+
information, read Global, Regional, and Zonal Resources.
|
|
2518
|
+
Note that completed Operation resources have a limited
|
|
2519
|
+
retention period.
|
|
2520
|
+
|
|
2521
|
+
"""
|
|
2522
|
+
|
|
2523
|
+
http_options = (
|
|
2524
|
+
_BaseSecurityPoliciesRestTransport._BaseRemoveRule._get_http_options()
|
|
2525
|
+
)
|
|
2526
|
+
|
|
2527
|
+
request, metadata = self._interceptor.pre_remove_rule(request, metadata)
|
|
2528
|
+
transcoded_request = _BaseSecurityPoliciesRestTransport._BaseRemoveRule._get_transcoded_request(
|
|
2529
|
+
http_options, request
|
|
2530
|
+
)
|
|
2531
|
+
|
|
2532
|
+
# Jsonify the query params
|
|
2533
|
+
query_params = _BaseSecurityPoliciesRestTransport._BaseRemoveRule._get_query_params_json(
|
|
2534
|
+
transcoded_request
|
|
2535
|
+
)
|
|
2536
|
+
|
|
2537
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2538
|
+
logging.DEBUG
|
|
2539
|
+
): # pragma: NO COVER
|
|
2540
|
+
request_url = "{host}{uri}".format(
|
|
2541
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
2542
|
+
)
|
|
2543
|
+
method = transcoded_request["method"]
|
|
2544
|
+
try:
|
|
2545
|
+
request_payload = type(request).to_json(request)
|
|
2546
|
+
except:
|
|
2547
|
+
request_payload = None
|
|
2548
|
+
http_request = {
|
|
2549
|
+
"payload": request_payload,
|
|
2550
|
+
"requestMethod": method,
|
|
2551
|
+
"requestUrl": request_url,
|
|
2552
|
+
"headers": dict(metadata),
|
|
2553
|
+
}
|
|
2554
|
+
_LOGGER.debug(
|
|
2555
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.RemoveRule",
|
|
2556
|
+
extra={
|
|
2557
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2558
|
+
"rpcName": "RemoveRule",
|
|
2559
|
+
"httpRequest": http_request,
|
|
2560
|
+
"metadata": http_request["headers"],
|
|
2561
|
+
},
|
|
2562
|
+
)
|
|
2563
|
+
|
|
2564
|
+
# Send the request
|
|
2565
|
+
response = SecurityPoliciesRestTransport._RemoveRule._get_response(
|
|
2566
|
+
self._host,
|
|
2567
|
+
metadata,
|
|
2568
|
+
query_params,
|
|
2569
|
+
self._session,
|
|
2570
|
+
timeout,
|
|
2571
|
+
transcoded_request,
|
|
2572
|
+
)
|
|
2573
|
+
|
|
2574
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
2575
|
+
# subclass.
|
|
2576
|
+
if response.status_code >= 400:
|
|
2577
|
+
raise core_exceptions.from_http_response(response)
|
|
2578
|
+
|
|
2579
|
+
# Return the response
|
|
2580
|
+
resp = compute.Operation()
|
|
2581
|
+
pb_resp = compute.Operation.pb(resp)
|
|
2582
|
+
|
|
2583
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
2584
|
+
|
|
2585
|
+
resp = self._interceptor.post_remove_rule(resp)
|
|
2586
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
2587
|
+
resp, _ = self._interceptor.post_remove_rule_with_metadata(
|
|
2588
|
+
resp, response_metadata
|
|
2589
|
+
)
|
|
2590
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2591
|
+
logging.DEBUG
|
|
2592
|
+
): # pragma: NO COVER
|
|
2593
|
+
try:
|
|
2594
|
+
response_payload = compute.Operation.to_json(response)
|
|
2595
|
+
except:
|
|
2596
|
+
response_payload = None
|
|
2597
|
+
http_response = {
|
|
2598
|
+
"payload": response_payload,
|
|
2599
|
+
"headers": dict(response.headers),
|
|
2600
|
+
"status": response.status_code,
|
|
2601
|
+
}
|
|
2602
|
+
_LOGGER.debug(
|
|
2603
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.remove_rule",
|
|
2604
|
+
extra={
|
|
2605
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2606
|
+
"rpcName": "RemoveRule",
|
|
2607
|
+
"metadata": http_response["headers"],
|
|
2608
|
+
"httpResponse": http_response,
|
|
2609
|
+
},
|
|
2610
|
+
)
|
|
2611
|
+
return resp
|
|
2612
|
+
|
|
2613
|
+
class _SetLabels(
|
|
2614
|
+
_BaseSecurityPoliciesRestTransport._BaseSetLabels, SecurityPoliciesRestStub
|
|
2615
|
+
):
|
|
2616
|
+
def __hash__(self):
|
|
2617
|
+
return hash("SecurityPoliciesRestTransport.SetLabels")
|
|
2618
|
+
|
|
2619
|
+
@staticmethod
|
|
2620
|
+
def _get_response(
|
|
2621
|
+
host,
|
|
2622
|
+
metadata,
|
|
2623
|
+
query_params,
|
|
2624
|
+
session,
|
|
2625
|
+
timeout,
|
|
2626
|
+
transcoded_request,
|
|
2627
|
+
body=None,
|
|
2628
|
+
):
|
|
2629
|
+
uri = transcoded_request["uri"]
|
|
2630
|
+
method = transcoded_request["method"]
|
|
2631
|
+
headers = dict(metadata)
|
|
2632
|
+
headers["Content-Type"] = "application/json"
|
|
2633
|
+
response = getattr(session, method)(
|
|
2634
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
2635
|
+
timeout=timeout,
|
|
2636
|
+
headers=headers,
|
|
2637
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
2638
|
+
data=body,
|
|
2639
|
+
)
|
|
2640
|
+
return response
|
|
2641
|
+
|
|
2642
|
+
def __call__(
|
|
2643
|
+
self,
|
|
2644
|
+
request: compute.SetLabelsSecurityPolicyRequest,
|
|
2645
|
+
*,
|
|
2646
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
2647
|
+
timeout: Optional[float] = None,
|
|
2648
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
2649
|
+
) -> compute.Operation:
|
|
2650
|
+
r"""Call the set labels method over HTTP.
|
|
2651
|
+
|
|
2652
|
+
Args:
|
|
2653
|
+
request (~.compute.SetLabelsSecurityPolicyRequest):
|
|
2654
|
+
The request object. A request message for
|
|
2655
|
+
SecurityPolicies.SetLabels. See the
|
|
2656
|
+
method description for details.
|
|
2657
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
2658
|
+
should be retried.
|
|
2659
|
+
timeout (float): The timeout for this request.
|
|
2660
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
2661
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
2662
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
2663
|
+
be of type `bytes`.
|
|
2664
|
+
|
|
2665
|
+
Returns:
|
|
2666
|
+
~.compute.Operation:
|
|
2667
|
+
Represents an Operation resource. Google Compute Engine
|
|
2668
|
+
has three Operation resources: \*
|
|
2669
|
+
`Global </compute/docs/reference/rest/v1/globalOperations>`__
|
|
2670
|
+
\*
|
|
2671
|
+
`Regional </compute/docs/reference/rest/v1/regionOperations>`__
|
|
2672
|
+
\*
|
|
2673
|
+
`Zonal </compute/docs/reference/rest/v1/zoneOperations>`__
|
|
2674
|
+
You can use an operation resource to manage asynchronous
|
|
2675
|
+
API requests. For more information, read Handling API
|
|
2676
|
+
responses. Operations can be global, regional or zonal.
|
|
2677
|
+
- For global operations, use the ``globalOperations``
|
|
2678
|
+
resource. - For regional operations, use the
|
|
2679
|
+
``regionOperations`` resource. - For zonal operations,
|
|
2680
|
+
use the ``zoneOperations`` resource. For more
|
|
2681
|
+
information, read Global, Regional, and Zonal Resources.
|
|
2682
|
+
Note that completed Operation resources have a limited
|
|
2683
|
+
retention period.
|
|
2684
|
+
|
|
2685
|
+
"""
|
|
2686
|
+
|
|
2687
|
+
http_options = (
|
|
2688
|
+
_BaseSecurityPoliciesRestTransport._BaseSetLabels._get_http_options()
|
|
2689
|
+
)
|
|
2690
|
+
|
|
2691
|
+
request, metadata = self._interceptor.pre_set_labels(request, metadata)
|
|
2692
|
+
transcoded_request = _BaseSecurityPoliciesRestTransport._BaseSetLabels._get_transcoded_request(
|
|
2693
|
+
http_options, request
|
|
2694
|
+
)
|
|
2695
|
+
|
|
2696
|
+
body = _BaseSecurityPoliciesRestTransport._BaseSetLabels._get_request_body_json(
|
|
2697
|
+
transcoded_request
|
|
2698
|
+
)
|
|
2699
|
+
|
|
2700
|
+
# Jsonify the query params
|
|
2701
|
+
query_params = _BaseSecurityPoliciesRestTransport._BaseSetLabels._get_query_params_json(
|
|
2702
|
+
transcoded_request
|
|
2703
|
+
)
|
|
2704
|
+
|
|
2705
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2706
|
+
logging.DEBUG
|
|
2707
|
+
): # pragma: NO COVER
|
|
2708
|
+
request_url = "{host}{uri}".format(
|
|
2709
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
2710
|
+
)
|
|
2711
|
+
method = transcoded_request["method"]
|
|
2712
|
+
try:
|
|
2713
|
+
request_payload = type(request).to_json(request)
|
|
2714
|
+
except:
|
|
2715
|
+
request_payload = None
|
|
2716
|
+
http_request = {
|
|
2717
|
+
"payload": request_payload,
|
|
2718
|
+
"requestMethod": method,
|
|
2719
|
+
"requestUrl": request_url,
|
|
2720
|
+
"headers": dict(metadata),
|
|
2721
|
+
}
|
|
2722
|
+
_LOGGER.debug(
|
|
2723
|
+
f"Sending request for google.cloud.compute_v1.SecurityPoliciesClient.SetLabels",
|
|
2724
|
+
extra={
|
|
2725
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2726
|
+
"rpcName": "SetLabels",
|
|
2727
|
+
"httpRequest": http_request,
|
|
2728
|
+
"metadata": http_request["headers"],
|
|
2729
|
+
},
|
|
2730
|
+
)
|
|
2731
|
+
|
|
2732
|
+
# Send the request
|
|
2733
|
+
response = SecurityPoliciesRestTransport._SetLabels._get_response(
|
|
2734
|
+
self._host,
|
|
2735
|
+
metadata,
|
|
2736
|
+
query_params,
|
|
2737
|
+
self._session,
|
|
2738
|
+
timeout,
|
|
2739
|
+
transcoded_request,
|
|
2740
|
+
body,
|
|
2741
|
+
)
|
|
2742
|
+
|
|
2743
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
2744
|
+
# subclass.
|
|
2745
|
+
if response.status_code >= 400:
|
|
2746
|
+
raise core_exceptions.from_http_response(response)
|
|
2747
|
+
|
|
2748
|
+
# Return the response
|
|
2749
|
+
resp = compute.Operation()
|
|
2750
|
+
pb_resp = compute.Operation.pb(resp)
|
|
2751
|
+
|
|
2752
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
2753
|
+
|
|
2754
|
+
resp = self._interceptor.post_set_labels(resp)
|
|
2755
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
2756
|
+
resp, _ = self._interceptor.post_set_labels_with_metadata(
|
|
2757
|
+
resp, response_metadata
|
|
2758
|
+
)
|
|
2759
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
2760
|
+
logging.DEBUG
|
|
2761
|
+
): # pragma: NO COVER
|
|
2762
|
+
try:
|
|
2763
|
+
response_payload = compute.Operation.to_json(response)
|
|
2764
|
+
except:
|
|
2765
|
+
response_payload = None
|
|
2766
|
+
http_response = {
|
|
2767
|
+
"payload": response_payload,
|
|
2768
|
+
"headers": dict(response.headers),
|
|
2769
|
+
"status": response.status_code,
|
|
2770
|
+
}
|
|
2771
|
+
_LOGGER.debug(
|
|
2772
|
+
"Received response for google.cloud.compute_v1.SecurityPoliciesClient.set_labels",
|
|
2773
|
+
extra={
|
|
2774
|
+
"serviceName": "google.cloud.compute.v1.SecurityPolicies",
|
|
2775
|
+
"rpcName": "SetLabels",
|
|
2776
|
+
"metadata": http_response["headers"],
|
|
2777
|
+
"httpResponse": http_response,
|
|
2778
|
+
},
|
|
2779
|
+
)
|
|
2780
|
+
return resp
|
|
2781
|
+
|
|
2782
|
+
@property
|
|
2783
|
+
def add_rule(
|
|
2784
|
+
self,
|
|
2785
|
+
) -> Callable[[compute.AddRuleSecurityPolicyRequest], compute.Operation]:
|
|
2786
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2787
|
+
# In C++ this would require a dynamic_cast
|
|
2788
|
+
return self._AddRule(self._session, self._host, self._interceptor) # type: ignore
|
|
2789
|
+
|
|
2790
|
+
@property
|
|
2791
|
+
def aggregated_list(
|
|
2792
|
+
self,
|
|
2793
|
+
) -> Callable[
|
|
2794
|
+
[compute.AggregatedListSecurityPoliciesRequest],
|
|
2795
|
+
compute.SecurityPoliciesAggregatedList,
|
|
2796
|
+
]:
|
|
2797
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2798
|
+
# In C++ this would require a dynamic_cast
|
|
2799
|
+
return self._AggregatedList(self._session, self._host, self._interceptor) # type: ignore
|
|
2800
|
+
|
|
2801
|
+
@property
|
|
2802
|
+
def delete(
|
|
2803
|
+
self,
|
|
2804
|
+
) -> Callable[[compute.DeleteSecurityPolicyRequest], compute.Operation]:
|
|
2805
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2806
|
+
# In C++ this would require a dynamic_cast
|
|
2807
|
+
return self._Delete(self._session, self._host, self._interceptor) # type: ignore
|
|
2808
|
+
|
|
2809
|
+
@property
|
|
2810
|
+
def get(
|
|
2811
|
+
self,
|
|
2812
|
+
) -> Callable[[compute.GetSecurityPolicyRequest], compute.SecurityPolicy]:
|
|
2813
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2814
|
+
# In C++ this would require a dynamic_cast
|
|
2815
|
+
return self._Get(self._session, self._host, self._interceptor) # type: ignore
|
|
2816
|
+
|
|
2817
|
+
@property
|
|
2818
|
+
def get_rule(
|
|
2819
|
+
self,
|
|
2820
|
+
) -> Callable[[compute.GetRuleSecurityPolicyRequest], compute.SecurityPolicyRule]:
|
|
2821
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2822
|
+
# In C++ this would require a dynamic_cast
|
|
2823
|
+
return self._GetRule(self._session, self._host, self._interceptor) # type: ignore
|
|
2824
|
+
|
|
2825
|
+
@property
|
|
2826
|
+
def insert(
|
|
2827
|
+
self,
|
|
2828
|
+
) -> Callable[[compute.InsertSecurityPolicyRequest], compute.Operation]:
|
|
2829
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2830
|
+
# In C++ this would require a dynamic_cast
|
|
2831
|
+
return self._Insert(self._session, self._host, self._interceptor) # type: ignore
|
|
2832
|
+
|
|
2833
|
+
@property
|
|
2834
|
+
def list(
|
|
2835
|
+
self,
|
|
2836
|
+
) -> Callable[[compute.ListSecurityPoliciesRequest], compute.SecurityPolicyList]:
|
|
2837
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2838
|
+
# In C++ this would require a dynamic_cast
|
|
2839
|
+
return self._List(self._session, self._host, self._interceptor) # type: ignore
|
|
2840
|
+
|
|
2841
|
+
@property
|
|
2842
|
+
def list_preconfigured_expression_sets(
|
|
2843
|
+
self,
|
|
2844
|
+
) -> Callable[
|
|
2845
|
+
[compute.ListPreconfiguredExpressionSetsSecurityPoliciesRequest],
|
|
2846
|
+
compute.SecurityPoliciesListPreconfiguredExpressionSetsResponse,
|
|
2847
|
+
]:
|
|
2848
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2849
|
+
# In C++ this would require a dynamic_cast
|
|
2850
|
+
return self._ListPreconfiguredExpressionSets(self._session, self._host, self._interceptor) # type: ignore
|
|
2851
|
+
|
|
2852
|
+
@property
|
|
2853
|
+
def patch(
|
|
2854
|
+
self,
|
|
2855
|
+
) -> Callable[[compute.PatchSecurityPolicyRequest], compute.Operation]:
|
|
2856
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2857
|
+
# In C++ this would require a dynamic_cast
|
|
2858
|
+
return self._Patch(self._session, self._host, self._interceptor) # type: ignore
|
|
2859
|
+
|
|
2860
|
+
@property
|
|
2861
|
+
def patch_rule(
|
|
2862
|
+
self,
|
|
2863
|
+
) -> Callable[[compute.PatchRuleSecurityPolicyRequest], compute.Operation]:
|
|
2864
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2865
|
+
# In C++ this would require a dynamic_cast
|
|
2866
|
+
return self._PatchRule(self._session, self._host, self._interceptor) # type: ignore
|
|
2867
|
+
|
|
2868
|
+
@property
|
|
2869
|
+
def remove_rule(
|
|
2870
|
+
self,
|
|
2871
|
+
) -> Callable[[compute.RemoveRuleSecurityPolicyRequest], compute.Operation]:
|
|
2872
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2873
|
+
# In C++ this would require a dynamic_cast
|
|
2874
|
+
return self._RemoveRule(self._session, self._host, self._interceptor) # type: ignore
|
|
2875
|
+
|
|
2876
|
+
@property
|
|
2877
|
+
def set_labels(
|
|
2878
|
+
self,
|
|
2879
|
+
) -> Callable[[compute.SetLabelsSecurityPolicyRequest], compute.Operation]:
|
|
2880
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
2881
|
+
# In C++ this would require a dynamic_cast
|
|
2882
|
+
return self._SetLabels(self._session, self._host, self._interceptor) # type: ignore
|
|
2883
|
+
|
|
2884
|
+
@property
|
|
2885
|
+
def kind(self) -> str:
|
|
2886
|
+
return "rest"
|
|
2887
|
+
|
|
2888
|
+
def close(self):
|
|
2889
|
+
self._session.close()
|
|
2890
|
+
|
|
2891
|
+
|
|
2892
|
+
__all__ = ("SecurityPoliciesRestTransport",)
|