gcore 0.1.0a2__py3-none-any.whl → 0.2.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 +5 -0
- gcore/_client.py +9 -0
- gcore/_utils/_proxy.py +4 -1
- gcore/_utils/_resources_proxy.py +24 -0
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/baremetal/servers.py +234 -0
- gcore/resources/cloud/billing_reservations.py +24 -0
- gcore/resources/cloud/file_shares/file_shares.py +16 -0
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +352 -2
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +204 -0
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +80 -0
- gcore/resources/cloud/inference/deployments/deployments.py +322 -4
- gcore/resources/cloud/instances/images.py +316 -0
- gcore/resources/cloud/instances/instances.py +472 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +282 -0
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +326 -0
- gcore/resources/cloud/load_balancers/listeners.py +371 -6
- gcore/resources/cloud/load_balancers/load_balancers.py +364 -0
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +24 -0
- gcore/resources/cloud/load_balancers/pools/members.py +28 -0
- gcore/resources/cloud/load_balancers/pools/pools.py +388 -8
- gcore/resources/cloud/networks/networks.py +72 -16
- gcore/resources/cloud/secrets.py +56 -11
- gcore/resources/cloud/tasks.py +107 -96
- 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/cloud/__init__.py +1 -0
- gcore/types/cloud/billing_reservation_list_params.py +5 -0
- gcore/types/cloud/container_probe_config_create_param.py +1 -2
- gcore/types/cloud/file_share.py +3 -0
- gcore/types/cloud/file_share_list_params.py +7 -1
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +20 -0
- gcore/types/cloud/inference/deployment_update_params.py +203 -6
- gcore/types/cloud/inference/inference.py +3 -1
- gcore/types/cloud/load_balancer_listener_detail.py +13 -13
- gcore/types/cloud/load_balancer_pool.py +13 -13
- gcore/types/cloud/load_balancer_pool_list.py +99 -4
- gcore/types/cloud/load_balancers/listener_create_params.py +2 -0
- gcore/types/cloud/load_balancers/listener_get_params.py +3 -1
- gcore/types/cloud/load_balancers/listener_list_params.py +4 -2
- gcore/types/cloud/load_balancers/listener_update_params.py +2 -0
- gcore/types/cloud/load_balancers/pool_create_params.py +2 -0
- gcore/types/cloud/load_balancers/pool_list_params.py +5 -6
- gcore/types/cloud/load_balancers/pool_update_params.py +2 -0
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +2 -0
- gcore/types/cloud/load_balancers/pools/member_add_params.py +2 -0
- gcore/types/cloud/network.py +21 -21
- gcore/types/cloud/network_create_params.py +2 -0
- gcore/types/cloud/network_details.py +24 -23
- gcore/types/cloud/network_list_params.py +15 -10
- gcore/types/cloud/network_update_params.py +2 -0
- gcore/types/cloud/quota_get_all_response.py +18 -0
- gcore/types/cloud/quota_get_by_region_response.py +18 -0
- gcore/types/cloud/quotas/request_create_params.py +9 -0
- gcore/types/cloud/quotas/request_get_response.py +9 -0
- gcore/types/cloud/quotas/request_list_response.py +9 -0
- gcore/types/cloud/secret_list_params.py +24 -0
- gcore/types/cloud/task.py +0 -3
- gcore/types/cloud/task_list_params.py +8 -2
- 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.0a2.dist-info → gcore-0.2.0.dist-info}/METADATA +3 -3
- {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/RECORD +78 -60
- {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/WHEEL +0 -0
- {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -557,6 +557,188 @@ class LoadBalancersResource(SyncAPIResource):
|
|
|
557
557
|
cast_to=TaskIDList,
|
|
558
558
|
)
|
|
559
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
|
+
"""
|
|
637
|
+
Delete load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
638
|
+
"""
|
|
639
|
+
response = self.delete(
|
|
640
|
+
loadbalancer_id=loadbalancer_id,
|
|
641
|
+
project_id=project_id,
|
|
642
|
+
region_id=region_id,
|
|
643
|
+
extra_headers=extra_headers,
|
|
644
|
+
extra_query=extra_query,
|
|
645
|
+
extra_body=extra_body,
|
|
646
|
+
timeout=timeout,
|
|
647
|
+
)
|
|
648
|
+
if not response.tasks:
|
|
649
|
+
raise ValueError("Expected at least one task to be created")
|
|
650
|
+
self._client.cloud.tasks.poll(
|
|
651
|
+
task_id=response.tasks[0],
|
|
652
|
+
extra_headers=extra_headers,
|
|
653
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
def failover_and_poll(
|
|
657
|
+
self,
|
|
658
|
+
loadbalancer_id: str,
|
|
659
|
+
*,
|
|
660
|
+
project_id: int | None = None,
|
|
661
|
+
region_id: int | None = None,
|
|
662
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
663
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
664
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
665
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
667
|
+
extra_headers: Headers | None = None,
|
|
668
|
+
extra_query: Query | None = None,
|
|
669
|
+
extra_body: Body | None = None,
|
|
670
|
+
) -> LoadBalancer:
|
|
671
|
+
"""
|
|
672
|
+
Failover load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
673
|
+
"""
|
|
674
|
+
response = self.failover(
|
|
675
|
+
loadbalancer_id=loadbalancer_id,
|
|
676
|
+
project_id=project_id,
|
|
677
|
+
region_id=region_id,
|
|
678
|
+
force=force,
|
|
679
|
+
extra_headers=extra_headers,
|
|
680
|
+
extra_query=extra_query,
|
|
681
|
+
extra_body=extra_body,
|
|
682
|
+
timeout=timeout,
|
|
683
|
+
)
|
|
684
|
+
if not response.tasks:
|
|
685
|
+
raise ValueError("Expected at least one task to be created")
|
|
686
|
+
self._client.cloud.tasks.poll(
|
|
687
|
+
task_id=response.tasks[0],
|
|
688
|
+
extra_headers=extra_headers,
|
|
689
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
690
|
+
)
|
|
691
|
+
return self.get(
|
|
692
|
+
loadbalancer_id=loadbalancer_id,
|
|
693
|
+
project_id=project_id,
|
|
694
|
+
region_id=region_id,
|
|
695
|
+
extra_headers=extra_headers,
|
|
696
|
+
timeout=timeout,
|
|
697
|
+
)
|
|
698
|
+
|
|
699
|
+
def resize_and_poll(
|
|
700
|
+
self,
|
|
701
|
+
loadbalancer_id: str,
|
|
702
|
+
*,
|
|
703
|
+
project_id: int | None = None,
|
|
704
|
+
region_id: int | None = None,
|
|
705
|
+
flavor: str,
|
|
706
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
707
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
708
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
709
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
710
|
+
extra_headers: Headers | None = None,
|
|
711
|
+
extra_query: Query | None = None,
|
|
712
|
+
extra_body: Body | None = None,
|
|
713
|
+
) -> LoadBalancer:
|
|
714
|
+
"""
|
|
715
|
+
Resize load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
716
|
+
"""
|
|
717
|
+
response = self.resize(
|
|
718
|
+
loadbalancer_id=loadbalancer_id,
|
|
719
|
+
project_id=project_id,
|
|
720
|
+
region_id=region_id,
|
|
721
|
+
flavor=flavor,
|
|
722
|
+
extra_headers=extra_headers,
|
|
723
|
+
extra_query=extra_query,
|
|
724
|
+
extra_body=extra_body,
|
|
725
|
+
timeout=timeout,
|
|
726
|
+
)
|
|
727
|
+
if not response.tasks:
|
|
728
|
+
raise ValueError("Expected at least one task to be created")
|
|
729
|
+
self._client.cloud.tasks.poll(
|
|
730
|
+
task_id=response.tasks[0],
|
|
731
|
+
extra_headers=extra_headers,
|
|
732
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
733
|
+
)
|
|
734
|
+
return self.get(
|
|
735
|
+
loadbalancer_id=loadbalancer_id,
|
|
736
|
+
project_id=project_id,
|
|
737
|
+
region_id=region_id,
|
|
738
|
+
extra_headers=extra_headers,
|
|
739
|
+
timeout=timeout,
|
|
740
|
+
)
|
|
741
|
+
|
|
560
742
|
|
|
561
743
|
class AsyncLoadBalancersResource(AsyncAPIResource):
|
|
562
744
|
@cached_property
|
|
@@ -1032,6 +1214,188 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
|
|
|
1032
1214
|
cast_to=TaskIDList,
|
|
1033
1215
|
)
|
|
1034
1216
|
|
|
1217
|
+
async def create_and_poll(
|
|
1218
|
+
self,
|
|
1219
|
+
*,
|
|
1220
|
+
project_id: int | None = None,
|
|
1221
|
+
region_id: int | None = None,
|
|
1222
|
+
flavor: str | NotGiven = NOT_GIVEN,
|
|
1223
|
+
floating_ip: load_balancer_create_params.FloatingIP | NotGiven = NOT_GIVEN,
|
|
1224
|
+
listeners: Iterable[load_balancer_create_params.Listener] | NotGiven = NOT_GIVEN,
|
|
1225
|
+
logging: load_balancer_create_params.Logging | NotGiven = NOT_GIVEN,
|
|
1226
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
1227
|
+
name_template: str | NotGiven = NOT_GIVEN,
|
|
1228
|
+
preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
|
|
1229
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
1230
|
+
vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
|
|
1231
|
+
vip_network_id: str | NotGiven = NOT_GIVEN,
|
|
1232
|
+
vip_port_id: str | NotGiven = NOT_GIVEN,
|
|
1233
|
+
vip_subnet_id: str | NotGiven = NOT_GIVEN,
|
|
1234
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1235
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1236
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1237
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1238
|
+
extra_headers: Headers | None = None,
|
|
1239
|
+
extra_query: Query | None = None,
|
|
1240
|
+
extra_body: Body | None = None,
|
|
1241
|
+
) -> LoadBalancer:
|
|
1242
|
+
response = await self.create(
|
|
1243
|
+
project_id=project_id,
|
|
1244
|
+
region_id=region_id,
|
|
1245
|
+
flavor=flavor,
|
|
1246
|
+
floating_ip=floating_ip,
|
|
1247
|
+
listeners=listeners,
|
|
1248
|
+
logging=logging,
|
|
1249
|
+
name=name,
|
|
1250
|
+
name_template=name_template,
|
|
1251
|
+
preferred_connectivity=preferred_connectivity,
|
|
1252
|
+
tags=tags,
|
|
1253
|
+
vip_ip_family=vip_ip_family,
|
|
1254
|
+
vip_network_id=vip_network_id,
|
|
1255
|
+
vip_port_id=vip_port_id,
|
|
1256
|
+
vip_subnet_id=vip_subnet_id,
|
|
1257
|
+
extra_headers=extra_headers,
|
|
1258
|
+
extra_query=extra_query,
|
|
1259
|
+
extra_body=extra_body,
|
|
1260
|
+
timeout=timeout,
|
|
1261
|
+
)
|
|
1262
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1263
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1264
|
+
task = await self._client.cloud.tasks.poll(
|
|
1265
|
+
task_id=response.tasks[0],
|
|
1266
|
+
extra_headers=extra_headers,
|
|
1267
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1268
|
+
)
|
|
1269
|
+
if not task.created_resources or not task.created_resources.loadbalancers or len(task.created_resources.loadbalancers) != 1:
|
|
1270
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
1271
|
+
return await self.get(
|
|
1272
|
+
loadbalancer_id=task.created_resources.loadbalancers[0],
|
|
1273
|
+
project_id=project_id,
|
|
1274
|
+
region_id=region_id,
|
|
1275
|
+
extra_headers=extra_headers,
|
|
1276
|
+
timeout=timeout,
|
|
1277
|
+
)
|
|
1278
|
+
|
|
1279
|
+
async def delete_and_poll(
|
|
1280
|
+
self,
|
|
1281
|
+
loadbalancer_id: str,
|
|
1282
|
+
*,
|
|
1283
|
+
project_id: int | None = None,
|
|
1284
|
+
region_id: int | None = None,
|
|
1285
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1286
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1287
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1288
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1289
|
+
extra_headers: Headers | None = None,
|
|
1290
|
+
extra_query: Query | None = None,
|
|
1291
|
+
extra_body: Body | None = None,
|
|
1292
|
+
) -> None:
|
|
1293
|
+
"""
|
|
1294
|
+
Delete load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1295
|
+
"""
|
|
1296
|
+
response = await self.delete(
|
|
1297
|
+
loadbalancer_id=loadbalancer_id,
|
|
1298
|
+
project_id=project_id,
|
|
1299
|
+
region_id=region_id,
|
|
1300
|
+
extra_headers=extra_headers,
|
|
1301
|
+
extra_query=extra_query,
|
|
1302
|
+
extra_body=extra_body,
|
|
1303
|
+
timeout=timeout,
|
|
1304
|
+
)
|
|
1305
|
+
if not response.tasks:
|
|
1306
|
+
raise ValueError("Expected at least one task to be created")
|
|
1307
|
+
await self._client.cloud.tasks.poll(
|
|
1308
|
+
task_id=response.tasks[0],
|
|
1309
|
+
extra_headers=extra_headers,
|
|
1310
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1311
|
+
)
|
|
1312
|
+
|
|
1313
|
+
async def failover_and_poll(
|
|
1314
|
+
self,
|
|
1315
|
+
loadbalancer_id: str,
|
|
1316
|
+
*,
|
|
1317
|
+
project_id: int | None = None,
|
|
1318
|
+
region_id: int | None = None,
|
|
1319
|
+
force: bool | NotGiven = NOT_GIVEN,
|
|
1320
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1321
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1322
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1323
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1324
|
+
extra_headers: Headers | None = None,
|
|
1325
|
+
extra_query: Query | None = None,
|
|
1326
|
+
extra_body: Body | None = None,
|
|
1327
|
+
) -> LoadBalancer:
|
|
1328
|
+
"""
|
|
1329
|
+
Failover load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1330
|
+
"""
|
|
1331
|
+
response = await self.failover(
|
|
1332
|
+
loadbalancer_id=loadbalancer_id,
|
|
1333
|
+
project_id=project_id,
|
|
1334
|
+
region_id=region_id,
|
|
1335
|
+
force=force,
|
|
1336
|
+
extra_headers=extra_headers,
|
|
1337
|
+
extra_query=extra_query,
|
|
1338
|
+
extra_body=extra_body,
|
|
1339
|
+
timeout=timeout,
|
|
1340
|
+
)
|
|
1341
|
+
if not response.tasks:
|
|
1342
|
+
raise ValueError("Expected at least one task to be created")
|
|
1343
|
+
await self._client.cloud.tasks.poll(
|
|
1344
|
+
task_id=response.tasks[0],
|
|
1345
|
+
extra_headers=extra_headers,
|
|
1346
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1347
|
+
)
|
|
1348
|
+
return await self.get(
|
|
1349
|
+
loadbalancer_id=loadbalancer_id,
|
|
1350
|
+
project_id=project_id,
|
|
1351
|
+
region_id=region_id,
|
|
1352
|
+
extra_headers=extra_headers,
|
|
1353
|
+
timeout=timeout,
|
|
1354
|
+
)
|
|
1355
|
+
|
|
1356
|
+
async def resize_and_poll(
|
|
1357
|
+
self,
|
|
1358
|
+
loadbalancer_id: str,
|
|
1359
|
+
*,
|
|
1360
|
+
project_id: int | None = None,
|
|
1361
|
+
region_id: int | None = None,
|
|
1362
|
+
flavor: str,
|
|
1363
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1364
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1365
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1366
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1367
|
+
extra_headers: Headers | None = None,
|
|
1368
|
+
extra_query: Query | None = None,
|
|
1369
|
+
extra_body: Body | None = None,
|
|
1370
|
+
) -> LoadBalancer:
|
|
1371
|
+
"""
|
|
1372
|
+
Resize load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1373
|
+
"""
|
|
1374
|
+
response = await self.resize(
|
|
1375
|
+
loadbalancer_id=loadbalancer_id,
|
|
1376
|
+
project_id=project_id,
|
|
1377
|
+
region_id=region_id,
|
|
1378
|
+
flavor=flavor,
|
|
1379
|
+
extra_headers=extra_headers,
|
|
1380
|
+
extra_query=extra_query,
|
|
1381
|
+
extra_body=extra_body,
|
|
1382
|
+
timeout=timeout,
|
|
1383
|
+
)
|
|
1384
|
+
if not response.tasks:
|
|
1385
|
+
raise ValueError("Expected at least one task to be created")
|
|
1386
|
+
await self._client.cloud.tasks.poll(
|
|
1387
|
+
task_id=response.tasks[0],
|
|
1388
|
+
extra_headers=extra_headers,
|
|
1389
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1390
|
+
)
|
|
1391
|
+
return await self.get(
|
|
1392
|
+
loadbalancer_id=loadbalancer_id,
|
|
1393
|
+
project_id=project_id,
|
|
1394
|
+
region_id=region_id,
|
|
1395
|
+
extra_headers=extra_headers,
|
|
1396
|
+
timeout=timeout,
|
|
1397
|
+
)
|
|
1398
|
+
|
|
1035
1399
|
|
|
1036
1400
|
class LoadBalancersResourceWithRawResponse:
|
|
1037
1401
|
def __init__(self, load_balancers: LoadBalancersResource) -> None:
|
|
@@ -71,6 +71,12 @@ class HealthMonitorsResource(SyncAPIResource):
|
|
|
71
71
|
Create Load Balancer Pool Health Monitor
|
|
72
72
|
|
|
73
73
|
Args:
|
|
74
|
+
project_id: Project ID
|
|
75
|
+
|
|
76
|
+
region_id: Region ID
|
|
77
|
+
|
|
78
|
+
pool_id: Pool ID
|
|
79
|
+
|
|
74
80
|
delay: The time, in seconds, between sending probes to members
|
|
75
81
|
|
|
76
82
|
max_retries: Number of successes before the member is switched to ONLINE state
|
|
@@ -141,6 +147,12 @@ class HealthMonitorsResource(SyncAPIResource):
|
|
|
141
147
|
Delete load balancer pool health monitor
|
|
142
148
|
|
|
143
149
|
Args:
|
|
150
|
+
project_id: Project ID
|
|
151
|
+
|
|
152
|
+
region_id: Region ID
|
|
153
|
+
|
|
154
|
+
pool_id: Pool ID
|
|
155
|
+
|
|
144
156
|
extra_headers: Send extra headers
|
|
145
157
|
|
|
146
158
|
extra_query: Add additional query parameters to the request
|
|
@@ -210,6 +222,12 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
|
|
|
210
222
|
Create Load Balancer Pool Health Monitor
|
|
211
223
|
|
|
212
224
|
Args:
|
|
225
|
+
project_id: Project ID
|
|
226
|
+
|
|
227
|
+
region_id: Region ID
|
|
228
|
+
|
|
229
|
+
pool_id: Pool ID
|
|
230
|
+
|
|
213
231
|
delay: The time, in seconds, between sending probes to members
|
|
214
232
|
|
|
215
233
|
max_retries: Number of successes before the member is switched to ONLINE state
|
|
@@ -280,6 +298,12 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
|
|
|
280
298
|
Delete load balancer pool health monitor
|
|
281
299
|
|
|
282
300
|
Args:
|
|
301
|
+
project_id: Project ID
|
|
302
|
+
|
|
303
|
+
region_id: Region ID
|
|
304
|
+
|
|
305
|
+
pool_id: Pool ID
|
|
306
|
+
|
|
283
307
|
extra_headers: Send extra headers
|
|
284
308
|
|
|
285
309
|
extra_query: Add additional query parameters to the request
|
|
@@ -68,6 +68,12 @@ class MembersResource(SyncAPIResource):
|
|
|
68
68
|
Create load balancer pool member
|
|
69
69
|
|
|
70
70
|
Args:
|
|
71
|
+
project_id: Project ID
|
|
72
|
+
|
|
73
|
+
region_id: Region ID
|
|
74
|
+
|
|
75
|
+
pool_id: Pool ID
|
|
76
|
+
|
|
71
77
|
address: Member IP address
|
|
72
78
|
|
|
73
79
|
protocol_port: Member IP port
|
|
@@ -139,6 +145,14 @@ class MembersResource(SyncAPIResource):
|
|
|
139
145
|
Delete load balancer pool member
|
|
140
146
|
|
|
141
147
|
Args:
|
|
148
|
+
project_id: Project ID
|
|
149
|
+
|
|
150
|
+
region_id: Region ID
|
|
151
|
+
|
|
152
|
+
pool_id: Pool ID
|
|
153
|
+
|
|
154
|
+
member_id: Member ID
|
|
155
|
+
|
|
142
156
|
extra_headers: Send extra headers
|
|
143
157
|
|
|
144
158
|
extra_query: Add additional query parameters to the request
|
|
@@ -209,6 +223,12 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
209
223
|
Create load balancer pool member
|
|
210
224
|
|
|
211
225
|
Args:
|
|
226
|
+
project_id: Project ID
|
|
227
|
+
|
|
228
|
+
region_id: Region ID
|
|
229
|
+
|
|
230
|
+
pool_id: Pool ID
|
|
231
|
+
|
|
212
232
|
address: Member IP address
|
|
213
233
|
|
|
214
234
|
protocol_port: Member IP port
|
|
@@ -280,6 +300,14 @@ class AsyncMembersResource(AsyncAPIResource):
|
|
|
280
300
|
Delete load balancer pool member
|
|
281
301
|
|
|
282
302
|
Args:
|
|
303
|
+
project_id: Project ID
|
|
304
|
+
|
|
305
|
+
region_id: Region ID
|
|
306
|
+
|
|
307
|
+
pool_id: Pool ID
|
|
308
|
+
|
|
309
|
+
member_id: Member ID
|
|
310
|
+
|
|
283
311
|
extra_headers: Send extra headers
|
|
284
312
|
|
|
285
313
|
extra_query: Add additional query parameters to the request
|