gcore 0.1.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.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +89 -0
- gcore/_base_client.py +1943 -0
- gcore/_client.py +493 -0
- gcore/_compat.py +219 -0
- gcore/_constants.py +16 -0
- gcore/_exceptions.py +108 -0
- gcore/_files.py +123 -0
- gcore/_models.py +803 -0
- gcore/_qs.py +150 -0
- gcore/_resource.py +43 -0
- gcore/_response.py +830 -0
- gcore/_streaming.py +333 -0
- gcore/_types.py +217 -0
- gcore/_utils/__init__.py +57 -0
- gcore/_utils/_logs.py +25 -0
- gcore/_utils/_proxy.py +65 -0
- gcore/_utils/_reflection.py +42 -0
- gcore/_utils/_resources_proxy.py +24 -0
- gcore/_utils/_streams.py +12 -0
- gcore/_utils/_sync.py +86 -0
- gcore/_utils/_transform.py +447 -0
- gcore/_utils/_typing.py +151 -0
- gcore/_utils/_utils.py +422 -0
- gcore/_version.py +4 -0
- gcore/lib/.keep +4 -0
- gcore/lib/polling.py +19 -0
- gcore/pagination.py +70 -0
- gcore/py.typed +0 -0
- gcore/resources/__init__.py +33 -0
- gcore/resources/cloud/__init__.py +327 -0
- gcore/resources/cloud/baremetal/__init__.py +61 -0
- gcore/resources/cloud/baremetal/baremetal.py +166 -0
- gcore/resources/cloud/baremetal/flavors.py +371 -0
- gcore/resources/cloud/baremetal/images.py +238 -0
- gcore/resources/cloud/baremetal/servers.py +1042 -0
- gcore/resources/cloud/billing_reservations.py +386 -0
- gcore/resources/cloud/cloud.py +774 -0
- gcore/resources/cloud/file_shares/__init__.py +33 -0
- gcore/resources/cloud/file_shares/access_rules.py +434 -0
- gcore/resources/cloud/file_shares/file_shares.py +994 -0
- gcore/resources/cloud/floating_ips.py +765 -0
- gcore/resources/cloud/gpu_baremetal_clusters/__init__.py +75 -0
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +211 -0
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +1493 -0
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +785 -0
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +175 -0
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +1178 -0
- gcore/resources/cloud/inference/__init__.py +89 -0
- gcore/resources/cloud/inference/deployments/__init__.py +33 -0
- gcore/resources/cloud/inference/deployments/deployments.py +1493 -0
- gcore/resources/cloud/inference/deployments/logs.py +235 -0
- gcore/resources/cloud/inference/flavors.py +280 -0
- gcore/resources/cloud/inference/inference.py +295 -0
- gcore/resources/cloud/inference/models.py +289 -0
- gcore/resources/cloud/inference/registry_credentials.py +649 -0
- gcore/resources/cloud/inference/secrets.py +629 -0
- gcore/resources/cloud/instances/__init__.py +75 -0
- gcore/resources/cloud/instances/flavors.py +449 -0
- gcore/resources/cloud/instances/images.py +1297 -0
- gcore/resources/cloud/instances/instances.py +2821 -0
- gcore/resources/cloud/instances/interfaces.py +797 -0
- gcore/resources/cloud/instances/metrics.py +217 -0
- gcore/resources/cloud/ip_ranges.py +135 -0
- gcore/resources/cloud/load_balancers/__init__.py +103 -0
- gcore/resources/cloud/load_balancers/flavors.py +193 -0
- gcore/resources/cloud/load_balancers/l7_policies/__init__.py +33 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1020 -0
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +1036 -0
- gcore/resources/cloud/load_balancers/listeners.py +1089 -0
- gcore/resources/cloud/load_balancers/load_balancers.py +1583 -0
- gcore/resources/cloud/load_balancers/metrics.py +205 -0
- gcore/resources/cloud/load_balancers/pools/__init__.py +47 -0
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +352 -0
- gcore/resources/cloud/load_balancers/pools/members.py +353 -0
- gcore/resources/cloud/load_balancers/pools/pools.py +1190 -0
- gcore/resources/cloud/load_balancers/statuses.py +260 -0
- gcore/resources/cloud/networks/__init__.py +47 -0
- gcore/resources/cloud/networks/networks.py +771 -0
- gcore/resources/cloud/networks/routers.py +875 -0
- gcore/resources/cloud/networks/subnets.py +865 -0
- gcore/resources/cloud/placement_groups.py +465 -0
- gcore/resources/cloud/projects.py +608 -0
- gcore/resources/cloud/quotas/__init__.py +33 -0
- gcore/resources/cloud/quotas/quotas.py +335 -0
- gcore/resources/cloud/quotas/requests.py +482 -0
- gcore/resources/cloud/regions.py +328 -0
- gcore/resources/cloud/registries/__init__.py +75 -0
- gcore/resources/cloud/registries/artifacts.py +277 -0
- gcore/resources/cloud/registries/registries.py +688 -0
- gcore/resources/cloud/registries/repositories.py +265 -0
- gcore/resources/cloud/registries/tags.py +190 -0
- gcore/resources/cloud/registries/users.py +701 -0
- gcore/resources/cloud/reserved_fixed_ips/__init__.py +33 -0
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +965 -0
- gcore/resources/cloud/reserved_fixed_ips/vip.py +577 -0
- gcore/resources/cloud/secrets.py +797 -0
- gcore/resources/cloud/security_groups/__init__.py +33 -0
- gcore/resources/cloud/security_groups/rules.py +626 -0
- gcore/resources/cloud/security_groups/security_groups.py +863 -0
- gcore/resources/cloud/ssh_keys.py +635 -0
- gcore/resources/cloud/tasks.py +700 -0
- gcore/resources/cloud/users/__init__.py +33 -0
- gcore/resources/cloud/users/role_assignments.py +533 -0
- gcore/resources/cloud/users/users.py +102 -0
- gcore/resources/cloud/volumes.py +1710 -0
- gcore/resources/waap/__init__.py +33 -0
- gcore/resources/waap/domains/__init__.py +33 -0
- gcore/resources/waap/domains/domains.py +515 -0
- gcore/resources/waap/domains/settings.py +271 -0
- gcore/resources/waap/waap.py +102 -0
- gcore/types/__init__.py +3 -0
- gcore/types/cloud/__init__.py +199 -0
- gcore/types/cloud/allowed_address_pairs.py +15 -0
- gcore/types/cloud/aws_iam_data.py +13 -0
- gcore/types/cloud/aws_iam_data_param.py +15 -0
- gcore/types/cloud/baremetal/__init__.py +13 -0
- gcore/types/cloud/baremetal/baremetal_fixed_address.py +30 -0
- gcore/types/cloud/baremetal/baremetal_floating_address.py +15 -0
- gcore/types/cloud/baremetal/baremetal_server.py +178 -0
- gcore/types/cloud/baremetal/flavor_list_params.py +35 -0
- gcore/types/cloud/baremetal/flavor_list_suitable_params.py +22 -0
- gcore/types/cloud/baremetal/image_list_params.py +33 -0
- gcore/types/cloud/baremetal/server_create_params.py +370 -0
- gcore/types/cloud/baremetal/server_list_params.py +114 -0
- gcore/types/cloud/baremetal/server_rebuild_params.py +23 -0
- gcore/types/cloud/baremetal_flavor.py +58 -0
- gcore/types/cloud/baremetal_flavor_list.py +16 -0
- gcore/types/cloud/billing_reservation.py +153 -0
- gcore/types/cloud/billing_reservation_list_params.py +59 -0
- gcore/types/cloud/blackhole_port.py +66 -0
- gcore/types/cloud/capacity.py +13 -0
- gcore/types/cloud/console.py +18 -0
- gcore/types/cloud/container_probe.py +36 -0
- gcore/types/cloud/container_probe_config.py +16 -0
- gcore/types/cloud/container_probe_config_create_param.py +18 -0
- gcore/types/cloud/container_probe_create_param.py +38 -0
- gcore/types/cloud/container_probe_exec.py +12 -0
- gcore/types/cloud/container_probe_exec_create_param.py +13 -0
- gcore/types/cloud/container_probe_http_get.py +26 -0
- gcore/types/cloud/container_probe_http_get_create_param.py +25 -0
- gcore/types/cloud/container_probe_tcp_socket.py +10 -0
- gcore/types/cloud/container_probe_tcp_socket_create_param.py +12 -0
- gcore/types/cloud/container_scale.py +25 -0
- gcore/types/cloud/container_scale_trigger_rate.py +13 -0
- gcore/types/cloud/container_scale_trigger_sqs.py +33 -0
- gcore/types/cloud/container_scale_trigger_threshold.py +10 -0
- gcore/types/cloud/container_scale_triggers.py +36 -0
- gcore/types/cloud/ddos_profile.py +33 -0
- gcore/types/cloud/ddos_profile_field.py +31 -0
- gcore/types/cloud/ddos_profile_option_list.py +15 -0
- gcore/types/cloud/ddos_profile_status.py +13 -0
- gcore/types/cloud/ddos_profile_template.py +18 -0
- gcore/types/cloud/ddos_profile_template_field.py +23 -0
- gcore/types/cloud/deploy_status.py +13 -0
- gcore/types/cloud/file_share.py +111 -0
- gcore/types/cloud/file_share_create_params.py +104 -0
- gcore/types/cloud/file_share_list_params.py +24 -0
- gcore/types/cloud/file_share_resize_params.py +18 -0
- gcore/types/cloud/file_share_update_params.py +18 -0
- gcore/types/cloud/file_shares/__init__.py +7 -0
- gcore/types/cloud/file_shares/access_rule.py +21 -0
- gcore/types/cloud/file_shares/access_rule_create_params.py +21 -0
- gcore/types/cloud/file_shares/access_rule_list.py +16 -0
- gcore/types/cloud/fixed_address.py +38 -0
- gcore/types/cloud/fixed_address_short.py +24 -0
- gcore/types/cloud/flavor_hardware_description.py +27 -0
- gcore/types/cloud/floating_address.py +15 -0
- gcore/types/cloud/floating_ip.py +77 -0
- gcore/types/cloud/floating_ip_assign_params.py +20 -0
- gcore/types/cloud/floating_ip_create_params.py +40 -0
- gcore/types/cloud/floating_ip_detailed.py +222 -0
- gcore/types/cloud/floating_ip_list_params.py +35 -0
- gcore/types/cloud/floating_ip_status.py +7 -0
- gcore/types/cloud/gpu_baremetal_cluster.py +116 -0
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +155 -0
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +28 -0
- gcore/types/cloud/gpu_baremetal_cluster_list_params.py +19 -0
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +26 -0
- gcore/types/cloud/gpu_baremetal_cluster_resize_params.py +16 -0
- gcore/types/cloud/gpu_baremetal_cluster_server.py +200 -0
- gcore/types/cloud/gpu_baremetal_cluster_server_list.py +16 -0
- gcore/types/cloud/gpu_baremetal_clusters/__init__.py +9 -0
- gcore/types/cloud/gpu_baremetal_clusters/flavor_list_params.py +21 -0
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +58 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +253 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_delete_params.py +21 -0
- gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py +19 -0
- gcore/types/cloud/gpu_baremetal_flavor.py +133 -0
- gcore/types/cloud/gpu_baremetal_flavor_list.py +16 -0
- gcore/types/cloud/gpu_image.py +70 -0
- gcore/types/cloud/gpu_image_list.py +16 -0
- gcore/types/cloud/health_monitor.py +48 -0
- gcore/types/cloud/health_monitor_status.py +22 -0
- gcore/types/cloud/http_method.py +7 -0
- gcore/types/cloud/image.py +100 -0
- gcore/types/cloud/image_list.py +16 -0
- gcore/types/cloud/inference/__init__.py +25 -0
- gcore/types/cloud/inference/container.py +26 -0
- gcore/types/cloud/inference/deployment_create_params.py +222 -0
- gcore/types/cloud/inference/deployment_list_params.py +21 -0
- gcore/types/cloud/inference/deployment_update_params.py +215 -0
- gcore/types/cloud/inference/deployments/__init__.py +5 -0
- gcore/types/cloud/inference/deployments/log_list_params.py +28 -0
- gcore/types/cloud/inference/flavor_list_params.py +18 -0
- gcore/types/cloud/inference/inference.py +95 -0
- gcore/types/cloud/inference/inference_apikey_secret.py +15 -0
- gcore/types/cloud/inference/inference_flavor.py +34 -0
- gcore/types/cloud/inference/inference_log.py +21 -0
- gcore/types/cloud/inference/inference_registry_credential.py +19 -0
- gcore/types/cloud/inference/inference_registry_credential_full.py +22 -0
- gcore/types/cloud/inference/inference_secret.py +17 -0
- gcore/types/cloud/inference/mlcatalog_model_card.py +65 -0
- gcore/types/cloud/inference/mlcatalog_order_by_choices.py +7 -0
- gcore/types/cloud/inference/model_list_params.py +23 -0
- gcore/types/cloud/inference/registry_credential_create_params.py +24 -0
- gcore/types/cloud/inference/registry_credential_list_params.py +21 -0
- gcore/types/cloud/inference/registry_credential_replace_params.py +21 -0
- gcore/types/cloud/inference/secret_create_params.py +23 -0
- gcore/types/cloud/inference/secret_list_params.py +21 -0
- gcore/types/cloud/inference/secret_replace_params.py +20 -0
- gcore/types/cloud/inference_probes.py +19 -0
- gcore/types/cloud/ingress_opts_out.py +16 -0
- gcore/types/cloud/ingress_opts_param.py +18 -0
- gcore/types/cloud/instance.py +296 -0
- gcore/types/cloud/instance_action_params.py +32 -0
- gcore/types/cloud/instance_add_to_placement_group_params.py +16 -0
- gcore/types/cloud/instance_assign_security_group_params.py +28 -0
- gcore/types/cloud/instance_create_params.py +622 -0
- gcore/types/cloud/instance_delete_params.py +33 -0
- gcore/types/cloud/instance_get_console_params.py +16 -0
- gcore/types/cloud/instance_interface.py +40 -0
- gcore/types/cloud/instance_isolation.py +12 -0
- gcore/types/cloud/instance_list.py +16 -0
- gcore/types/cloud/instance_list_params.py +146 -0
- gcore/types/cloud/instance_metrics_time_unit.py +7 -0
- gcore/types/cloud/instance_resize_params.py +16 -0
- gcore/types/cloud/instance_unassign_security_group_params.py +28 -0
- gcore/types/cloud/instance_update_params.py +18 -0
- gcore/types/cloud/instances/__init__.py +19 -0
- gcore/types/cloud/instances/flavor_list_for_resize_params.py +16 -0
- gcore/types/cloud/instances/flavor_list_params.py +25 -0
- gcore/types/cloud/instances/flavor_list_suitable_params.py +56 -0
- gcore/types/cloud/instances/image_create_from_volume_params.py +53 -0
- gcore/types/cloud/instances/image_get_params.py +16 -0
- gcore/types/cloud/instances/image_list_params.py +33 -0
- gcore/types/cloud/instances/image_update_params.py +43 -0
- gcore/types/cloud/instances/image_upload_params.py +62 -0
- gcore/types/cloud/instances/instance_flavor.py +49 -0
- gcore/types/cloud/instances/instance_flavor_list.py +16 -0
- gcore/types/cloud/instances/interface_attach_params.py +253 -0
- gcore/types/cloud/instances/interface_detach_params.py +19 -0
- gcore/types/cloud/instances/metric_list_params.py +23 -0
- gcore/types/cloud/instances/metrics.py +52 -0
- gcore/types/cloud/instances/metrics_list.py +16 -0
- gcore/types/cloud/interface_ip_family.py +7 -0
- gcore/types/cloud/ip_assignment.py +13 -0
- gcore/types/cloud/ip_ranges.py +12 -0
- gcore/types/cloud/ip_version.py +7 -0
- gcore/types/cloud/laas_index_retention_policy.py +12 -0
- gcore/types/cloud/laas_index_retention_policy_param.py +13 -0
- gcore/types/cloud/lb_algorithm.py +7 -0
- gcore/types/cloud/lb_health_monitor_type.py +7 -0
- gcore/types/cloud/lb_listener_protocol.py +7 -0
- gcore/types/cloud/lb_pool_protocol.py +7 -0
- gcore/types/cloud/lb_session_persistence_type.py +7 -0
- gcore/types/cloud/listener_status.py +27 -0
- gcore/types/cloud/load_balancer.py +144 -0
- gcore/types/cloud/load_balancer_create_params.py +327 -0
- gcore/types/cloud/load_balancer_failover_params.py +16 -0
- gcore/types/cloud/load_balancer_flavor_detail.py +40 -0
- gcore/types/cloud/load_balancer_flavor_list.py +16 -0
- gcore/types/cloud/load_balancer_get_params.py +19 -0
- gcore/types/cloud/load_balancer_instance_role.py +7 -0
- gcore/types/cloud/load_balancer_l7_policy.py +86 -0
- gcore/types/cloud/load_balancer_l7_policy_list.py +16 -0
- gcore/types/cloud/load_balancer_l7_rule.py +72 -0
- gcore/types/cloud/load_balancer_l7_rule_list.py +16 -0
- gcore/types/cloud/load_balancer_list_params.py +53 -0
- gcore/types/cloud/load_balancer_listener_detail.py +97 -0
- gcore/types/cloud/load_balancer_listener_list.py +16 -0
- gcore/types/cloud/load_balancer_member_connectivity.py +7 -0
- gcore/types/cloud/load_balancer_metrics.py +32 -0
- gcore/types/cloud/load_balancer_metrics_list.py +16 -0
- gcore/types/cloud/load_balancer_operating_status.py +7 -0
- gcore/types/cloud/load_balancer_pool.py +87 -0
- gcore/types/cloud/load_balancer_pool_list.py +16 -0
- gcore/types/cloud/load_balancer_resize_params.py +16 -0
- gcore/types/cloud/load_balancer_statistics.py +22 -0
- gcore/types/cloud/load_balancer_status.py +38 -0
- gcore/types/cloud/load_balancer_status_list.py +16 -0
- gcore/types/cloud/load_balancer_update_params.py +43 -0
- gcore/types/cloud/load_balancers/__init__.py +15 -0
- gcore/types/cloud/load_balancers/flavor_list_params.py +16 -0
- gcore/types/cloud/load_balancers/l7_policies/__init__.py +6 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +50 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +43 -0
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +54 -0
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +51 -0
- gcore/types/cloud/load_balancers/listener_create_params.py +72 -0
- gcore/types/cloud/load_balancers/listener_get_params.py +16 -0
- gcore/types/cloud/load_balancers/listener_list_params.py +19 -0
- gcore/types/cloud/load_balancers/listener_update_params.py +55 -0
- gcore/types/cloud/load_balancers/metric_list_params.py +21 -0
- gcore/types/cloud/load_balancers/pool_create_params.py +141 -0
- gcore/types/cloud/load_balancers/pool_list_params.py +25 -0
- gcore/types/cloud/load_balancers/pool_update_params.py +139 -0
- gcore/types/cloud/load_balancers/pools/__init__.py +6 -0
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +49 -0
- gcore/types/cloud/load_balancers/pools/member_add_params.py +44 -0
- gcore/types/cloud/logging.py +22 -0
- gcore/types/cloud/member.py +47 -0
- gcore/types/cloud/member_status.py +24 -0
- gcore/types/cloud/network.py +79 -0
- gcore/types/cloud/network_create_params.py +36 -0
- gcore/types/cloud/network_details.py +80 -0
- gcore/types/cloud/network_interface.py +78 -0
- gcore/types/cloud/network_interface_list.py +16 -0
- gcore/types/cloud/network_list_params.py +41 -0
- gcore/types/cloud/network_update_params.py +18 -0
- gcore/types/cloud/networks/__init__.py +14 -0
- gcore/types/cloud/networks/router.py +83 -0
- gcore/types/cloud/networks/router_attach_subnet_params.py +24 -0
- gcore/types/cloud/networks/router_create_params.py +75 -0
- gcore/types/cloud/networks/router_detach_subnet_params.py +16 -0
- gcore/types/cloud/networks/router_list.py +16 -0
- gcore/types/cloud/networks/router_list_params.py +19 -0
- gcore/types/cloud/networks/router_update_params.py +45 -0
- gcore/types/cloud/networks/subnet_create_params.py +82 -0
- gcore/types/cloud/networks/subnet_list_params.py +58 -0
- gcore/types/cloud/networks/subnet_update_params.py +47 -0
- gcore/types/cloud/placement_group.py +41 -0
- gcore/types/cloud/placement_group_create_params.py +19 -0
- gcore/types/cloud/placement_group_list.py +16 -0
- gcore/types/cloud/pool_status.py +31 -0
- gcore/types/cloud/project.py +47 -0
- gcore/types/cloud/project_create_params.py +22 -0
- gcore/types/cloud/project_list_params.py +27 -0
- gcore/types/cloud/project_replace_params.py +18 -0
- gcore/types/cloud/provisioning_status.py +9 -0
- gcore/types/cloud/quota_get_all_response.py +340 -0
- gcore/types/cloud/quota_get_by_region_response.py +288 -0
- gcore/types/cloud/quota_get_global_response.py +51 -0
- gcore/types/cloud/quotas/__init__.py +8 -0
- gcore/types/cloud/quotas/request_create_params.py +193 -0
- gcore/types/cloud/quotas/request_get_response.py +205 -0
- gcore/types/cloud/quotas/request_list_params.py +22 -0
- gcore/types/cloud/quotas/request_list_response.py +205 -0
- gcore/types/cloud/region.py +101 -0
- gcore/types/cloud/region_capacity.py +16 -0
- gcore/types/cloud/region_capacity_list.py +16 -0
- gcore/types/cloud/region_get_params.py +18 -0
- gcore/types/cloud/region_list_params.py +31 -0
- gcore/types/cloud/registries/__init__.py +14 -0
- gcore/types/cloud/registries/registry_artifact.py +35 -0
- gcore/types/cloud/registries/registry_artifact_list.py +16 -0
- gcore/types/cloud/registries/registry_repository.py +30 -0
- gcore/types/cloud/registries/registry_repository_list.py +16 -0
- gcore/types/cloud/registries/registry_user.py +28 -0
- gcore/types/cloud/registries/registry_user_created.py +31 -0
- gcore/types/cloud/registries/registry_user_list.py +16 -0
- gcore/types/cloud/registries/user_create_multiple_params.py +36 -0
- gcore/types/cloud/registries/user_create_params.py +30 -0
- gcore/types/cloud/registries/user_update_params.py +21 -0
- gcore/types/cloud/registry.py +33 -0
- gcore/types/cloud/registry_create_params.py +24 -0
- gcore/types/cloud/registry_list.py +16 -0
- gcore/types/cloud/registry_resize_params.py +16 -0
- gcore/types/cloud/registry_tag.py +27 -0
- gcore/types/cloud/reserved_fixed_ip.py +98 -0
- gcore/types/cloud/reserved_fixed_ip_create_params.py +107 -0
- gcore/types/cloud/reserved_fixed_ip_list_params.py +47 -0
- gcore/types/cloud/reserved_fixed_ips/__init__.py +12 -0
- gcore/types/cloud/reserved_fixed_ips/candidate_port.py +26 -0
- gcore/types/cloud/reserved_fixed_ips/candidate_port_list.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/connected_port.py +26 -0
- gcore/types/cloud/reserved_fixed_ips/connected_port_list.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/ip_with_subnet.py +17 -0
- gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +17 -0
- gcore/types/cloud/reserved_fixed_ips/vip_toggle_params.py +16 -0
- gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +17 -0
- gcore/types/cloud/route.py +16 -0
- gcore/types/cloud/secret.py +64 -0
- gcore/types/cloud/secret_create_params.py +66 -0
- gcore/types/cloud/secret_list_response.py +16 -0
- gcore/types/cloud/secret_upload_tls_certificate_params.py +39 -0
- gcore/types/cloud/security_group.py +45 -0
- gcore/types/cloud/security_group_copy_params.py +16 -0
- gcore/types/cloud/security_group_create_params.py +94 -0
- gcore/types/cloud/security_group_list_params.py +30 -0
- gcore/types/cloud/security_group_rule.py +83 -0
- gcore/types/cloud/security_group_update_params.py +83 -0
- gcore/types/cloud/security_groups/__init__.py +6 -0
- gcore/types/cloud/security_groups/rule_create_params.py +65 -0
- gcore/types/cloud/security_groups/rule_replace_params.py +72 -0
- gcore/types/cloud/session_persistence.py +22 -0
- gcore/types/cloud/ssh_key.py +39 -0
- gcore/types/cloud/ssh_key_create_params.py +31 -0
- gcore/types/cloud/ssh_key_created.py +53 -0
- gcore/types/cloud/ssh_key_list_params.py +21 -0
- gcore/types/cloud/ssh_key_update_params.py +15 -0
- gcore/types/cloud/subnet.py +87 -0
- gcore/types/cloud/tag.py +16 -0
- gcore/types/cloud/tag_update_map_param.py +10 -0
- gcore/types/cloud/task.py +191 -0
- gcore/types/cloud/task_acknowledge_all_params.py +16 -0
- gcore/types/cloud/task_id_list.py +12 -0
- gcore/types/cloud/task_list_params.py +104 -0
- gcore/types/cloud/users/__init__.py +9 -0
- gcore/types/cloud/users/role_assignment.py +33 -0
- gcore/types/cloud/users/role_assignment_create_params.py +22 -0
- gcore/types/cloud/users/role_assignment_list_params.py +25 -0
- gcore/types/cloud/users/role_assignment_update_delete.py +10 -0
- gcore/types/cloud/users/role_assignment_update_params.py +22 -0
- gcore/types/cloud/volume.py +141 -0
- gcore/types/cloud/volume_attach_to_instance_params.py +21 -0
- gcore/types/cloud/volume_change_type_params.py +18 -0
- gcore/types/cloud/volume_create_params.py +176 -0
- gcore/types/cloud/volume_delete_params.py +18 -0
- gcore/types/cloud/volume_detach_from_instance_params.py +18 -0
- gcore/types/cloud/volume_list_params.py +56 -0
- gcore/types/cloud/volume_resize_params.py +18 -0
- gcore/types/cloud/volume_update_params.py +18 -0
- gcore/types/waap/__init__.py +12 -0
- gcore/types/waap/domain_list_params.py +30 -0
- gcore/types/waap/domain_update_params.py +12 -0
- gcore/types/waap/domains/__init__.py +5 -0
- gcore/types/waap/domains/setting_update_params.py +41 -0
- gcore/types/waap/waap_api_urls.py +15 -0
- gcore/types/waap/waap_detailed_domain.py +37 -0
- gcore/types/waap/waap_domain_ddos_settings.py +31 -0
- gcore/types/waap/waap_domain_settings.py +15 -0
- gcore/types/waap/waap_domain_status.py +7 -0
- gcore/types/waap/waap_summary_domain.py +26 -0
- gcore-0.1.0.dist-info/METADATA +482 -0
- gcore-0.1.0.dist-info/RECORD +437 -0
- gcore-0.1.0.dist-info/WHEEL +4 -0
- gcore-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,1036 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List
|
|
6
|
+
from typing_extensions import Literal
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ....._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from ....._compat import cached_property
|
|
13
|
+
from ....._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from ....._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ....._base_client import make_request_options
|
|
21
|
+
from .....types.cloud.task_id_list import TaskIDList
|
|
22
|
+
from .....types.cloud.load_balancer_l7_rule import LoadBalancerL7Rule
|
|
23
|
+
from .....types.cloud.load_balancer_l7_rule_list import LoadBalancerL7RuleList
|
|
24
|
+
from .....types.cloud.load_balancers.l7_policies import rule_create_params, rule_replace_params
|
|
25
|
+
|
|
26
|
+
__all__ = ["RulesResource", "AsyncRulesResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RulesResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> RulesResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return RulesResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> RulesResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return RulesResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def create(
|
|
50
|
+
self,
|
|
51
|
+
l7policy_id: str,
|
|
52
|
+
*,
|
|
53
|
+
project_id: int | None = None,
|
|
54
|
+
region_id: int | None = None,
|
|
55
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
56
|
+
type: Literal[
|
|
57
|
+
"COOKIE",
|
|
58
|
+
"FILE_TYPE",
|
|
59
|
+
"HEADER",
|
|
60
|
+
"HOST_NAME",
|
|
61
|
+
"PATH",
|
|
62
|
+
"SSL_CONN_HAS_CERT",
|
|
63
|
+
"SSL_DN_FIELD",
|
|
64
|
+
"SSL_VERIFY_RESULT",
|
|
65
|
+
],
|
|
66
|
+
value: str,
|
|
67
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
68
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
69
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
70
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
71
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
72
|
+
extra_headers: Headers | None = None,
|
|
73
|
+
extra_query: Query | None = None,
|
|
74
|
+
extra_body: Body | None = None,
|
|
75
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
76
|
+
) -> TaskIDList:
|
|
77
|
+
"""
|
|
78
|
+
Create load balancer L7 rule
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
compare_type: The comparison type for the L7 rule
|
|
82
|
+
|
|
83
|
+
type: The L7 rule type
|
|
84
|
+
|
|
85
|
+
value: The value to use for the comparison. For example, the file type to compare
|
|
86
|
+
|
|
87
|
+
invert: When true the logic of the rule is inverted. For example, with invert true,
|
|
88
|
+
'equal to' would become 'not equal to'. Default is false.
|
|
89
|
+
|
|
90
|
+
key: The key to use for the comparison. For example, the name of the cookie to
|
|
91
|
+
evaluate.
|
|
92
|
+
|
|
93
|
+
tags: A list of simple strings assigned to the l7 rule
|
|
94
|
+
|
|
95
|
+
extra_headers: Send extra headers
|
|
96
|
+
|
|
97
|
+
extra_query: Add additional query parameters to the request
|
|
98
|
+
|
|
99
|
+
extra_body: Add additional JSON properties to the request
|
|
100
|
+
|
|
101
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
102
|
+
"""
|
|
103
|
+
if project_id is None:
|
|
104
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
105
|
+
if region_id is None:
|
|
106
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
107
|
+
if not l7policy_id:
|
|
108
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
109
|
+
return self._post(
|
|
110
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules",
|
|
111
|
+
body=maybe_transform(
|
|
112
|
+
{
|
|
113
|
+
"compare_type": compare_type,
|
|
114
|
+
"type": type,
|
|
115
|
+
"value": value,
|
|
116
|
+
"invert": invert,
|
|
117
|
+
"key": key,
|
|
118
|
+
"tags": tags,
|
|
119
|
+
},
|
|
120
|
+
rule_create_params.RuleCreateParams,
|
|
121
|
+
),
|
|
122
|
+
options=make_request_options(
|
|
123
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
124
|
+
),
|
|
125
|
+
cast_to=TaskIDList,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
def list(
|
|
129
|
+
self,
|
|
130
|
+
l7policy_id: str,
|
|
131
|
+
*,
|
|
132
|
+
project_id: int | None = None,
|
|
133
|
+
region_id: int | None = None,
|
|
134
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
135
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
136
|
+
extra_headers: Headers | None = None,
|
|
137
|
+
extra_query: Query | None = None,
|
|
138
|
+
extra_body: Body | None = None,
|
|
139
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
140
|
+
) -> LoadBalancerL7RuleList:
|
|
141
|
+
"""
|
|
142
|
+
List load balancer L7 policy rules
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
extra_headers: Send extra headers
|
|
146
|
+
|
|
147
|
+
extra_query: Add additional query parameters to the request
|
|
148
|
+
|
|
149
|
+
extra_body: Add additional JSON properties to the request
|
|
150
|
+
|
|
151
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
152
|
+
"""
|
|
153
|
+
if project_id is None:
|
|
154
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
155
|
+
if region_id is None:
|
|
156
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
157
|
+
if not l7policy_id:
|
|
158
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
159
|
+
return self._get(
|
|
160
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules",
|
|
161
|
+
options=make_request_options(
|
|
162
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
163
|
+
),
|
|
164
|
+
cast_to=LoadBalancerL7RuleList,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
def delete(
|
|
168
|
+
self,
|
|
169
|
+
l7rule_id: str,
|
|
170
|
+
*,
|
|
171
|
+
project_id: int | None = None,
|
|
172
|
+
region_id: int | None = None,
|
|
173
|
+
l7policy_id: str,
|
|
174
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
175
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
176
|
+
extra_headers: Headers | None = None,
|
|
177
|
+
extra_query: Query | None = None,
|
|
178
|
+
extra_body: Body | None = None,
|
|
179
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
180
|
+
) -> TaskIDList:
|
|
181
|
+
"""
|
|
182
|
+
Delete load balancer L7 rule
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
extra_headers: Send extra headers
|
|
186
|
+
|
|
187
|
+
extra_query: Add additional query parameters to the request
|
|
188
|
+
|
|
189
|
+
extra_body: Add additional JSON properties to the request
|
|
190
|
+
|
|
191
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
192
|
+
"""
|
|
193
|
+
if project_id is None:
|
|
194
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
195
|
+
if region_id is None:
|
|
196
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
197
|
+
if not l7policy_id:
|
|
198
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
199
|
+
if not l7rule_id:
|
|
200
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
201
|
+
return self._delete(
|
|
202
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
203
|
+
options=make_request_options(
|
|
204
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
205
|
+
),
|
|
206
|
+
cast_to=TaskIDList,
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
def get(
|
|
210
|
+
self,
|
|
211
|
+
l7rule_id: str,
|
|
212
|
+
*,
|
|
213
|
+
project_id: int | None = None,
|
|
214
|
+
region_id: int | None = None,
|
|
215
|
+
l7policy_id: str,
|
|
216
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
217
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
218
|
+
extra_headers: Headers | None = None,
|
|
219
|
+
extra_query: Query | None = None,
|
|
220
|
+
extra_body: Body | None = None,
|
|
221
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
222
|
+
) -> LoadBalancerL7Rule:
|
|
223
|
+
"""
|
|
224
|
+
Get load balancer L7 rule
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
extra_headers: Send extra headers
|
|
228
|
+
|
|
229
|
+
extra_query: Add additional query parameters to the request
|
|
230
|
+
|
|
231
|
+
extra_body: Add additional JSON properties to the request
|
|
232
|
+
|
|
233
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
234
|
+
"""
|
|
235
|
+
if project_id is None:
|
|
236
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
237
|
+
if region_id is None:
|
|
238
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
239
|
+
if not l7policy_id:
|
|
240
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
241
|
+
if not l7rule_id:
|
|
242
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
243
|
+
return self._get(
|
|
244
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
245
|
+
options=make_request_options(
|
|
246
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
247
|
+
),
|
|
248
|
+
cast_to=LoadBalancerL7Rule,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
def replace(
|
|
252
|
+
self,
|
|
253
|
+
l7rule_id: str,
|
|
254
|
+
*,
|
|
255
|
+
project_id: int | None = None,
|
|
256
|
+
region_id: int | None = None,
|
|
257
|
+
l7policy_id: str,
|
|
258
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"] | NotGiven = NOT_GIVEN,
|
|
259
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
260
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
261
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
262
|
+
type: Literal[
|
|
263
|
+
"COOKIE",
|
|
264
|
+
"FILE_TYPE",
|
|
265
|
+
"HEADER",
|
|
266
|
+
"HOST_NAME",
|
|
267
|
+
"PATH",
|
|
268
|
+
"SSL_CONN_HAS_CERT",
|
|
269
|
+
"SSL_DN_FIELD",
|
|
270
|
+
"SSL_VERIFY_RESULT",
|
|
271
|
+
]
|
|
272
|
+
| NotGiven = NOT_GIVEN,
|
|
273
|
+
value: str | NotGiven = NOT_GIVEN,
|
|
274
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
275
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
276
|
+
extra_headers: Headers | None = None,
|
|
277
|
+
extra_query: Query | None = None,
|
|
278
|
+
extra_body: Body | None = None,
|
|
279
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
280
|
+
) -> TaskIDList:
|
|
281
|
+
"""
|
|
282
|
+
Replace load balancer L7 rule properties
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
compare_type: The comparison type for the L7 rule
|
|
286
|
+
|
|
287
|
+
invert: When true the logic of the rule is inverted. For example, with invert true,
|
|
288
|
+
'equal to' would become 'not equal to'. Default is false.
|
|
289
|
+
|
|
290
|
+
key: The key to use for the comparison. For example, the name of the cookie to
|
|
291
|
+
evaluate.
|
|
292
|
+
|
|
293
|
+
tags: A list of simple strings assigned to the l7 rule
|
|
294
|
+
|
|
295
|
+
type: The L7 rule type
|
|
296
|
+
|
|
297
|
+
value: The value to use for the comparison. For example, the file type to compare
|
|
298
|
+
|
|
299
|
+
extra_headers: Send extra headers
|
|
300
|
+
|
|
301
|
+
extra_query: Add additional query parameters to the request
|
|
302
|
+
|
|
303
|
+
extra_body: Add additional JSON properties to the request
|
|
304
|
+
|
|
305
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
306
|
+
"""
|
|
307
|
+
if project_id is None:
|
|
308
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
309
|
+
if region_id is None:
|
|
310
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
311
|
+
if not l7policy_id:
|
|
312
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
313
|
+
if not l7rule_id:
|
|
314
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
315
|
+
return self._put(
|
|
316
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
317
|
+
body=maybe_transform(
|
|
318
|
+
{
|
|
319
|
+
"compare_type": compare_type,
|
|
320
|
+
"invert": invert,
|
|
321
|
+
"key": key,
|
|
322
|
+
"tags": tags,
|
|
323
|
+
"type": type,
|
|
324
|
+
"value": value,
|
|
325
|
+
},
|
|
326
|
+
rule_replace_params.RuleReplaceParams,
|
|
327
|
+
),
|
|
328
|
+
options=make_request_options(
|
|
329
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
330
|
+
),
|
|
331
|
+
cast_to=TaskIDList,
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
def create_and_poll(
|
|
335
|
+
self,
|
|
336
|
+
l7policy_id: str,
|
|
337
|
+
*,
|
|
338
|
+
project_id: int | None = None,
|
|
339
|
+
region_id: int | None = None,
|
|
340
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
341
|
+
type: Literal[
|
|
342
|
+
"COOKIE",
|
|
343
|
+
"FILE_TYPE",
|
|
344
|
+
"HEADER",
|
|
345
|
+
"HOST_NAME",
|
|
346
|
+
"PATH",
|
|
347
|
+
"SSL_CONN_HAS_CERT",
|
|
348
|
+
"SSL_DN_FIELD",
|
|
349
|
+
"SSL_VERIFY_RESULT",
|
|
350
|
+
],
|
|
351
|
+
value: str,
|
|
352
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
353
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
354
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
355
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
356
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
357
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
358
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
359
|
+
extra_headers: Headers | None = None,
|
|
360
|
+
extra_query: Query | None = None,
|
|
361
|
+
extra_body: Body | None = None,
|
|
362
|
+
) -> LoadBalancerL7Rule:
|
|
363
|
+
response = self.create(
|
|
364
|
+
l7policy_id=l7policy_id,
|
|
365
|
+
project_id=project_id,
|
|
366
|
+
region_id=region_id,
|
|
367
|
+
compare_type=compare_type,
|
|
368
|
+
type=type,
|
|
369
|
+
value=value,
|
|
370
|
+
invert=invert,
|
|
371
|
+
key=key,
|
|
372
|
+
tags=tags,
|
|
373
|
+
extra_headers=extra_headers,
|
|
374
|
+
extra_query=extra_query,
|
|
375
|
+
extra_body=extra_body,
|
|
376
|
+
timeout=timeout,
|
|
377
|
+
)
|
|
378
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
379
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
380
|
+
task = self._client.cloud.tasks.poll(
|
|
381
|
+
task_id=response.tasks[0],
|
|
382
|
+
extra_headers=extra_headers,
|
|
383
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
384
|
+
)
|
|
385
|
+
if not task.created_resources or not task.created_resources.l7rules or len(task.created_resources.l7rules) != 1:
|
|
386
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
387
|
+
return self.get(
|
|
388
|
+
l7rule_id=task.created_resources.l7rules[0],
|
|
389
|
+
project_id=project_id,
|
|
390
|
+
region_id=region_id,
|
|
391
|
+
l7policy_id=l7policy_id,
|
|
392
|
+
extra_headers=extra_headers,
|
|
393
|
+
timeout=timeout,
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
def delete_and_poll(
|
|
397
|
+
self,
|
|
398
|
+
l7rule_id: str,
|
|
399
|
+
*,
|
|
400
|
+
project_id: int | None = None,
|
|
401
|
+
region_id: int | None = None,
|
|
402
|
+
l7policy_id: str,
|
|
403
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
404
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
405
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
406
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
407
|
+
extra_headers: Headers | None = None,
|
|
408
|
+
extra_query: Query | None = None,
|
|
409
|
+
extra_body: Body | None = None,
|
|
410
|
+
) -> None:
|
|
411
|
+
response = self.delete(
|
|
412
|
+
l7rule_id=l7rule_id,
|
|
413
|
+
project_id=project_id,
|
|
414
|
+
region_id=region_id,
|
|
415
|
+
l7policy_id=l7policy_id,
|
|
416
|
+
extra_headers=extra_headers,
|
|
417
|
+
extra_query=extra_query,
|
|
418
|
+
extra_body=extra_body,
|
|
419
|
+
timeout=timeout,
|
|
420
|
+
)
|
|
421
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
422
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
423
|
+
self._client.cloud.tasks.poll(
|
|
424
|
+
task_id=response.tasks[0],
|
|
425
|
+
extra_headers=extra_headers,
|
|
426
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
def replace_and_poll(
|
|
430
|
+
self,
|
|
431
|
+
l7rule_id: str,
|
|
432
|
+
*,
|
|
433
|
+
project_id: int | None = None,
|
|
434
|
+
region_id: int | None = None,
|
|
435
|
+
l7policy_id: str,
|
|
436
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
437
|
+
type: Literal[
|
|
438
|
+
"COOKIE",
|
|
439
|
+
"FILE_TYPE",
|
|
440
|
+
"HEADER",
|
|
441
|
+
"HOST_NAME",
|
|
442
|
+
"PATH",
|
|
443
|
+
"SSL_CONN_HAS_CERT",
|
|
444
|
+
"SSL_DN_FIELD",
|
|
445
|
+
"SSL_VERIFY_RESULT",
|
|
446
|
+
],
|
|
447
|
+
value: str,
|
|
448
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
449
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
450
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
451
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
452
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
453
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
454
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
455
|
+
extra_headers: Headers | None = None,
|
|
456
|
+
extra_query: Query | None = None,
|
|
457
|
+
extra_body: Body | None = None,
|
|
458
|
+
) -> LoadBalancerL7Rule:
|
|
459
|
+
response = self.replace(
|
|
460
|
+
l7rule_id=l7rule_id,
|
|
461
|
+
project_id=project_id,
|
|
462
|
+
region_id=region_id,
|
|
463
|
+
l7policy_id=l7policy_id,
|
|
464
|
+
compare_type=compare_type,
|
|
465
|
+
type=type,
|
|
466
|
+
value=value,
|
|
467
|
+
invert=invert,
|
|
468
|
+
key=key,
|
|
469
|
+
tags=tags,
|
|
470
|
+
extra_headers=extra_headers,
|
|
471
|
+
extra_query=extra_query,
|
|
472
|
+
extra_body=extra_body,
|
|
473
|
+
timeout=timeout,
|
|
474
|
+
)
|
|
475
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
476
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
477
|
+
self._client.cloud.tasks.poll(
|
|
478
|
+
task_id=response.tasks[0],
|
|
479
|
+
extra_headers=extra_headers,
|
|
480
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
481
|
+
)
|
|
482
|
+
return self.get(
|
|
483
|
+
l7rule_id=l7rule_id,
|
|
484
|
+
project_id=project_id,
|
|
485
|
+
region_id=region_id,
|
|
486
|
+
l7policy_id=l7policy_id,
|
|
487
|
+
extra_headers=extra_headers,
|
|
488
|
+
timeout=timeout,
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
class AsyncRulesResource(AsyncAPIResource):
|
|
493
|
+
@cached_property
|
|
494
|
+
def with_raw_response(self) -> AsyncRulesResourceWithRawResponse:
|
|
495
|
+
"""
|
|
496
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
497
|
+
the raw response object instead of the parsed content.
|
|
498
|
+
|
|
499
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
500
|
+
"""
|
|
501
|
+
return AsyncRulesResourceWithRawResponse(self)
|
|
502
|
+
|
|
503
|
+
@cached_property
|
|
504
|
+
def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse:
|
|
505
|
+
"""
|
|
506
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
507
|
+
|
|
508
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
509
|
+
"""
|
|
510
|
+
return AsyncRulesResourceWithStreamingResponse(self)
|
|
511
|
+
|
|
512
|
+
async def create(
|
|
513
|
+
self,
|
|
514
|
+
l7policy_id: str,
|
|
515
|
+
*,
|
|
516
|
+
project_id: int | None = None,
|
|
517
|
+
region_id: int | None = None,
|
|
518
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
519
|
+
type: Literal[
|
|
520
|
+
"COOKIE",
|
|
521
|
+
"FILE_TYPE",
|
|
522
|
+
"HEADER",
|
|
523
|
+
"HOST_NAME",
|
|
524
|
+
"PATH",
|
|
525
|
+
"SSL_CONN_HAS_CERT",
|
|
526
|
+
"SSL_DN_FIELD",
|
|
527
|
+
"SSL_VERIFY_RESULT",
|
|
528
|
+
],
|
|
529
|
+
value: str,
|
|
530
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
531
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
532
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
533
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
534
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
535
|
+
extra_headers: Headers | None = None,
|
|
536
|
+
extra_query: Query | None = None,
|
|
537
|
+
extra_body: Body | None = None,
|
|
538
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
539
|
+
) -> TaskIDList:
|
|
540
|
+
"""
|
|
541
|
+
Create load balancer L7 rule
|
|
542
|
+
|
|
543
|
+
Args:
|
|
544
|
+
compare_type: The comparison type for the L7 rule
|
|
545
|
+
|
|
546
|
+
type: The L7 rule type
|
|
547
|
+
|
|
548
|
+
value: The value to use for the comparison. For example, the file type to compare
|
|
549
|
+
|
|
550
|
+
invert: When true the logic of the rule is inverted. For example, with invert true,
|
|
551
|
+
'equal to' would become 'not equal to'. Default is false.
|
|
552
|
+
|
|
553
|
+
key: The key to use for the comparison. For example, the name of the cookie to
|
|
554
|
+
evaluate.
|
|
555
|
+
|
|
556
|
+
tags: A list of simple strings assigned to the l7 rule
|
|
557
|
+
|
|
558
|
+
extra_headers: Send extra headers
|
|
559
|
+
|
|
560
|
+
extra_query: Add additional query parameters to the request
|
|
561
|
+
|
|
562
|
+
extra_body: Add additional JSON properties to the request
|
|
563
|
+
|
|
564
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
565
|
+
"""
|
|
566
|
+
if project_id is None:
|
|
567
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
568
|
+
if region_id is None:
|
|
569
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
570
|
+
if not l7policy_id:
|
|
571
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
572
|
+
return await self._post(
|
|
573
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules",
|
|
574
|
+
body=await async_maybe_transform(
|
|
575
|
+
{
|
|
576
|
+
"compare_type": compare_type,
|
|
577
|
+
"type": type,
|
|
578
|
+
"value": value,
|
|
579
|
+
"invert": invert,
|
|
580
|
+
"key": key,
|
|
581
|
+
"tags": tags,
|
|
582
|
+
},
|
|
583
|
+
rule_create_params.RuleCreateParams,
|
|
584
|
+
),
|
|
585
|
+
options=make_request_options(
|
|
586
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
587
|
+
),
|
|
588
|
+
cast_to=TaskIDList,
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
async def list(
|
|
592
|
+
self,
|
|
593
|
+
l7policy_id: str,
|
|
594
|
+
*,
|
|
595
|
+
project_id: int | None = None,
|
|
596
|
+
region_id: int | None = None,
|
|
597
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
598
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
599
|
+
extra_headers: Headers | None = None,
|
|
600
|
+
extra_query: Query | None = None,
|
|
601
|
+
extra_body: Body | None = None,
|
|
602
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
603
|
+
) -> LoadBalancerL7RuleList:
|
|
604
|
+
"""
|
|
605
|
+
List load balancer L7 policy rules
|
|
606
|
+
|
|
607
|
+
Args:
|
|
608
|
+
extra_headers: Send extra headers
|
|
609
|
+
|
|
610
|
+
extra_query: Add additional query parameters to the request
|
|
611
|
+
|
|
612
|
+
extra_body: Add additional JSON properties to the request
|
|
613
|
+
|
|
614
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
615
|
+
"""
|
|
616
|
+
if project_id is None:
|
|
617
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
618
|
+
if region_id is None:
|
|
619
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
620
|
+
if not l7policy_id:
|
|
621
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
622
|
+
return await self._get(
|
|
623
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules",
|
|
624
|
+
options=make_request_options(
|
|
625
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
626
|
+
),
|
|
627
|
+
cast_to=LoadBalancerL7RuleList,
|
|
628
|
+
)
|
|
629
|
+
|
|
630
|
+
async def delete(
|
|
631
|
+
self,
|
|
632
|
+
l7rule_id: str,
|
|
633
|
+
*,
|
|
634
|
+
project_id: int | None = None,
|
|
635
|
+
region_id: int | None = None,
|
|
636
|
+
l7policy_id: str,
|
|
637
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
638
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
639
|
+
extra_headers: Headers | None = None,
|
|
640
|
+
extra_query: Query | None = None,
|
|
641
|
+
extra_body: Body | None = None,
|
|
642
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
643
|
+
) -> TaskIDList:
|
|
644
|
+
"""
|
|
645
|
+
Delete load balancer L7 rule
|
|
646
|
+
|
|
647
|
+
Args:
|
|
648
|
+
extra_headers: Send extra headers
|
|
649
|
+
|
|
650
|
+
extra_query: Add additional query parameters to the request
|
|
651
|
+
|
|
652
|
+
extra_body: Add additional JSON properties to the request
|
|
653
|
+
|
|
654
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
655
|
+
"""
|
|
656
|
+
if project_id is None:
|
|
657
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
658
|
+
if region_id is None:
|
|
659
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
660
|
+
if not l7policy_id:
|
|
661
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
662
|
+
if not l7rule_id:
|
|
663
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
664
|
+
return await self._delete(
|
|
665
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
666
|
+
options=make_request_options(
|
|
667
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
668
|
+
),
|
|
669
|
+
cast_to=TaskIDList,
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
async def get(
|
|
673
|
+
self,
|
|
674
|
+
l7rule_id: str,
|
|
675
|
+
*,
|
|
676
|
+
project_id: int | None = None,
|
|
677
|
+
region_id: int | None = None,
|
|
678
|
+
l7policy_id: str,
|
|
679
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
680
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
681
|
+
extra_headers: Headers | None = None,
|
|
682
|
+
extra_query: Query | None = None,
|
|
683
|
+
extra_body: Body | None = None,
|
|
684
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
685
|
+
) -> LoadBalancerL7Rule:
|
|
686
|
+
"""
|
|
687
|
+
Get load balancer L7 rule
|
|
688
|
+
|
|
689
|
+
Args:
|
|
690
|
+
extra_headers: Send extra headers
|
|
691
|
+
|
|
692
|
+
extra_query: Add additional query parameters to the request
|
|
693
|
+
|
|
694
|
+
extra_body: Add additional JSON properties to the request
|
|
695
|
+
|
|
696
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
697
|
+
"""
|
|
698
|
+
if project_id is None:
|
|
699
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
700
|
+
if region_id is None:
|
|
701
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
702
|
+
if not l7policy_id:
|
|
703
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
704
|
+
if not l7rule_id:
|
|
705
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
706
|
+
return await self._get(
|
|
707
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
708
|
+
options=make_request_options(
|
|
709
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
710
|
+
),
|
|
711
|
+
cast_to=LoadBalancerL7Rule,
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
async def replace(
|
|
715
|
+
self,
|
|
716
|
+
l7rule_id: str,
|
|
717
|
+
*,
|
|
718
|
+
project_id: int | None = None,
|
|
719
|
+
region_id: int | None = None,
|
|
720
|
+
l7policy_id: str,
|
|
721
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"] | NotGiven = NOT_GIVEN,
|
|
722
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
723
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
724
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
725
|
+
type: Literal[
|
|
726
|
+
"COOKIE",
|
|
727
|
+
"FILE_TYPE",
|
|
728
|
+
"HEADER",
|
|
729
|
+
"HOST_NAME",
|
|
730
|
+
"PATH",
|
|
731
|
+
"SSL_CONN_HAS_CERT",
|
|
732
|
+
"SSL_DN_FIELD",
|
|
733
|
+
"SSL_VERIFY_RESULT",
|
|
734
|
+
]
|
|
735
|
+
| NotGiven = NOT_GIVEN,
|
|
736
|
+
value: str | NotGiven = NOT_GIVEN,
|
|
737
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
738
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
739
|
+
extra_headers: Headers | None = None,
|
|
740
|
+
extra_query: Query | None = None,
|
|
741
|
+
extra_body: Body | None = None,
|
|
742
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
743
|
+
) -> TaskIDList:
|
|
744
|
+
"""
|
|
745
|
+
Replace load balancer L7 rule properties
|
|
746
|
+
|
|
747
|
+
Args:
|
|
748
|
+
compare_type: The comparison type for the L7 rule
|
|
749
|
+
|
|
750
|
+
invert: When true the logic of the rule is inverted. For example, with invert true,
|
|
751
|
+
'equal to' would become 'not equal to'. Default is false.
|
|
752
|
+
|
|
753
|
+
key: The key to use for the comparison. For example, the name of the cookie to
|
|
754
|
+
evaluate.
|
|
755
|
+
|
|
756
|
+
tags: A list of simple strings assigned to the l7 rule
|
|
757
|
+
|
|
758
|
+
type: The L7 rule type
|
|
759
|
+
|
|
760
|
+
value: The value to use for the comparison. For example, the file type to compare
|
|
761
|
+
|
|
762
|
+
extra_headers: Send extra headers
|
|
763
|
+
|
|
764
|
+
extra_query: Add additional query parameters to the request
|
|
765
|
+
|
|
766
|
+
extra_body: Add additional JSON properties to the request
|
|
767
|
+
|
|
768
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
769
|
+
"""
|
|
770
|
+
if project_id is None:
|
|
771
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
772
|
+
if region_id is None:
|
|
773
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
774
|
+
if not l7policy_id:
|
|
775
|
+
raise ValueError(f"Expected a non-empty value for `l7policy_id` but received {l7policy_id!r}")
|
|
776
|
+
if not l7rule_id:
|
|
777
|
+
raise ValueError(f"Expected a non-empty value for `l7rule_id` but received {l7rule_id!r}")
|
|
778
|
+
return await self._put(
|
|
779
|
+
f"/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id}/rules/{l7rule_id}",
|
|
780
|
+
body=await async_maybe_transform(
|
|
781
|
+
{
|
|
782
|
+
"compare_type": compare_type,
|
|
783
|
+
"invert": invert,
|
|
784
|
+
"key": key,
|
|
785
|
+
"tags": tags,
|
|
786
|
+
"type": type,
|
|
787
|
+
"value": value,
|
|
788
|
+
},
|
|
789
|
+
rule_replace_params.RuleReplaceParams,
|
|
790
|
+
),
|
|
791
|
+
options=make_request_options(
|
|
792
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
793
|
+
),
|
|
794
|
+
cast_to=TaskIDList,
|
|
795
|
+
)
|
|
796
|
+
|
|
797
|
+
async def create_and_poll(
|
|
798
|
+
self,
|
|
799
|
+
l7policy_id: str,
|
|
800
|
+
*,
|
|
801
|
+
project_id: int | None = None,
|
|
802
|
+
region_id: int | None = None,
|
|
803
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
804
|
+
type: Literal[
|
|
805
|
+
"COOKIE",
|
|
806
|
+
"FILE_TYPE",
|
|
807
|
+
"HEADER",
|
|
808
|
+
"HOST_NAME",
|
|
809
|
+
"PATH",
|
|
810
|
+
"SSL_CONN_HAS_CERT",
|
|
811
|
+
"SSL_DN_FIELD",
|
|
812
|
+
"SSL_VERIFY_RESULT",
|
|
813
|
+
],
|
|
814
|
+
value: str,
|
|
815
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
816
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
817
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
818
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
819
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
820
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
821
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
822
|
+
extra_headers: Headers | None = None,
|
|
823
|
+
extra_query: Query | None = None,
|
|
824
|
+
extra_body: Body | None = None,
|
|
825
|
+
) -> LoadBalancerL7Rule:
|
|
826
|
+
response = await self.create(
|
|
827
|
+
l7policy_id=l7policy_id,
|
|
828
|
+
project_id=project_id,
|
|
829
|
+
region_id=region_id,
|
|
830
|
+
compare_type=compare_type,
|
|
831
|
+
type=type,
|
|
832
|
+
value=value,
|
|
833
|
+
invert=invert,
|
|
834
|
+
key=key,
|
|
835
|
+
tags=tags,
|
|
836
|
+
extra_headers=extra_headers,
|
|
837
|
+
extra_query=extra_query,
|
|
838
|
+
extra_body=extra_body,
|
|
839
|
+
timeout=timeout,
|
|
840
|
+
)
|
|
841
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
842
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
843
|
+
task = await self._client.cloud.tasks.poll(
|
|
844
|
+
task_id=response.tasks[0],
|
|
845
|
+
extra_headers=extra_headers,
|
|
846
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
847
|
+
)
|
|
848
|
+
if not task.created_resources or not task.created_resources.l7rules or len(task.created_resources.l7rules) != 1:
|
|
849
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
850
|
+
return await self.get(
|
|
851
|
+
l7rule_id=task.created_resources.l7rules[0],
|
|
852
|
+
project_id=project_id,
|
|
853
|
+
region_id=region_id,
|
|
854
|
+
l7policy_id=l7policy_id,
|
|
855
|
+
extra_headers=extra_headers,
|
|
856
|
+
timeout=timeout,
|
|
857
|
+
)
|
|
858
|
+
|
|
859
|
+
async def delete_and_poll(
|
|
860
|
+
self,
|
|
861
|
+
l7rule_id: str,
|
|
862
|
+
*,
|
|
863
|
+
project_id: int | None = None,
|
|
864
|
+
region_id: int | None = None,
|
|
865
|
+
l7policy_id: str,
|
|
866
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
867
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
868
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
869
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
870
|
+
extra_headers: Headers | None = None,
|
|
871
|
+
extra_query: Query | None = None,
|
|
872
|
+
extra_body: Body | None = None,
|
|
873
|
+
) -> None:
|
|
874
|
+
response = await self.delete(
|
|
875
|
+
l7rule_id=l7rule_id,
|
|
876
|
+
project_id=project_id,
|
|
877
|
+
region_id=region_id,
|
|
878
|
+
l7policy_id=l7policy_id,
|
|
879
|
+
extra_headers=extra_headers,
|
|
880
|
+
extra_query=extra_query,
|
|
881
|
+
extra_body=extra_body,
|
|
882
|
+
timeout=timeout,
|
|
883
|
+
)
|
|
884
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
885
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
886
|
+
await self._client.cloud.tasks.poll(
|
|
887
|
+
task_id=response.tasks[0],
|
|
888
|
+
extra_headers=extra_headers,
|
|
889
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
890
|
+
)
|
|
891
|
+
|
|
892
|
+
async def replace_and_poll(
|
|
893
|
+
self,
|
|
894
|
+
l7rule_id: str,
|
|
895
|
+
*,
|
|
896
|
+
project_id: int | None = None,
|
|
897
|
+
region_id: int | None = None,
|
|
898
|
+
l7policy_id: str,
|
|
899
|
+
compare_type: Literal["CONTAINS", "ENDS_WITH", "EQUAL_TO", "REGEX", "STARTS_WITH"],
|
|
900
|
+
type: Literal[
|
|
901
|
+
"COOKIE",
|
|
902
|
+
"FILE_TYPE",
|
|
903
|
+
"HEADER",
|
|
904
|
+
"HOST_NAME",
|
|
905
|
+
"PATH",
|
|
906
|
+
"SSL_CONN_HAS_CERT",
|
|
907
|
+
"SSL_DN_FIELD",
|
|
908
|
+
"SSL_VERIFY_RESULT",
|
|
909
|
+
],
|
|
910
|
+
value: str,
|
|
911
|
+
invert: bool | NotGiven = NOT_GIVEN,
|
|
912
|
+
key: str | NotGiven = NOT_GIVEN,
|
|
913
|
+
tags: List[str] | NotGiven = NOT_GIVEN,
|
|
914
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
915
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
916
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
917
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
918
|
+
extra_headers: Headers | None = None,
|
|
919
|
+
extra_query: Query | None = None,
|
|
920
|
+
extra_body: Body | None = None,
|
|
921
|
+
) -> LoadBalancerL7Rule:
|
|
922
|
+
response = await self.replace(
|
|
923
|
+
l7rule_id=l7rule_id,
|
|
924
|
+
project_id=project_id,
|
|
925
|
+
region_id=region_id,
|
|
926
|
+
l7policy_id=l7policy_id,
|
|
927
|
+
compare_type=compare_type,
|
|
928
|
+
type=type,
|
|
929
|
+
value=value,
|
|
930
|
+
invert=invert,
|
|
931
|
+
key=key,
|
|
932
|
+
tags=tags,
|
|
933
|
+
extra_headers=extra_headers,
|
|
934
|
+
extra_query=extra_query,
|
|
935
|
+
extra_body=extra_body,
|
|
936
|
+
timeout=timeout,
|
|
937
|
+
)
|
|
938
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
939
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
940
|
+
await self._client.cloud.tasks.poll(
|
|
941
|
+
task_id=response.tasks[0],
|
|
942
|
+
extra_headers=extra_headers,
|
|
943
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
944
|
+
)
|
|
945
|
+
return await self.get(
|
|
946
|
+
l7rule_id=l7rule_id,
|
|
947
|
+
project_id=project_id,
|
|
948
|
+
region_id=region_id,
|
|
949
|
+
l7policy_id=l7policy_id,
|
|
950
|
+
extra_headers=extra_headers,
|
|
951
|
+
timeout=timeout,
|
|
952
|
+
)
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
class RulesResourceWithRawResponse:
|
|
956
|
+
def __init__(self, rules: RulesResource) -> None:
|
|
957
|
+
self._rules = rules
|
|
958
|
+
|
|
959
|
+
self.create = to_raw_response_wrapper(
|
|
960
|
+
rules.create,
|
|
961
|
+
)
|
|
962
|
+
self.list = to_raw_response_wrapper(
|
|
963
|
+
rules.list,
|
|
964
|
+
)
|
|
965
|
+
self.delete = to_raw_response_wrapper(
|
|
966
|
+
rules.delete,
|
|
967
|
+
)
|
|
968
|
+
self.get = to_raw_response_wrapper(
|
|
969
|
+
rules.get,
|
|
970
|
+
)
|
|
971
|
+
self.replace = to_raw_response_wrapper(
|
|
972
|
+
rules.replace,
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
class AsyncRulesResourceWithRawResponse:
|
|
977
|
+
def __init__(self, rules: AsyncRulesResource) -> None:
|
|
978
|
+
self._rules = rules
|
|
979
|
+
|
|
980
|
+
self.create = async_to_raw_response_wrapper(
|
|
981
|
+
rules.create,
|
|
982
|
+
)
|
|
983
|
+
self.list = async_to_raw_response_wrapper(
|
|
984
|
+
rules.list,
|
|
985
|
+
)
|
|
986
|
+
self.delete = async_to_raw_response_wrapper(
|
|
987
|
+
rules.delete,
|
|
988
|
+
)
|
|
989
|
+
self.get = async_to_raw_response_wrapper(
|
|
990
|
+
rules.get,
|
|
991
|
+
)
|
|
992
|
+
self.replace = async_to_raw_response_wrapper(
|
|
993
|
+
rules.replace,
|
|
994
|
+
)
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
class RulesResourceWithStreamingResponse:
|
|
998
|
+
def __init__(self, rules: RulesResource) -> None:
|
|
999
|
+
self._rules = rules
|
|
1000
|
+
|
|
1001
|
+
self.create = to_streamed_response_wrapper(
|
|
1002
|
+
rules.create,
|
|
1003
|
+
)
|
|
1004
|
+
self.list = to_streamed_response_wrapper(
|
|
1005
|
+
rules.list,
|
|
1006
|
+
)
|
|
1007
|
+
self.delete = to_streamed_response_wrapper(
|
|
1008
|
+
rules.delete,
|
|
1009
|
+
)
|
|
1010
|
+
self.get = to_streamed_response_wrapper(
|
|
1011
|
+
rules.get,
|
|
1012
|
+
)
|
|
1013
|
+
self.replace = to_streamed_response_wrapper(
|
|
1014
|
+
rules.replace,
|
|
1015
|
+
)
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
class AsyncRulesResourceWithStreamingResponse:
|
|
1019
|
+
def __init__(self, rules: AsyncRulesResource) -> None:
|
|
1020
|
+
self._rules = rules
|
|
1021
|
+
|
|
1022
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1023
|
+
rules.create,
|
|
1024
|
+
)
|
|
1025
|
+
self.list = async_to_streamed_response_wrapper(
|
|
1026
|
+
rules.list,
|
|
1027
|
+
)
|
|
1028
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1029
|
+
rules.delete,
|
|
1030
|
+
)
|
|
1031
|
+
self.get = async_to_streamed_response_wrapper(
|
|
1032
|
+
rules.get,
|
|
1033
|
+
)
|
|
1034
|
+
self.replace = async_to_streamed_response_wrapper(
|
|
1035
|
+
rules.replace,
|
|
1036
|
+
)
|