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,1583 @@
|
|
|
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, Iterable
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from .flavors import (
|
|
10
|
+
FlavorsResource,
|
|
11
|
+
AsyncFlavorsResource,
|
|
12
|
+
FlavorsResourceWithRawResponse,
|
|
13
|
+
AsyncFlavorsResourceWithRawResponse,
|
|
14
|
+
FlavorsResourceWithStreamingResponse,
|
|
15
|
+
AsyncFlavorsResourceWithStreamingResponse,
|
|
16
|
+
)
|
|
17
|
+
from .metrics import (
|
|
18
|
+
MetricsResource,
|
|
19
|
+
AsyncMetricsResource,
|
|
20
|
+
MetricsResourceWithRawResponse,
|
|
21
|
+
AsyncMetricsResourceWithRawResponse,
|
|
22
|
+
MetricsResourceWithStreamingResponse,
|
|
23
|
+
AsyncMetricsResourceWithStreamingResponse,
|
|
24
|
+
)
|
|
25
|
+
from .statuses import (
|
|
26
|
+
StatusesResource,
|
|
27
|
+
AsyncStatusesResource,
|
|
28
|
+
StatusesResourceWithRawResponse,
|
|
29
|
+
AsyncStatusesResourceWithRawResponse,
|
|
30
|
+
StatusesResourceWithStreamingResponse,
|
|
31
|
+
AsyncStatusesResourceWithStreamingResponse,
|
|
32
|
+
)
|
|
33
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
34
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
35
|
+
from .listeners import (
|
|
36
|
+
ListenersResource,
|
|
37
|
+
AsyncListenersResource,
|
|
38
|
+
ListenersResourceWithRawResponse,
|
|
39
|
+
AsyncListenersResourceWithRawResponse,
|
|
40
|
+
ListenersResourceWithStreamingResponse,
|
|
41
|
+
AsyncListenersResourceWithStreamingResponse,
|
|
42
|
+
)
|
|
43
|
+
from ...._compat import cached_property
|
|
44
|
+
from .pools.pools import (
|
|
45
|
+
PoolsResource,
|
|
46
|
+
AsyncPoolsResource,
|
|
47
|
+
PoolsResourceWithRawResponse,
|
|
48
|
+
AsyncPoolsResourceWithRawResponse,
|
|
49
|
+
PoolsResourceWithStreamingResponse,
|
|
50
|
+
AsyncPoolsResourceWithStreamingResponse,
|
|
51
|
+
)
|
|
52
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
53
|
+
from ...._response import (
|
|
54
|
+
to_raw_response_wrapper,
|
|
55
|
+
to_streamed_response_wrapper,
|
|
56
|
+
async_to_raw_response_wrapper,
|
|
57
|
+
async_to_streamed_response_wrapper,
|
|
58
|
+
)
|
|
59
|
+
from ....pagination import SyncOffsetPage, AsyncOffsetPage
|
|
60
|
+
from ....types.cloud import (
|
|
61
|
+
InterfaceIPFamily,
|
|
62
|
+
LoadBalancerMemberConnectivity,
|
|
63
|
+
load_balancer_get_params,
|
|
64
|
+
load_balancer_list_params,
|
|
65
|
+
load_balancer_create_params,
|
|
66
|
+
load_balancer_resize_params,
|
|
67
|
+
load_balancer_update_params,
|
|
68
|
+
load_balancer_failover_params,
|
|
69
|
+
)
|
|
70
|
+
from ...._base_client import AsyncPaginator, make_request_options
|
|
71
|
+
from .l7_policies.l7_policies import (
|
|
72
|
+
L7PoliciesResource,
|
|
73
|
+
AsyncL7PoliciesResource,
|
|
74
|
+
L7PoliciesResourceWithRawResponse,
|
|
75
|
+
AsyncL7PoliciesResourceWithRawResponse,
|
|
76
|
+
L7PoliciesResourceWithStreamingResponse,
|
|
77
|
+
AsyncL7PoliciesResourceWithStreamingResponse,
|
|
78
|
+
)
|
|
79
|
+
from ....types.cloud.task_id_list import TaskIDList
|
|
80
|
+
from ....types.cloud.load_balancer import LoadBalancer
|
|
81
|
+
from ....types.cloud.interface_ip_family import InterfaceIPFamily
|
|
82
|
+
from ....types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
83
|
+
from ....types.cloud.load_balancer_member_connectivity import LoadBalancerMemberConnectivity
|
|
84
|
+
|
|
85
|
+
__all__ = ["LoadBalancersResource", "AsyncLoadBalancersResource"]
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class LoadBalancersResource(SyncAPIResource):
|
|
89
|
+
@cached_property
|
|
90
|
+
def l7_policies(self) -> L7PoliciesResource:
|
|
91
|
+
return L7PoliciesResource(self._client)
|
|
92
|
+
|
|
93
|
+
@cached_property
|
|
94
|
+
def flavors(self) -> FlavorsResource:
|
|
95
|
+
return FlavorsResource(self._client)
|
|
96
|
+
|
|
97
|
+
@cached_property
|
|
98
|
+
def listeners(self) -> ListenersResource:
|
|
99
|
+
return ListenersResource(self._client)
|
|
100
|
+
|
|
101
|
+
@cached_property
|
|
102
|
+
def pools(self) -> PoolsResource:
|
|
103
|
+
return PoolsResource(self._client)
|
|
104
|
+
|
|
105
|
+
@cached_property
|
|
106
|
+
def metrics(self) -> MetricsResource:
|
|
107
|
+
return MetricsResource(self._client)
|
|
108
|
+
|
|
109
|
+
@cached_property
|
|
110
|
+
def statuses(self) -> StatusesResource:
|
|
111
|
+
return StatusesResource(self._client)
|
|
112
|
+
|
|
113
|
+
@cached_property
|
|
114
|
+
def with_raw_response(self) -> LoadBalancersResourceWithRawResponse:
|
|
115
|
+
"""
|
|
116
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
117
|
+
the raw response object instead of the parsed content.
|
|
118
|
+
|
|
119
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
120
|
+
"""
|
|
121
|
+
return LoadBalancersResourceWithRawResponse(self)
|
|
122
|
+
|
|
123
|
+
@cached_property
|
|
124
|
+
def with_streaming_response(self) -> LoadBalancersResourceWithStreamingResponse:
|
|
125
|
+
"""
|
|
126
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
127
|
+
|
|
128
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
129
|
+
"""
|
|
130
|
+
return LoadBalancersResourceWithStreamingResponse(self)
|
|
131
|
+
|
|
132
|
+
def create(
|
|
133
|
+
self,
|
|
134
|
+
*,
|
|
135
|
+
project_id: int | None = None,
|
|
136
|
+
region_id: int | None = None,
|
|
137
|
+
flavor: str | NotGiven = NOT_GIVEN,
|
|
138
|
+
floating_ip: load_balancer_create_params.FloatingIP | NotGiven = NOT_GIVEN,
|
|
139
|
+
listeners: Iterable[load_balancer_create_params.Listener] | NotGiven = NOT_GIVEN,
|
|
140
|
+
logging: load_balancer_create_params.Logging | NotGiven = NOT_GIVEN,
|
|
141
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
142
|
+
name_template: str | NotGiven = NOT_GIVEN,
|
|
143
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
144
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
145
|
+
vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
|
|
146
|
+
vip_network_id: str | NotGiven = NOT_GIVEN,
|
|
147
|
+
vip_port_id: str | NotGiven = NOT_GIVEN,
|
|
148
|
+
vip_subnet_id: str | NotGiven = NOT_GIVEN,
|
|
149
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
150
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
151
|
+
extra_headers: Headers | None = None,
|
|
152
|
+
extra_query: Query | None = None,
|
|
153
|
+
extra_body: Body | None = None,
|
|
154
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
155
|
+
) -> TaskIDList:
|
|
156
|
+
"""
|
|
157
|
+
Create load balancer
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
flavor: Load balancer flavor name
|
|
161
|
+
|
|
162
|
+
floating_ip: Floating IP configuration for assignment
|
|
163
|
+
|
|
164
|
+
listeners: Load balancer listeners. Maximum 50 per LB (excluding Prometheus endpoint
|
|
165
|
+
listener).
|
|
166
|
+
|
|
167
|
+
logging: Logging configuration
|
|
168
|
+
|
|
169
|
+
name: Load balancer name
|
|
170
|
+
|
|
171
|
+
name_template: Load balancer name which will be changed by template.
|
|
172
|
+
|
|
173
|
+
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
|
|
174
|
+
members. L2 provides best performance, L3 provides less IPs usage. It is taking
|
|
175
|
+
effect only if instance_id + ip_address is provided, not subnet_id + ip_address,
|
|
176
|
+
because we're considering this as intentional subnet_id specification.
|
|
177
|
+
|
|
178
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
179
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
180
|
+
better organization and management. Some tags are read-only and cannot be
|
|
181
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
182
|
+
data to be filtered based on tag keys or values.
|
|
183
|
+
|
|
184
|
+
vip_ip_family: IP family for load balancer subnet auto-selection if vip_network_id is specified
|
|
185
|
+
|
|
186
|
+
vip_network_id: Network ID for load balancer. If not specified, default external network will be
|
|
187
|
+
used. Mutually exclusive with vip_port_id
|
|
188
|
+
|
|
189
|
+
vip_port_id: Existing Reserved Fixed IP port ID for load balancer. Mutually exclusive with
|
|
190
|
+
vip_network_id
|
|
191
|
+
|
|
192
|
+
vip_subnet_id: Subnet ID for load balancer. If not specified, any subnet from vip_network_id
|
|
193
|
+
will be selected. Ignored when vip_network_id is not specified.
|
|
194
|
+
|
|
195
|
+
extra_headers: Send extra headers
|
|
196
|
+
|
|
197
|
+
extra_query: Add additional query parameters to the request
|
|
198
|
+
|
|
199
|
+
extra_body: Add additional JSON properties to the request
|
|
200
|
+
|
|
201
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
202
|
+
"""
|
|
203
|
+
if project_id is None:
|
|
204
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
205
|
+
if region_id is None:
|
|
206
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
207
|
+
return self._post(
|
|
208
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
|
|
209
|
+
body=maybe_transform(
|
|
210
|
+
{
|
|
211
|
+
"flavor": flavor,
|
|
212
|
+
"floating_ip": floating_ip,
|
|
213
|
+
"listeners": listeners,
|
|
214
|
+
"logging": logging,
|
|
215
|
+
"name": name,
|
|
216
|
+
"name_template": name_template,
|
|
217
|
+
"preferred_connectivity": preferred_connectivity,
|
|
218
|
+
"tags": tags,
|
|
219
|
+
"vip_ip_family": vip_ip_family,
|
|
220
|
+
"vip_network_id": vip_network_id,
|
|
221
|
+
"vip_port_id": vip_port_id,
|
|
222
|
+
"vip_subnet_id": vip_subnet_id,
|
|
223
|
+
},
|
|
224
|
+
load_balancer_create_params.LoadBalancerCreateParams,
|
|
225
|
+
),
|
|
226
|
+
options=make_request_options(
|
|
227
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
228
|
+
),
|
|
229
|
+
cast_to=TaskIDList,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
def update(
|
|
233
|
+
self,
|
|
234
|
+
loadbalancer_id: str,
|
|
235
|
+
*,
|
|
236
|
+
project_id: int | None = None,
|
|
237
|
+
region_id: int | None = None,
|
|
238
|
+
logging: load_balancer_update_params.Logging | NotGiven = NOT_GIVEN,
|
|
239
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
240
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
241
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
242
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
243
|
+
extra_headers: Headers | None = None,
|
|
244
|
+
extra_query: Query | None = None,
|
|
245
|
+
extra_body: Body | None = None,
|
|
246
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
247
|
+
) -> LoadBalancer:
|
|
248
|
+
"""
|
|
249
|
+
Rename load balancer, activate/deactivate logs or update preferred connectivity
|
|
250
|
+
for load balancer
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
logging: Logging configuration
|
|
254
|
+
|
|
255
|
+
name: Name.
|
|
256
|
+
|
|
257
|
+
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
|
|
258
|
+
members
|
|
259
|
+
|
|
260
|
+
extra_headers: Send extra headers
|
|
261
|
+
|
|
262
|
+
extra_query: Add additional query parameters to the request
|
|
263
|
+
|
|
264
|
+
extra_body: Add additional JSON properties to the request
|
|
265
|
+
|
|
266
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
267
|
+
"""
|
|
268
|
+
if project_id is None:
|
|
269
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
270
|
+
if region_id is None:
|
|
271
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
272
|
+
if not loadbalancer_id:
|
|
273
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
274
|
+
return self._patch(
|
|
275
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
276
|
+
body=maybe_transform(
|
|
277
|
+
{
|
|
278
|
+
"logging": logging,
|
|
279
|
+
"name": name,
|
|
280
|
+
"preferred_connectivity": preferred_connectivity,
|
|
281
|
+
},
|
|
282
|
+
load_balancer_update_params.LoadBalancerUpdateParams,
|
|
283
|
+
),
|
|
284
|
+
options=make_request_options(
|
|
285
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
286
|
+
),
|
|
287
|
+
cast_to=LoadBalancer,
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
def list(
|
|
291
|
+
self,
|
|
292
|
+
*,
|
|
293
|
+
project_id: int | None = None,
|
|
294
|
+
region_id: int | None = None,
|
|
295
|
+
assigned_floating: bool | NotGiven = NOT_GIVEN,
|
|
296
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
297
|
+
logging_enabled: bool | NotGiven = NOT_GIVEN,
|
|
298
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
299
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
300
|
+
order_by: str | NotGiven = NOT_GIVEN,
|
|
301
|
+
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
302
|
+
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
303
|
+
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
304
|
+
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
305
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
306
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
307
|
+
extra_headers: Headers | None = None,
|
|
308
|
+
extra_query: Query | None = None,
|
|
309
|
+
extra_body: Body | None = None,
|
|
310
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
311
|
+
) -> SyncOffsetPage[LoadBalancer]:
|
|
312
|
+
"""
|
|
313
|
+
List load balancers
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
assigned_floating: With or without assigned floating IP
|
|
317
|
+
|
|
318
|
+
limit: Limit the number of returned limit request entities.
|
|
319
|
+
|
|
320
|
+
logging_enabled: With or without logging
|
|
321
|
+
|
|
322
|
+
name: Filter by name
|
|
323
|
+
|
|
324
|
+
offset: Offset value is used to exclude the first set of records from the result.
|
|
325
|
+
|
|
326
|
+
order_by: Ordering Load Balancer list result by name, created_at, updated_at,
|
|
327
|
+
operating_status, provisioning_status, vip_address, vip_ip_family and flavor
|
|
328
|
+
fields of the load balancer and directions (name.asc), default is
|
|
329
|
+
"created_at.asc"
|
|
330
|
+
|
|
331
|
+
show_stats: Show statistics
|
|
332
|
+
|
|
333
|
+
tag_key: Filter by tag keys.
|
|
334
|
+
|
|
335
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
|
|
336
|
+
--data-urlencode "tag_key_value={"key": "value"}" --url
|
|
337
|
+
"http://localhost:1111/v1/loadbalancers/1/1"
|
|
338
|
+
|
|
339
|
+
with_ddos: Show Advanced DDoS protection profile, if exists
|
|
340
|
+
|
|
341
|
+
extra_headers: Send extra headers
|
|
342
|
+
|
|
343
|
+
extra_query: Add additional query parameters to the request
|
|
344
|
+
|
|
345
|
+
extra_body: Add additional JSON properties to the request
|
|
346
|
+
|
|
347
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
348
|
+
"""
|
|
349
|
+
if project_id is None:
|
|
350
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
351
|
+
if region_id is None:
|
|
352
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
353
|
+
return self._get_api_list(
|
|
354
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
|
|
355
|
+
page=SyncOffsetPage[LoadBalancer],
|
|
356
|
+
options=make_request_options(
|
|
357
|
+
extra_headers=extra_headers,
|
|
358
|
+
extra_query=extra_query,
|
|
359
|
+
extra_body=extra_body,
|
|
360
|
+
timeout=timeout,
|
|
361
|
+
query=maybe_transform(
|
|
362
|
+
{
|
|
363
|
+
"assigned_floating": assigned_floating,
|
|
364
|
+
"limit": limit,
|
|
365
|
+
"logging_enabled": logging_enabled,
|
|
366
|
+
"name": name,
|
|
367
|
+
"offset": offset,
|
|
368
|
+
"order_by": order_by,
|
|
369
|
+
"show_stats": show_stats,
|
|
370
|
+
"tag_key": tag_key,
|
|
371
|
+
"tag_key_value": tag_key_value,
|
|
372
|
+
"with_ddos": with_ddos,
|
|
373
|
+
},
|
|
374
|
+
load_balancer_list_params.LoadBalancerListParams,
|
|
375
|
+
),
|
|
376
|
+
),
|
|
377
|
+
model=LoadBalancer,
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
def delete(
|
|
381
|
+
self,
|
|
382
|
+
loadbalancer_id: str,
|
|
383
|
+
*,
|
|
384
|
+
project_id: int | None = None,
|
|
385
|
+
region_id: int | None = None,
|
|
386
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
387
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
388
|
+
extra_headers: Headers | None = None,
|
|
389
|
+
extra_query: Query | None = None,
|
|
390
|
+
extra_body: Body | None = None,
|
|
391
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
392
|
+
) -> TaskIDList:
|
|
393
|
+
"""
|
|
394
|
+
Delete load balancer
|
|
395
|
+
|
|
396
|
+
Args:
|
|
397
|
+
extra_headers: Send extra headers
|
|
398
|
+
|
|
399
|
+
extra_query: Add additional query parameters to the request
|
|
400
|
+
|
|
401
|
+
extra_body: Add additional JSON properties to the request
|
|
402
|
+
|
|
403
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
404
|
+
"""
|
|
405
|
+
if project_id is None:
|
|
406
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
407
|
+
if region_id is None:
|
|
408
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
409
|
+
if not loadbalancer_id:
|
|
410
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
411
|
+
return self._delete(
|
|
412
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
413
|
+
options=make_request_options(
|
|
414
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
415
|
+
),
|
|
416
|
+
cast_to=TaskIDList,
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
def failover(
|
|
420
|
+
self,
|
|
421
|
+
loadbalancer_id: str,
|
|
422
|
+
*,
|
|
423
|
+
project_id: int | None = None,
|
|
424
|
+
region_id: int | None = None,
|
|
425
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
426
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
427
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
428
|
+
extra_headers: Headers | None = None,
|
|
429
|
+
extra_query: Query | None = None,
|
|
430
|
+
extra_body: Body | None = None,
|
|
431
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
432
|
+
) -> TaskIDList:
|
|
433
|
+
"""
|
|
434
|
+
Failover loadbalancer
|
|
435
|
+
|
|
436
|
+
Args:
|
|
437
|
+
force: Validate current load balancer status before failover or not.
|
|
438
|
+
|
|
439
|
+
extra_headers: Send extra headers
|
|
440
|
+
|
|
441
|
+
extra_query: Add additional query parameters to the request
|
|
442
|
+
|
|
443
|
+
extra_body: Add additional JSON properties to the request
|
|
444
|
+
|
|
445
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
446
|
+
"""
|
|
447
|
+
if project_id is None:
|
|
448
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
449
|
+
if region_id is None:
|
|
450
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
451
|
+
if not loadbalancer_id:
|
|
452
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
453
|
+
return self._post(
|
|
454
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover",
|
|
455
|
+
body=maybe_transform({"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams),
|
|
456
|
+
options=make_request_options(
|
|
457
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
458
|
+
),
|
|
459
|
+
cast_to=TaskIDList,
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
def get(
|
|
463
|
+
self,
|
|
464
|
+
loadbalancer_id: str,
|
|
465
|
+
*,
|
|
466
|
+
project_id: int | None = None,
|
|
467
|
+
region_id: int | None = None,
|
|
468
|
+
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
469
|
+
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
470
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
471
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
472
|
+
extra_headers: Headers | None = None,
|
|
473
|
+
extra_query: Query | None = None,
|
|
474
|
+
extra_body: Body | None = None,
|
|
475
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
476
|
+
) -> LoadBalancer:
|
|
477
|
+
"""
|
|
478
|
+
Get load balancer
|
|
479
|
+
|
|
480
|
+
Args:
|
|
481
|
+
show_stats: Show statistics
|
|
482
|
+
|
|
483
|
+
with_ddos: Show DDoS profile
|
|
484
|
+
|
|
485
|
+
extra_headers: Send extra headers
|
|
486
|
+
|
|
487
|
+
extra_query: Add additional query parameters to the request
|
|
488
|
+
|
|
489
|
+
extra_body: Add additional JSON properties to the request
|
|
490
|
+
|
|
491
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
492
|
+
"""
|
|
493
|
+
if project_id is None:
|
|
494
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
495
|
+
if region_id is None:
|
|
496
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
497
|
+
if not loadbalancer_id:
|
|
498
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
499
|
+
return self._get(
|
|
500
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
501
|
+
options=make_request_options(
|
|
502
|
+
extra_headers=extra_headers,
|
|
503
|
+
extra_query=extra_query,
|
|
504
|
+
extra_body=extra_body,
|
|
505
|
+
timeout=timeout,
|
|
506
|
+
query=maybe_transform(
|
|
507
|
+
{
|
|
508
|
+
"show_stats": show_stats,
|
|
509
|
+
"with_ddos": with_ddos,
|
|
510
|
+
},
|
|
511
|
+
load_balancer_get_params.LoadBalancerGetParams,
|
|
512
|
+
),
|
|
513
|
+
),
|
|
514
|
+
cast_to=LoadBalancer,
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
def resize(
|
|
518
|
+
self,
|
|
519
|
+
loadbalancer_id: str,
|
|
520
|
+
*,
|
|
521
|
+
project_id: int | None = None,
|
|
522
|
+
region_id: int | None = None,
|
|
523
|
+
flavor: str,
|
|
524
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
525
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
526
|
+
extra_headers: Headers | None = None,
|
|
527
|
+
extra_query: Query | None = None,
|
|
528
|
+
extra_body: Body | None = None,
|
|
529
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
530
|
+
) -> TaskIDList:
|
|
531
|
+
"""
|
|
532
|
+
Resize loadbalancer
|
|
533
|
+
|
|
534
|
+
Args:
|
|
535
|
+
flavor: Name of the desired flavor to resize to.
|
|
536
|
+
|
|
537
|
+
extra_headers: Send extra headers
|
|
538
|
+
|
|
539
|
+
extra_query: Add additional query parameters to the request
|
|
540
|
+
|
|
541
|
+
extra_body: Add additional JSON properties to the request
|
|
542
|
+
|
|
543
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
544
|
+
"""
|
|
545
|
+
if project_id is None:
|
|
546
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
547
|
+
if region_id is None:
|
|
548
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
549
|
+
if not loadbalancer_id:
|
|
550
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
551
|
+
return self._post(
|
|
552
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize",
|
|
553
|
+
body=maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
|
|
554
|
+
options=make_request_options(
|
|
555
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
556
|
+
),
|
|
557
|
+
cast_to=TaskIDList,
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
def create_and_poll(
|
|
561
|
+
self,
|
|
562
|
+
*,
|
|
563
|
+
project_id: int | None = None,
|
|
564
|
+
region_id: int | None = None,
|
|
565
|
+
flavor: str | NotGiven = NOT_GIVEN,
|
|
566
|
+
floating_ip: load_balancer_create_params.FloatingIP | NotGiven = NOT_GIVEN,
|
|
567
|
+
listeners: Iterable[load_balancer_create_params.Listener] | NotGiven = NOT_GIVEN,
|
|
568
|
+
logging: load_balancer_create_params.Logging | NotGiven = NOT_GIVEN,
|
|
569
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
570
|
+
name_template: str | NotGiven = NOT_GIVEN,
|
|
571
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
572
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
573
|
+
vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
|
|
574
|
+
vip_network_id: str | NotGiven = NOT_GIVEN,
|
|
575
|
+
vip_port_id: str | NotGiven = NOT_GIVEN,
|
|
576
|
+
vip_subnet_id: str | NotGiven = NOT_GIVEN,
|
|
577
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
578
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
579
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
580
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
581
|
+
extra_headers: Headers | None = None,
|
|
582
|
+
extra_query: Query | None = None,
|
|
583
|
+
extra_body: Body | None = None,
|
|
584
|
+
) -> LoadBalancer:
|
|
585
|
+
response = self.create(
|
|
586
|
+
project_id=project_id,
|
|
587
|
+
region_id=region_id,
|
|
588
|
+
flavor=flavor,
|
|
589
|
+
floating_ip=floating_ip,
|
|
590
|
+
listeners=listeners,
|
|
591
|
+
logging=logging,
|
|
592
|
+
name=name,
|
|
593
|
+
name_template=name_template,
|
|
594
|
+
preferred_connectivity=preferred_connectivity,
|
|
595
|
+
tags=tags,
|
|
596
|
+
vip_ip_family=vip_ip_family,
|
|
597
|
+
vip_network_id=vip_network_id,
|
|
598
|
+
vip_port_id=vip_port_id,
|
|
599
|
+
vip_subnet_id=vip_subnet_id,
|
|
600
|
+
extra_headers=extra_headers,
|
|
601
|
+
extra_query=extra_query,
|
|
602
|
+
extra_body=extra_body,
|
|
603
|
+
timeout=timeout,
|
|
604
|
+
)
|
|
605
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
606
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
607
|
+
task = self._client.cloud.tasks.poll(
|
|
608
|
+
task_id=response.tasks[0],
|
|
609
|
+
extra_headers=extra_headers,
|
|
610
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
611
|
+
)
|
|
612
|
+
if not task.created_resources or not task.created_resources.loadbalancers or len(task.created_resources.loadbalancers) != 1:
|
|
613
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
614
|
+
return self.get(
|
|
615
|
+
loadbalancer_id=task.created_resources.loadbalancers[0],
|
|
616
|
+
project_id=project_id,
|
|
617
|
+
region_id=region_id,
|
|
618
|
+
extra_headers=extra_headers,
|
|
619
|
+
timeout=timeout,
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
def delete_and_poll(
|
|
623
|
+
self,
|
|
624
|
+
loadbalancer_id: str,
|
|
625
|
+
*,
|
|
626
|
+
project_id: int | None = None,
|
|
627
|
+
region_id: int | None = None,
|
|
628
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
629
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
630
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
631
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
632
|
+
extra_headers: Headers | None = None,
|
|
633
|
+
extra_query: Query | None = None,
|
|
634
|
+
extra_body: Body | None = None,
|
|
635
|
+
) -> None:
|
|
636
|
+
response = self.delete(
|
|
637
|
+
loadbalancer_id=loadbalancer_id,
|
|
638
|
+
project_id=project_id,
|
|
639
|
+
region_id=region_id,
|
|
640
|
+
extra_headers=extra_headers,
|
|
641
|
+
extra_query=extra_query,
|
|
642
|
+
extra_body=extra_body,
|
|
643
|
+
timeout=timeout,
|
|
644
|
+
)
|
|
645
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
646
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
647
|
+
self._client.cloud.tasks.poll(
|
|
648
|
+
task_id=response.tasks[0],
|
|
649
|
+
extra_headers=extra_headers,
|
|
650
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
651
|
+
)
|
|
652
|
+
|
|
653
|
+
def failover_and_poll(
|
|
654
|
+
self,
|
|
655
|
+
loadbalancer_id: str,
|
|
656
|
+
*,
|
|
657
|
+
project_id: int | None = None,
|
|
658
|
+
region_id: int | None = None,
|
|
659
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
660
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
661
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
662
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
663
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
664
|
+
extra_headers: Headers | None = None,
|
|
665
|
+
extra_query: Query | None = None,
|
|
666
|
+
extra_body: Body | None = None,
|
|
667
|
+
) -> LoadBalancer:
|
|
668
|
+
response = self.failover(
|
|
669
|
+
loadbalancer_id=loadbalancer_id,
|
|
670
|
+
project_id=project_id,
|
|
671
|
+
region_id=region_id,
|
|
672
|
+
force=force,
|
|
673
|
+
extra_headers=extra_headers,
|
|
674
|
+
extra_query=extra_query,
|
|
675
|
+
extra_body=extra_body,
|
|
676
|
+
timeout=timeout,
|
|
677
|
+
)
|
|
678
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
679
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
680
|
+
self._client.cloud.tasks.poll(
|
|
681
|
+
task_id=response.tasks[0],
|
|
682
|
+
extra_headers=extra_headers,
|
|
683
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
684
|
+
)
|
|
685
|
+
return self.get(
|
|
686
|
+
loadbalancer_id=loadbalancer_id,
|
|
687
|
+
project_id=project_id,
|
|
688
|
+
region_id=region_id,
|
|
689
|
+
extra_headers=extra_headers,
|
|
690
|
+
timeout=timeout,
|
|
691
|
+
)
|
|
692
|
+
|
|
693
|
+
def resize_and_poll(
|
|
694
|
+
self,
|
|
695
|
+
loadbalancer_id: str,
|
|
696
|
+
*,
|
|
697
|
+
project_id: int | None = None,
|
|
698
|
+
region_id: int | None = None,
|
|
699
|
+
flavor: str,
|
|
700
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
701
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
702
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
703
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
704
|
+
extra_headers: Headers | None = None,
|
|
705
|
+
extra_query: Query | None = None,
|
|
706
|
+
extra_body: Body | None = None,
|
|
707
|
+
) -> LoadBalancer:
|
|
708
|
+
response = self.resize(
|
|
709
|
+
loadbalancer_id=loadbalancer_id,
|
|
710
|
+
project_id=project_id,
|
|
711
|
+
region_id=region_id,
|
|
712
|
+
flavor=flavor,
|
|
713
|
+
extra_headers=extra_headers,
|
|
714
|
+
extra_query=extra_query,
|
|
715
|
+
extra_body=extra_body,
|
|
716
|
+
timeout=timeout,
|
|
717
|
+
)
|
|
718
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
719
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
720
|
+
self._client.cloud.tasks.poll(
|
|
721
|
+
task_id=response.tasks[0],
|
|
722
|
+
extra_headers=extra_headers,
|
|
723
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
724
|
+
)
|
|
725
|
+
return self.get(
|
|
726
|
+
loadbalancer_id=loadbalancer_id,
|
|
727
|
+
project_id=project_id,
|
|
728
|
+
region_id=region_id,
|
|
729
|
+
extra_headers=extra_headers,
|
|
730
|
+
timeout=timeout,
|
|
731
|
+
)
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
class AsyncLoadBalancersResource(AsyncAPIResource):
|
|
735
|
+
@cached_property
|
|
736
|
+
def l7_policies(self) -> AsyncL7PoliciesResource:
|
|
737
|
+
return AsyncL7PoliciesResource(self._client)
|
|
738
|
+
|
|
739
|
+
@cached_property
|
|
740
|
+
def flavors(self) -> AsyncFlavorsResource:
|
|
741
|
+
return AsyncFlavorsResource(self._client)
|
|
742
|
+
|
|
743
|
+
@cached_property
|
|
744
|
+
def listeners(self) -> AsyncListenersResource:
|
|
745
|
+
return AsyncListenersResource(self._client)
|
|
746
|
+
|
|
747
|
+
@cached_property
|
|
748
|
+
def pools(self) -> AsyncPoolsResource:
|
|
749
|
+
return AsyncPoolsResource(self._client)
|
|
750
|
+
|
|
751
|
+
@cached_property
|
|
752
|
+
def metrics(self) -> AsyncMetricsResource:
|
|
753
|
+
return AsyncMetricsResource(self._client)
|
|
754
|
+
|
|
755
|
+
@cached_property
|
|
756
|
+
def statuses(self) -> AsyncStatusesResource:
|
|
757
|
+
return AsyncStatusesResource(self._client)
|
|
758
|
+
|
|
759
|
+
@cached_property
|
|
760
|
+
def with_raw_response(self) -> AsyncLoadBalancersResourceWithRawResponse:
|
|
761
|
+
"""
|
|
762
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
763
|
+
the raw response object instead of the parsed content.
|
|
764
|
+
|
|
765
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
766
|
+
"""
|
|
767
|
+
return AsyncLoadBalancersResourceWithRawResponse(self)
|
|
768
|
+
|
|
769
|
+
@cached_property
|
|
770
|
+
def with_streaming_response(self) -> AsyncLoadBalancersResourceWithStreamingResponse:
|
|
771
|
+
"""
|
|
772
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
773
|
+
|
|
774
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
775
|
+
"""
|
|
776
|
+
return AsyncLoadBalancersResourceWithStreamingResponse(self)
|
|
777
|
+
|
|
778
|
+
async def create(
|
|
779
|
+
self,
|
|
780
|
+
*,
|
|
781
|
+
project_id: int | None = None,
|
|
782
|
+
region_id: int | None = None,
|
|
783
|
+
flavor: str | NotGiven = NOT_GIVEN,
|
|
784
|
+
floating_ip: load_balancer_create_params.FloatingIP | NotGiven = NOT_GIVEN,
|
|
785
|
+
listeners: Iterable[load_balancer_create_params.Listener] | NotGiven = NOT_GIVEN,
|
|
786
|
+
logging: load_balancer_create_params.Logging | NotGiven = NOT_GIVEN,
|
|
787
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
788
|
+
name_template: str | NotGiven = NOT_GIVEN,
|
|
789
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
790
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
791
|
+
vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
|
|
792
|
+
vip_network_id: str | NotGiven = NOT_GIVEN,
|
|
793
|
+
vip_port_id: str | NotGiven = NOT_GIVEN,
|
|
794
|
+
vip_subnet_id: str | NotGiven = NOT_GIVEN,
|
|
795
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
796
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
797
|
+
extra_headers: Headers | None = None,
|
|
798
|
+
extra_query: Query | None = None,
|
|
799
|
+
extra_body: Body | None = None,
|
|
800
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
801
|
+
) -> TaskIDList:
|
|
802
|
+
"""
|
|
803
|
+
Create load balancer
|
|
804
|
+
|
|
805
|
+
Args:
|
|
806
|
+
flavor: Load balancer flavor name
|
|
807
|
+
|
|
808
|
+
floating_ip: Floating IP configuration for assignment
|
|
809
|
+
|
|
810
|
+
listeners: Load balancer listeners. Maximum 50 per LB (excluding Prometheus endpoint
|
|
811
|
+
listener).
|
|
812
|
+
|
|
813
|
+
logging: Logging configuration
|
|
814
|
+
|
|
815
|
+
name: Load balancer name
|
|
816
|
+
|
|
817
|
+
name_template: Load balancer name which will be changed by template.
|
|
818
|
+
|
|
819
|
+
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
|
|
820
|
+
members. L2 provides best performance, L3 provides less IPs usage. It is taking
|
|
821
|
+
effect only if instance_id + ip_address is provided, not subnet_id + ip_address,
|
|
822
|
+
because we're considering this as intentional subnet_id specification.
|
|
823
|
+
|
|
824
|
+
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
825
|
+
can be associated with a resource, enabling efficient filtering and grouping for
|
|
826
|
+
better organization and management. Some tags are read-only and cannot be
|
|
827
|
+
modified by the user. Tags are also integrated with cost reports, allowing cost
|
|
828
|
+
data to be filtered based on tag keys or values.
|
|
829
|
+
|
|
830
|
+
vip_ip_family: IP family for load balancer subnet auto-selection if vip_network_id is specified
|
|
831
|
+
|
|
832
|
+
vip_network_id: Network ID for load balancer. If not specified, default external network will be
|
|
833
|
+
used. Mutually exclusive with vip_port_id
|
|
834
|
+
|
|
835
|
+
vip_port_id: Existing Reserved Fixed IP port ID for load balancer. Mutually exclusive with
|
|
836
|
+
vip_network_id
|
|
837
|
+
|
|
838
|
+
vip_subnet_id: Subnet ID for load balancer. If not specified, any subnet from vip_network_id
|
|
839
|
+
will be selected. Ignored when vip_network_id is not specified.
|
|
840
|
+
|
|
841
|
+
extra_headers: Send extra headers
|
|
842
|
+
|
|
843
|
+
extra_query: Add additional query parameters to the request
|
|
844
|
+
|
|
845
|
+
extra_body: Add additional JSON properties to the request
|
|
846
|
+
|
|
847
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
848
|
+
"""
|
|
849
|
+
if project_id is None:
|
|
850
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
851
|
+
if region_id is None:
|
|
852
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
853
|
+
return await self._post(
|
|
854
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
|
|
855
|
+
body=await async_maybe_transform(
|
|
856
|
+
{
|
|
857
|
+
"flavor": flavor,
|
|
858
|
+
"floating_ip": floating_ip,
|
|
859
|
+
"listeners": listeners,
|
|
860
|
+
"logging": logging,
|
|
861
|
+
"name": name,
|
|
862
|
+
"name_template": name_template,
|
|
863
|
+
"preferred_connectivity": preferred_connectivity,
|
|
864
|
+
"tags": tags,
|
|
865
|
+
"vip_ip_family": vip_ip_family,
|
|
866
|
+
"vip_network_id": vip_network_id,
|
|
867
|
+
"vip_port_id": vip_port_id,
|
|
868
|
+
"vip_subnet_id": vip_subnet_id,
|
|
869
|
+
},
|
|
870
|
+
load_balancer_create_params.LoadBalancerCreateParams,
|
|
871
|
+
),
|
|
872
|
+
options=make_request_options(
|
|
873
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
874
|
+
),
|
|
875
|
+
cast_to=TaskIDList,
|
|
876
|
+
)
|
|
877
|
+
|
|
878
|
+
async def update(
|
|
879
|
+
self,
|
|
880
|
+
loadbalancer_id: str,
|
|
881
|
+
*,
|
|
882
|
+
project_id: int | None = None,
|
|
883
|
+
region_id: int | None = None,
|
|
884
|
+
logging: load_balancer_update_params.Logging | NotGiven = NOT_GIVEN,
|
|
885
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
886
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
887
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
888
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
889
|
+
extra_headers: Headers | None = None,
|
|
890
|
+
extra_query: Query | None = None,
|
|
891
|
+
extra_body: Body | None = None,
|
|
892
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
893
|
+
) -> LoadBalancer:
|
|
894
|
+
"""
|
|
895
|
+
Rename load balancer, activate/deactivate logs or update preferred connectivity
|
|
896
|
+
for load balancer
|
|
897
|
+
|
|
898
|
+
Args:
|
|
899
|
+
logging: Logging configuration
|
|
900
|
+
|
|
901
|
+
name: Name.
|
|
902
|
+
|
|
903
|
+
preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
|
|
904
|
+
members
|
|
905
|
+
|
|
906
|
+
extra_headers: Send extra headers
|
|
907
|
+
|
|
908
|
+
extra_query: Add additional query parameters to the request
|
|
909
|
+
|
|
910
|
+
extra_body: Add additional JSON properties to the request
|
|
911
|
+
|
|
912
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
913
|
+
"""
|
|
914
|
+
if project_id is None:
|
|
915
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
916
|
+
if region_id is None:
|
|
917
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
918
|
+
if not loadbalancer_id:
|
|
919
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
920
|
+
return await self._patch(
|
|
921
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
922
|
+
body=await async_maybe_transform(
|
|
923
|
+
{
|
|
924
|
+
"logging": logging,
|
|
925
|
+
"name": name,
|
|
926
|
+
"preferred_connectivity": preferred_connectivity,
|
|
927
|
+
},
|
|
928
|
+
load_balancer_update_params.LoadBalancerUpdateParams,
|
|
929
|
+
),
|
|
930
|
+
options=make_request_options(
|
|
931
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
932
|
+
),
|
|
933
|
+
cast_to=LoadBalancer,
|
|
934
|
+
)
|
|
935
|
+
|
|
936
|
+
def list(
|
|
937
|
+
self,
|
|
938
|
+
*,
|
|
939
|
+
project_id: int | None = None,
|
|
940
|
+
region_id: int | None = None,
|
|
941
|
+
assigned_floating: bool | NotGiven = NOT_GIVEN,
|
|
942
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
943
|
+
logging_enabled: bool | NotGiven = NOT_GIVEN,
|
|
944
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
945
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
946
|
+
order_by: str | NotGiven = NOT_GIVEN,
|
|
947
|
+
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
948
|
+
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
949
|
+
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
950
|
+
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
951
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
952
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
953
|
+
extra_headers: Headers | None = None,
|
|
954
|
+
extra_query: Query | None = None,
|
|
955
|
+
extra_body: Body | None = None,
|
|
956
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
957
|
+
) -> AsyncPaginator[LoadBalancer, AsyncOffsetPage[LoadBalancer]]:
|
|
958
|
+
"""
|
|
959
|
+
List load balancers
|
|
960
|
+
|
|
961
|
+
Args:
|
|
962
|
+
assigned_floating: With or without assigned floating IP
|
|
963
|
+
|
|
964
|
+
limit: Limit the number of returned limit request entities.
|
|
965
|
+
|
|
966
|
+
logging_enabled: With or without logging
|
|
967
|
+
|
|
968
|
+
name: Filter by name
|
|
969
|
+
|
|
970
|
+
offset: Offset value is used to exclude the first set of records from the result.
|
|
971
|
+
|
|
972
|
+
order_by: Ordering Load Balancer list result by name, created_at, updated_at,
|
|
973
|
+
operating_status, provisioning_status, vip_address, vip_ip_family and flavor
|
|
974
|
+
fields of the load balancer and directions (name.asc), default is
|
|
975
|
+
"created_at.asc"
|
|
976
|
+
|
|
977
|
+
show_stats: Show statistics
|
|
978
|
+
|
|
979
|
+
tag_key: Filter by tag keys.
|
|
980
|
+
|
|
981
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
|
|
982
|
+
--data-urlencode "tag_key_value={"key": "value"}" --url
|
|
983
|
+
"http://localhost:1111/v1/loadbalancers/1/1"
|
|
984
|
+
|
|
985
|
+
with_ddos: Show Advanced DDoS protection profile, if exists
|
|
986
|
+
|
|
987
|
+
extra_headers: Send extra headers
|
|
988
|
+
|
|
989
|
+
extra_query: Add additional query parameters to the request
|
|
990
|
+
|
|
991
|
+
extra_body: Add additional JSON properties to the request
|
|
992
|
+
|
|
993
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
994
|
+
"""
|
|
995
|
+
if project_id is None:
|
|
996
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
997
|
+
if region_id is None:
|
|
998
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
999
|
+
return self._get_api_list(
|
|
1000
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
|
|
1001
|
+
page=AsyncOffsetPage[LoadBalancer],
|
|
1002
|
+
options=make_request_options(
|
|
1003
|
+
extra_headers=extra_headers,
|
|
1004
|
+
extra_query=extra_query,
|
|
1005
|
+
extra_body=extra_body,
|
|
1006
|
+
timeout=timeout,
|
|
1007
|
+
query=maybe_transform(
|
|
1008
|
+
{
|
|
1009
|
+
"assigned_floating": assigned_floating,
|
|
1010
|
+
"limit": limit,
|
|
1011
|
+
"logging_enabled": logging_enabled,
|
|
1012
|
+
"name": name,
|
|
1013
|
+
"offset": offset,
|
|
1014
|
+
"order_by": order_by,
|
|
1015
|
+
"show_stats": show_stats,
|
|
1016
|
+
"tag_key": tag_key,
|
|
1017
|
+
"tag_key_value": tag_key_value,
|
|
1018
|
+
"with_ddos": with_ddos,
|
|
1019
|
+
},
|
|
1020
|
+
load_balancer_list_params.LoadBalancerListParams,
|
|
1021
|
+
),
|
|
1022
|
+
),
|
|
1023
|
+
model=LoadBalancer,
|
|
1024
|
+
)
|
|
1025
|
+
|
|
1026
|
+
async def delete(
|
|
1027
|
+
self,
|
|
1028
|
+
loadbalancer_id: str,
|
|
1029
|
+
*,
|
|
1030
|
+
project_id: int | None = None,
|
|
1031
|
+
region_id: int | None = None,
|
|
1032
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1033
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1034
|
+
extra_headers: Headers | None = None,
|
|
1035
|
+
extra_query: Query | None = None,
|
|
1036
|
+
extra_body: Body | None = None,
|
|
1037
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1038
|
+
) -> TaskIDList:
|
|
1039
|
+
"""
|
|
1040
|
+
Delete load balancer
|
|
1041
|
+
|
|
1042
|
+
Args:
|
|
1043
|
+
extra_headers: Send extra headers
|
|
1044
|
+
|
|
1045
|
+
extra_query: Add additional query parameters to the request
|
|
1046
|
+
|
|
1047
|
+
extra_body: Add additional JSON properties to the request
|
|
1048
|
+
|
|
1049
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1050
|
+
"""
|
|
1051
|
+
if project_id is None:
|
|
1052
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1053
|
+
if region_id is None:
|
|
1054
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1055
|
+
if not loadbalancer_id:
|
|
1056
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
1057
|
+
return await self._delete(
|
|
1058
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
1059
|
+
options=make_request_options(
|
|
1060
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1061
|
+
),
|
|
1062
|
+
cast_to=TaskIDList,
|
|
1063
|
+
)
|
|
1064
|
+
|
|
1065
|
+
async def failover(
|
|
1066
|
+
self,
|
|
1067
|
+
loadbalancer_id: str,
|
|
1068
|
+
*,
|
|
1069
|
+
project_id: int | None = None,
|
|
1070
|
+
region_id: int | None = None,
|
|
1071
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
1072
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1073
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1074
|
+
extra_headers: Headers | None = None,
|
|
1075
|
+
extra_query: Query | None = None,
|
|
1076
|
+
extra_body: Body | None = None,
|
|
1077
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1078
|
+
) -> TaskIDList:
|
|
1079
|
+
"""
|
|
1080
|
+
Failover loadbalancer
|
|
1081
|
+
|
|
1082
|
+
Args:
|
|
1083
|
+
force: Validate current load balancer status before failover or not.
|
|
1084
|
+
|
|
1085
|
+
extra_headers: Send extra headers
|
|
1086
|
+
|
|
1087
|
+
extra_query: Add additional query parameters to the request
|
|
1088
|
+
|
|
1089
|
+
extra_body: Add additional JSON properties to the request
|
|
1090
|
+
|
|
1091
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1092
|
+
"""
|
|
1093
|
+
if project_id is None:
|
|
1094
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1095
|
+
if region_id is None:
|
|
1096
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1097
|
+
if not loadbalancer_id:
|
|
1098
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
1099
|
+
return await self._post(
|
|
1100
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover",
|
|
1101
|
+
body=await async_maybe_transform(
|
|
1102
|
+
{"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams
|
|
1103
|
+
),
|
|
1104
|
+
options=make_request_options(
|
|
1105
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1106
|
+
),
|
|
1107
|
+
cast_to=TaskIDList,
|
|
1108
|
+
)
|
|
1109
|
+
|
|
1110
|
+
async def get(
|
|
1111
|
+
self,
|
|
1112
|
+
loadbalancer_id: str,
|
|
1113
|
+
*,
|
|
1114
|
+
project_id: int | None = None,
|
|
1115
|
+
region_id: int | None = None,
|
|
1116
|
+
show_stats: bool | NotGiven = NOT_GIVEN,
|
|
1117
|
+
with_ddos: bool | NotGiven = NOT_GIVEN,
|
|
1118
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1119
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1120
|
+
extra_headers: Headers | None = None,
|
|
1121
|
+
extra_query: Query | None = None,
|
|
1122
|
+
extra_body: Body | None = None,
|
|
1123
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1124
|
+
) -> LoadBalancer:
|
|
1125
|
+
"""
|
|
1126
|
+
Get load balancer
|
|
1127
|
+
|
|
1128
|
+
Args:
|
|
1129
|
+
show_stats: Show statistics
|
|
1130
|
+
|
|
1131
|
+
with_ddos: Show DDoS profile
|
|
1132
|
+
|
|
1133
|
+
extra_headers: Send extra headers
|
|
1134
|
+
|
|
1135
|
+
extra_query: Add additional query parameters to the request
|
|
1136
|
+
|
|
1137
|
+
extra_body: Add additional JSON properties to the request
|
|
1138
|
+
|
|
1139
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1140
|
+
"""
|
|
1141
|
+
if project_id is None:
|
|
1142
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1143
|
+
if region_id is None:
|
|
1144
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1145
|
+
if not loadbalancer_id:
|
|
1146
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
1147
|
+
return await self._get(
|
|
1148
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
|
|
1149
|
+
options=make_request_options(
|
|
1150
|
+
extra_headers=extra_headers,
|
|
1151
|
+
extra_query=extra_query,
|
|
1152
|
+
extra_body=extra_body,
|
|
1153
|
+
timeout=timeout,
|
|
1154
|
+
query=await async_maybe_transform(
|
|
1155
|
+
{
|
|
1156
|
+
"show_stats": show_stats,
|
|
1157
|
+
"with_ddos": with_ddos,
|
|
1158
|
+
},
|
|
1159
|
+
load_balancer_get_params.LoadBalancerGetParams,
|
|
1160
|
+
),
|
|
1161
|
+
),
|
|
1162
|
+
cast_to=LoadBalancer,
|
|
1163
|
+
)
|
|
1164
|
+
|
|
1165
|
+
async def resize(
|
|
1166
|
+
self,
|
|
1167
|
+
loadbalancer_id: str,
|
|
1168
|
+
*,
|
|
1169
|
+
project_id: int | None = None,
|
|
1170
|
+
region_id: int | None = None,
|
|
1171
|
+
flavor: str,
|
|
1172
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1173
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1174
|
+
extra_headers: Headers | None = None,
|
|
1175
|
+
extra_query: Query | None = None,
|
|
1176
|
+
extra_body: Body | None = None,
|
|
1177
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1178
|
+
) -> TaskIDList:
|
|
1179
|
+
"""
|
|
1180
|
+
Resize loadbalancer
|
|
1181
|
+
|
|
1182
|
+
Args:
|
|
1183
|
+
flavor: Name of the desired flavor to resize to.
|
|
1184
|
+
|
|
1185
|
+
extra_headers: Send extra headers
|
|
1186
|
+
|
|
1187
|
+
extra_query: Add additional query parameters to the request
|
|
1188
|
+
|
|
1189
|
+
extra_body: Add additional JSON properties to the request
|
|
1190
|
+
|
|
1191
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1192
|
+
"""
|
|
1193
|
+
if project_id is None:
|
|
1194
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
1195
|
+
if region_id is None:
|
|
1196
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
1197
|
+
if not loadbalancer_id:
|
|
1198
|
+
raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
|
|
1199
|
+
return await self._post(
|
|
1200
|
+
f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize",
|
|
1201
|
+
body=await async_maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
|
|
1202
|
+
options=make_request_options(
|
|
1203
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1204
|
+
),
|
|
1205
|
+
cast_to=TaskIDList,
|
|
1206
|
+
)
|
|
1207
|
+
|
|
1208
|
+
async def create_and_poll(
|
|
1209
|
+
self,
|
|
1210
|
+
*,
|
|
1211
|
+
project_id: int | None = None,
|
|
1212
|
+
region_id: int | None = None,
|
|
1213
|
+
flavor: str | NotGiven = NOT_GIVEN,
|
|
1214
|
+
floating_ip: load_balancer_create_params.FloatingIP | NotGiven = NOT_GIVEN,
|
|
1215
|
+
listeners: Iterable[load_balancer_create_params.Listener] | NotGiven = NOT_GIVEN,
|
|
1216
|
+
logging: load_balancer_create_params.Logging | NotGiven = NOT_GIVEN,
|
|
1217
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
1218
|
+
name_template: str | NotGiven = NOT_GIVEN,
|
|
1219
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
1220
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
1221
|
+
vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
|
|
1222
|
+
vip_network_id: str | NotGiven = NOT_GIVEN,
|
|
1223
|
+
vip_port_id: str | NotGiven = NOT_GIVEN,
|
|
1224
|
+
vip_subnet_id: str | NotGiven = NOT_GIVEN,
|
|
1225
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1226
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1227
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1228
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1229
|
+
extra_headers: Headers | None = None,
|
|
1230
|
+
extra_query: Query | None = None,
|
|
1231
|
+
extra_body: Body | None = None,
|
|
1232
|
+
) -> LoadBalancer:
|
|
1233
|
+
response = await self.create(
|
|
1234
|
+
project_id=project_id,
|
|
1235
|
+
region_id=region_id,
|
|
1236
|
+
flavor=flavor,
|
|
1237
|
+
floating_ip=floating_ip,
|
|
1238
|
+
listeners=listeners,
|
|
1239
|
+
logging=logging,
|
|
1240
|
+
name=name,
|
|
1241
|
+
name_template=name_template,
|
|
1242
|
+
preferred_connectivity=preferred_connectivity,
|
|
1243
|
+
tags=tags,
|
|
1244
|
+
vip_ip_family=vip_ip_family,
|
|
1245
|
+
vip_network_id=vip_network_id,
|
|
1246
|
+
vip_port_id=vip_port_id,
|
|
1247
|
+
vip_subnet_id=vip_subnet_id,
|
|
1248
|
+
extra_headers=extra_headers,
|
|
1249
|
+
extra_query=extra_query,
|
|
1250
|
+
extra_body=extra_body,
|
|
1251
|
+
timeout=timeout,
|
|
1252
|
+
)
|
|
1253
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1254
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1255
|
+
task = await self._client.cloud.tasks.poll(
|
|
1256
|
+
task_id=response.tasks[0],
|
|
1257
|
+
extra_headers=extra_headers,
|
|
1258
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1259
|
+
)
|
|
1260
|
+
if not task.created_resources or not task.created_resources.loadbalancers or len(task.created_resources.loadbalancers) != 1:
|
|
1261
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
1262
|
+
return await self.get(
|
|
1263
|
+
loadbalancer_id=task.created_resources.loadbalancers[0],
|
|
1264
|
+
project_id=project_id,
|
|
1265
|
+
region_id=region_id,
|
|
1266
|
+
extra_headers=extra_headers,
|
|
1267
|
+
timeout=timeout,
|
|
1268
|
+
)
|
|
1269
|
+
|
|
1270
|
+
async def delete_and_poll(
|
|
1271
|
+
self,
|
|
1272
|
+
loadbalancer_id: str,
|
|
1273
|
+
*,
|
|
1274
|
+
project_id: int | None = None,
|
|
1275
|
+
region_id: int | None = None,
|
|
1276
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1277
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1278
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1279
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1280
|
+
extra_headers: Headers | None = None,
|
|
1281
|
+
extra_query: Query | None = None,
|
|
1282
|
+
extra_body: Body | None = None,
|
|
1283
|
+
) -> None:
|
|
1284
|
+
response = await self.delete(
|
|
1285
|
+
loadbalancer_id=loadbalancer_id,
|
|
1286
|
+
project_id=project_id,
|
|
1287
|
+
region_id=region_id,
|
|
1288
|
+
extra_headers=extra_headers,
|
|
1289
|
+
extra_query=extra_query,
|
|
1290
|
+
extra_body=extra_body,
|
|
1291
|
+
timeout=timeout,
|
|
1292
|
+
)
|
|
1293
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1294
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1295
|
+
await self._client.cloud.tasks.poll(
|
|
1296
|
+
task_id=response.tasks[0],
|
|
1297
|
+
extra_headers=extra_headers,
|
|
1298
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1299
|
+
)
|
|
1300
|
+
|
|
1301
|
+
async def failover_and_poll(
|
|
1302
|
+
self,
|
|
1303
|
+
loadbalancer_id: str,
|
|
1304
|
+
*,
|
|
1305
|
+
project_id: int | None = None,
|
|
1306
|
+
region_id: int | None = None,
|
|
1307
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
1308
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1309
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1310
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1311
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1312
|
+
extra_headers: Headers | None = None,
|
|
1313
|
+
extra_query: Query | None = None,
|
|
1314
|
+
extra_body: Body | None = None,
|
|
1315
|
+
) -> LoadBalancer:
|
|
1316
|
+
response = await self.failover(
|
|
1317
|
+
loadbalancer_id=loadbalancer_id,
|
|
1318
|
+
project_id=project_id,
|
|
1319
|
+
region_id=region_id,
|
|
1320
|
+
force=force,
|
|
1321
|
+
extra_headers=extra_headers,
|
|
1322
|
+
extra_query=extra_query,
|
|
1323
|
+
extra_body=extra_body,
|
|
1324
|
+
timeout=timeout,
|
|
1325
|
+
)
|
|
1326
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1327
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1328
|
+
await self._client.cloud.tasks.poll(
|
|
1329
|
+
task_id=response.tasks[0],
|
|
1330
|
+
extra_headers=extra_headers,
|
|
1331
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1332
|
+
)
|
|
1333
|
+
return await self.get(
|
|
1334
|
+
loadbalancer_id=loadbalancer_id,
|
|
1335
|
+
project_id=project_id,
|
|
1336
|
+
region_id=region_id,
|
|
1337
|
+
extra_headers=extra_headers,
|
|
1338
|
+
timeout=timeout,
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
async def resize_and_poll(
|
|
1342
|
+
self,
|
|
1343
|
+
loadbalancer_id: str,
|
|
1344
|
+
*,
|
|
1345
|
+
project_id: int | None = None,
|
|
1346
|
+
region_id: int | None = None,
|
|
1347
|
+
flavor: str,
|
|
1348
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1349
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1350
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1351
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1352
|
+
extra_headers: Headers | None = None,
|
|
1353
|
+
extra_query: Query | None = None,
|
|
1354
|
+
extra_body: Body | None = None,
|
|
1355
|
+
) -> LoadBalancer:
|
|
1356
|
+
response = await self.resize(
|
|
1357
|
+
loadbalancer_id=loadbalancer_id,
|
|
1358
|
+
project_id=project_id,
|
|
1359
|
+
region_id=region_id,
|
|
1360
|
+
flavor=flavor,
|
|
1361
|
+
extra_headers=extra_headers,
|
|
1362
|
+
extra_query=extra_query,
|
|
1363
|
+
extra_body=extra_body,
|
|
1364
|
+
timeout=timeout,
|
|
1365
|
+
)
|
|
1366
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1367
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1368
|
+
await self._client.cloud.tasks.poll(
|
|
1369
|
+
task_id=response.tasks[0],
|
|
1370
|
+
extra_headers=extra_headers,
|
|
1371
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1372
|
+
)
|
|
1373
|
+
return await self.get(
|
|
1374
|
+
loadbalancer_id=loadbalancer_id,
|
|
1375
|
+
project_id=project_id,
|
|
1376
|
+
region_id=region_id,
|
|
1377
|
+
extra_headers=extra_headers,
|
|
1378
|
+
timeout=timeout,
|
|
1379
|
+
)
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
class LoadBalancersResourceWithRawResponse:
|
|
1383
|
+
def __init__(self, load_balancers: LoadBalancersResource) -> None:
|
|
1384
|
+
self._load_balancers = load_balancers
|
|
1385
|
+
|
|
1386
|
+
self.create = to_raw_response_wrapper(
|
|
1387
|
+
load_balancers.create,
|
|
1388
|
+
)
|
|
1389
|
+
self.update = to_raw_response_wrapper(
|
|
1390
|
+
load_balancers.update,
|
|
1391
|
+
)
|
|
1392
|
+
self.list = to_raw_response_wrapper(
|
|
1393
|
+
load_balancers.list,
|
|
1394
|
+
)
|
|
1395
|
+
self.delete = to_raw_response_wrapper(
|
|
1396
|
+
load_balancers.delete,
|
|
1397
|
+
)
|
|
1398
|
+
self.failover = to_raw_response_wrapper(
|
|
1399
|
+
load_balancers.failover,
|
|
1400
|
+
)
|
|
1401
|
+
self.get = to_raw_response_wrapper(
|
|
1402
|
+
load_balancers.get,
|
|
1403
|
+
)
|
|
1404
|
+
self.resize = to_raw_response_wrapper(
|
|
1405
|
+
load_balancers.resize,
|
|
1406
|
+
)
|
|
1407
|
+
|
|
1408
|
+
@cached_property
|
|
1409
|
+
def l7_policies(self) -> L7PoliciesResourceWithRawResponse:
|
|
1410
|
+
return L7PoliciesResourceWithRawResponse(self._load_balancers.l7_policies)
|
|
1411
|
+
|
|
1412
|
+
@cached_property
|
|
1413
|
+
def flavors(self) -> FlavorsResourceWithRawResponse:
|
|
1414
|
+
return FlavorsResourceWithRawResponse(self._load_balancers.flavors)
|
|
1415
|
+
|
|
1416
|
+
@cached_property
|
|
1417
|
+
def listeners(self) -> ListenersResourceWithRawResponse:
|
|
1418
|
+
return ListenersResourceWithRawResponse(self._load_balancers.listeners)
|
|
1419
|
+
|
|
1420
|
+
@cached_property
|
|
1421
|
+
def pools(self) -> PoolsResourceWithRawResponse:
|
|
1422
|
+
return PoolsResourceWithRawResponse(self._load_balancers.pools)
|
|
1423
|
+
|
|
1424
|
+
@cached_property
|
|
1425
|
+
def metrics(self) -> MetricsResourceWithRawResponse:
|
|
1426
|
+
return MetricsResourceWithRawResponse(self._load_balancers.metrics)
|
|
1427
|
+
|
|
1428
|
+
@cached_property
|
|
1429
|
+
def statuses(self) -> StatusesResourceWithRawResponse:
|
|
1430
|
+
return StatusesResourceWithRawResponse(self._load_balancers.statuses)
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
class AsyncLoadBalancersResourceWithRawResponse:
|
|
1434
|
+
def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None:
|
|
1435
|
+
self._load_balancers = load_balancers
|
|
1436
|
+
|
|
1437
|
+
self.create = async_to_raw_response_wrapper(
|
|
1438
|
+
load_balancers.create,
|
|
1439
|
+
)
|
|
1440
|
+
self.update = async_to_raw_response_wrapper(
|
|
1441
|
+
load_balancers.update,
|
|
1442
|
+
)
|
|
1443
|
+
self.list = async_to_raw_response_wrapper(
|
|
1444
|
+
load_balancers.list,
|
|
1445
|
+
)
|
|
1446
|
+
self.delete = async_to_raw_response_wrapper(
|
|
1447
|
+
load_balancers.delete,
|
|
1448
|
+
)
|
|
1449
|
+
self.failover = async_to_raw_response_wrapper(
|
|
1450
|
+
load_balancers.failover,
|
|
1451
|
+
)
|
|
1452
|
+
self.get = async_to_raw_response_wrapper(
|
|
1453
|
+
load_balancers.get,
|
|
1454
|
+
)
|
|
1455
|
+
self.resize = async_to_raw_response_wrapper(
|
|
1456
|
+
load_balancers.resize,
|
|
1457
|
+
)
|
|
1458
|
+
|
|
1459
|
+
@cached_property
|
|
1460
|
+
def l7_policies(self) -> AsyncL7PoliciesResourceWithRawResponse:
|
|
1461
|
+
return AsyncL7PoliciesResourceWithRawResponse(self._load_balancers.l7_policies)
|
|
1462
|
+
|
|
1463
|
+
@cached_property
|
|
1464
|
+
def flavors(self) -> AsyncFlavorsResourceWithRawResponse:
|
|
1465
|
+
return AsyncFlavorsResourceWithRawResponse(self._load_balancers.flavors)
|
|
1466
|
+
|
|
1467
|
+
@cached_property
|
|
1468
|
+
def listeners(self) -> AsyncListenersResourceWithRawResponse:
|
|
1469
|
+
return AsyncListenersResourceWithRawResponse(self._load_balancers.listeners)
|
|
1470
|
+
|
|
1471
|
+
@cached_property
|
|
1472
|
+
def pools(self) -> AsyncPoolsResourceWithRawResponse:
|
|
1473
|
+
return AsyncPoolsResourceWithRawResponse(self._load_balancers.pools)
|
|
1474
|
+
|
|
1475
|
+
@cached_property
|
|
1476
|
+
def metrics(self) -> AsyncMetricsResourceWithRawResponse:
|
|
1477
|
+
return AsyncMetricsResourceWithRawResponse(self._load_balancers.metrics)
|
|
1478
|
+
|
|
1479
|
+
@cached_property
|
|
1480
|
+
def statuses(self) -> AsyncStatusesResourceWithRawResponse:
|
|
1481
|
+
return AsyncStatusesResourceWithRawResponse(self._load_balancers.statuses)
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
class LoadBalancersResourceWithStreamingResponse:
|
|
1485
|
+
def __init__(self, load_balancers: LoadBalancersResource) -> None:
|
|
1486
|
+
self._load_balancers = load_balancers
|
|
1487
|
+
|
|
1488
|
+
self.create = to_streamed_response_wrapper(
|
|
1489
|
+
load_balancers.create,
|
|
1490
|
+
)
|
|
1491
|
+
self.update = to_streamed_response_wrapper(
|
|
1492
|
+
load_balancers.update,
|
|
1493
|
+
)
|
|
1494
|
+
self.list = to_streamed_response_wrapper(
|
|
1495
|
+
load_balancers.list,
|
|
1496
|
+
)
|
|
1497
|
+
self.delete = to_streamed_response_wrapper(
|
|
1498
|
+
load_balancers.delete,
|
|
1499
|
+
)
|
|
1500
|
+
self.failover = to_streamed_response_wrapper(
|
|
1501
|
+
load_balancers.failover,
|
|
1502
|
+
)
|
|
1503
|
+
self.get = to_streamed_response_wrapper(
|
|
1504
|
+
load_balancers.get,
|
|
1505
|
+
)
|
|
1506
|
+
self.resize = to_streamed_response_wrapper(
|
|
1507
|
+
load_balancers.resize,
|
|
1508
|
+
)
|
|
1509
|
+
|
|
1510
|
+
@cached_property
|
|
1511
|
+
def l7_policies(self) -> L7PoliciesResourceWithStreamingResponse:
|
|
1512
|
+
return L7PoliciesResourceWithStreamingResponse(self._load_balancers.l7_policies)
|
|
1513
|
+
|
|
1514
|
+
@cached_property
|
|
1515
|
+
def flavors(self) -> FlavorsResourceWithStreamingResponse:
|
|
1516
|
+
return FlavorsResourceWithStreamingResponse(self._load_balancers.flavors)
|
|
1517
|
+
|
|
1518
|
+
@cached_property
|
|
1519
|
+
def listeners(self) -> ListenersResourceWithStreamingResponse:
|
|
1520
|
+
return ListenersResourceWithStreamingResponse(self._load_balancers.listeners)
|
|
1521
|
+
|
|
1522
|
+
@cached_property
|
|
1523
|
+
def pools(self) -> PoolsResourceWithStreamingResponse:
|
|
1524
|
+
return PoolsResourceWithStreamingResponse(self._load_balancers.pools)
|
|
1525
|
+
|
|
1526
|
+
@cached_property
|
|
1527
|
+
def metrics(self) -> MetricsResourceWithStreamingResponse:
|
|
1528
|
+
return MetricsResourceWithStreamingResponse(self._load_balancers.metrics)
|
|
1529
|
+
|
|
1530
|
+
@cached_property
|
|
1531
|
+
def statuses(self) -> StatusesResourceWithStreamingResponse:
|
|
1532
|
+
return StatusesResourceWithStreamingResponse(self._load_balancers.statuses)
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
class AsyncLoadBalancersResourceWithStreamingResponse:
|
|
1536
|
+
def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None:
|
|
1537
|
+
self._load_balancers = load_balancers
|
|
1538
|
+
|
|
1539
|
+
self.create = async_to_streamed_response_wrapper(
|
|
1540
|
+
load_balancers.create,
|
|
1541
|
+
)
|
|
1542
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1543
|
+
load_balancers.update,
|
|
1544
|
+
)
|
|
1545
|
+
self.list = async_to_streamed_response_wrapper(
|
|
1546
|
+
load_balancers.list,
|
|
1547
|
+
)
|
|
1548
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
1549
|
+
load_balancers.delete,
|
|
1550
|
+
)
|
|
1551
|
+
self.failover = async_to_streamed_response_wrapper(
|
|
1552
|
+
load_balancers.failover,
|
|
1553
|
+
)
|
|
1554
|
+
self.get = async_to_streamed_response_wrapper(
|
|
1555
|
+
load_balancers.get,
|
|
1556
|
+
)
|
|
1557
|
+
self.resize = async_to_streamed_response_wrapper(
|
|
1558
|
+
load_balancers.resize,
|
|
1559
|
+
)
|
|
1560
|
+
|
|
1561
|
+
@cached_property
|
|
1562
|
+
def l7_policies(self) -> AsyncL7PoliciesResourceWithStreamingResponse:
|
|
1563
|
+
return AsyncL7PoliciesResourceWithStreamingResponse(self._load_balancers.l7_policies)
|
|
1564
|
+
|
|
1565
|
+
@cached_property
|
|
1566
|
+
def flavors(self) -> AsyncFlavorsResourceWithStreamingResponse:
|
|
1567
|
+
return AsyncFlavorsResourceWithStreamingResponse(self._load_balancers.flavors)
|
|
1568
|
+
|
|
1569
|
+
@cached_property
|
|
1570
|
+
def listeners(self) -> AsyncListenersResourceWithStreamingResponse:
|
|
1571
|
+
return AsyncListenersResourceWithStreamingResponse(self._load_balancers.listeners)
|
|
1572
|
+
|
|
1573
|
+
@cached_property
|
|
1574
|
+
def pools(self) -> AsyncPoolsResourceWithStreamingResponse:
|
|
1575
|
+
return AsyncPoolsResourceWithStreamingResponse(self._load_balancers.pools)
|
|
1576
|
+
|
|
1577
|
+
@cached_property
|
|
1578
|
+
def metrics(self) -> AsyncMetricsResourceWithStreamingResponse:
|
|
1579
|
+
return AsyncMetricsResourceWithStreamingResponse(self._load_balancers.metrics)
|
|
1580
|
+
|
|
1581
|
+
@cached_property
|
|
1582
|
+
def statuses(self) -> AsyncStatusesResourceWithStreamingResponse:
|
|
1583
|
+
return AsyncStatusesResourceWithStreamingResponse(self._load_balancers.statuses)
|