gcore 0.1.0a1__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.0a1.dist-info → gcore-0.2.0.dist-info}/METADATA +4 -7
- {gcore-0.1.0a1.dist-info → gcore-0.2.0.dist-info}/RECORD +78 -60
- {gcore-0.1.0a1.dist-info → gcore-0.2.0.dist-info}/WHEEL +0 -0
- {gcore-0.1.0a1.dist-info → gcore-0.2.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -102,6 +102,10 @@ class PoolsResource(SyncAPIResource):
|
|
|
102
102
|
Create load balancer pool
|
|
103
103
|
|
|
104
104
|
Args:
|
|
105
|
+
project_id: Project ID
|
|
106
|
+
|
|
107
|
+
region_id: Region ID
|
|
108
|
+
|
|
105
109
|
lb_algorithm: Load balancer algorithm
|
|
106
110
|
|
|
107
111
|
name: Pool name
|
|
@@ -200,6 +204,12 @@ class PoolsResource(SyncAPIResource):
|
|
|
200
204
|
they will be overwritten.
|
|
201
205
|
|
|
202
206
|
Args:
|
|
207
|
+
project_id: Project ID
|
|
208
|
+
|
|
209
|
+
region_id: Region ID
|
|
210
|
+
|
|
211
|
+
pool_id: Pool ID
|
|
212
|
+
|
|
203
213
|
ca_secret_id: Secret ID of CA certificate bundle
|
|
204
214
|
|
|
205
215
|
crl_secret_id: Secret ID of CA revocation list file
|
|
@@ -283,12 +293,15 @@ class PoolsResource(SyncAPIResource):
|
|
|
283
293
|
List load balancer pools
|
|
284
294
|
|
|
285
295
|
Args:
|
|
286
|
-
|
|
287
|
-
|
|
296
|
+
project_id: Project ID
|
|
297
|
+
|
|
298
|
+
region_id: Region ID
|
|
288
299
|
|
|
289
|
-
|
|
300
|
+
details: Show members and Health Monitor details
|
|
290
301
|
|
|
291
|
-
|
|
302
|
+
listener_id: Listener ID
|
|
303
|
+
|
|
304
|
+
loadbalancer_id: Load Balancer ID
|
|
292
305
|
|
|
293
306
|
extra_headers: Send extra headers
|
|
294
307
|
|
|
@@ -338,6 +351,12 @@ class PoolsResource(SyncAPIResource):
|
|
|
338
351
|
Delete load balancer pool
|
|
339
352
|
|
|
340
353
|
Args:
|
|
354
|
+
project_id: Project ID
|
|
355
|
+
|
|
356
|
+
region_id: Region ID
|
|
357
|
+
|
|
358
|
+
pool_id: Pool ID
|
|
359
|
+
|
|
341
360
|
extra_headers: Send extra headers
|
|
342
361
|
|
|
343
362
|
extra_query: Add additional query parameters to the request
|
|
@@ -377,6 +396,12 @@ class PoolsResource(SyncAPIResource):
|
|
|
377
396
|
Get load balancer pool
|
|
378
397
|
|
|
379
398
|
Args:
|
|
399
|
+
project_id: Project ID
|
|
400
|
+
|
|
401
|
+
region_id: Region ID
|
|
402
|
+
|
|
403
|
+
pool_id: Pool ID
|
|
404
|
+
|
|
380
405
|
extra_headers: Send extra headers
|
|
381
406
|
|
|
382
407
|
extra_query: Add additional query parameters to the request
|
|
@@ -399,6 +424,171 @@ class PoolsResource(SyncAPIResource):
|
|
|
399
424
|
cast_to=LoadBalancerPool,
|
|
400
425
|
)
|
|
401
426
|
|
|
427
|
+
def create_and_poll(
|
|
428
|
+
self,
|
|
429
|
+
*,
|
|
430
|
+
project_id: int | None = None,
|
|
431
|
+
region_id: int | None = None,
|
|
432
|
+
lb_algorithm: LbAlgorithm,
|
|
433
|
+
name: str,
|
|
434
|
+
protocol: LbPoolProtocol,
|
|
435
|
+
ca_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
436
|
+
crl_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
437
|
+
healthmonitor: Optional[pool_create_params.Healthmonitor] | NotGiven = NOT_GIVEN,
|
|
438
|
+
listener_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
439
|
+
loadbalancer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
440
|
+
members: Optional[Iterable[pool_create_params.Member]] | NotGiven = NOT_GIVEN,
|
|
441
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
442
|
+
session_persistence: Optional[pool_create_params.SessionPersistence] | NotGiven = NOT_GIVEN,
|
|
443
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
444
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
445
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
446
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
447
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
448
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
449
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
450
|
+
extra_headers: Headers | None = None,
|
|
451
|
+
extra_query: Query | None = None,
|
|
452
|
+
extra_body: Body | None = None,
|
|
453
|
+
) -> LoadBalancerPool:
|
|
454
|
+
response = self.create(
|
|
455
|
+
project_id=project_id,
|
|
456
|
+
region_id=region_id,
|
|
457
|
+
lb_algorithm=lb_algorithm,
|
|
458
|
+
name=name,
|
|
459
|
+
protocol=protocol,
|
|
460
|
+
ca_secret_id=ca_secret_id,
|
|
461
|
+
crl_secret_id=crl_secret_id,
|
|
462
|
+
healthmonitor=healthmonitor,
|
|
463
|
+
listener_id=listener_id,
|
|
464
|
+
loadbalancer_id=loadbalancer_id,
|
|
465
|
+
members=members,
|
|
466
|
+
secret_id=secret_id,
|
|
467
|
+
session_persistence=session_persistence,
|
|
468
|
+
timeout_client_data=timeout_client_data,
|
|
469
|
+
timeout_member_connect=timeout_member_connect,
|
|
470
|
+
timeout_member_data=timeout_member_data,
|
|
471
|
+
extra_headers=extra_headers,
|
|
472
|
+
extra_query=extra_query,
|
|
473
|
+
extra_body=extra_body,
|
|
474
|
+
timeout=timeout,
|
|
475
|
+
)
|
|
476
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
477
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
478
|
+
task = self._client.cloud.tasks.poll(
|
|
479
|
+
task_id=response.tasks[0],
|
|
480
|
+
extra_headers=extra_headers,
|
|
481
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
482
|
+
)
|
|
483
|
+
if not task.created_resources or not task.created_resources.pools or len(task.created_resources.pools) != 1:
|
|
484
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
485
|
+
return self.get(
|
|
486
|
+
pool_id=task.created_resources.pools[0],
|
|
487
|
+
project_id=project_id,
|
|
488
|
+
region_id=region_id,
|
|
489
|
+
extra_headers=extra_headers,
|
|
490
|
+
timeout=timeout,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
def delete_and_poll(
|
|
494
|
+
self,
|
|
495
|
+
pool_id: str,
|
|
496
|
+
*,
|
|
497
|
+
project_id: int | None = None,
|
|
498
|
+
region_id: int | None = None,
|
|
499
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
500
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
501
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
502
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
503
|
+
extra_headers: Headers | None = None,
|
|
504
|
+
extra_query: Query | None = None,
|
|
505
|
+
extra_body: Body | None = None,
|
|
506
|
+
) -> None:
|
|
507
|
+
"""
|
|
508
|
+
Delete pool and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
509
|
+
"""
|
|
510
|
+
response = self.delete(
|
|
511
|
+
pool_id=pool_id,
|
|
512
|
+
project_id=project_id,
|
|
513
|
+
region_id=region_id,
|
|
514
|
+
extra_headers=extra_headers,
|
|
515
|
+
extra_query=extra_query,
|
|
516
|
+
extra_body=extra_body,
|
|
517
|
+
timeout=timeout,
|
|
518
|
+
)
|
|
519
|
+
if not response.tasks:
|
|
520
|
+
raise ValueError("Expected at least one task to be created")
|
|
521
|
+
self._client.cloud.tasks.poll(
|
|
522
|
+
task_id=response.tasks[0],
|
|
523
|
+
extra_headers=extra_headers,
|
|
524
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
525
|
+
)
|
|
526
|
+
|
|
527
|
+
def update_and_poll(
|
|
528
|
+
self,
|
|
529
|
+
pool_id: str,
|
|
530
|
+
*,
|
|
531
|
+
project_id: int | None = None,
|
|
532
|
+
region_id: int | None = None,
|
|
533
|
+
ca_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
534
|
+
crl_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
535
|
+
healthmonitor: Optional[pool_update_params.Healthmonitor] | NotGiven = NOT_GIVEN,
|
|
536
|
+
lb_algorithm: LbAlgorithm | NotGiven = NOT_GIVEN,
|
|
537
|
+
members: Optional[Iterable[pool_update_params.Member]] | NotGiven = NOT_GIVEN,
|
|
538
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
539
|
+
protocol: LbPoolProtocol | NotGiven = NOT_GIVEN,
|
|
540
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
541
|
+
session_persistence: Optional[pool_update_params.SessionPersistence] | NotGiven = NOT_GIVEN,
|
|
542
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
543
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
544
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
545
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
546
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
547
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
548
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
549
|
+
extra_headers: Headers | None = None,
|
|
550
|
+
extra_query: Query | None = None,
|
|
551
|
+
extra_body: Body | None = None,
|
|
552
|
+
) -> LoadBalancerPool:
|
|
553
|
+
"""
|
|
554
|
+
Update pool and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
555
|
+
"""
|
|
556
|
+
response = self.update(
|
|
557
|
+
pool_id=pool_id,
|
|
558
|
+
project_id=project_id,
|
|
559
|
+
region_id=region_id,
|
|
560
|
+
ca_secret_id=ca_secret_id,
|
|
561
|
+
crl_secret_id=crl_secret_id,
|
|
562
|
+
healthmonitor=healthmonitor,
|
|
563
|
+
lb_algorithm=lb_algorithm,
|
|
564
|
+
members=members,
|
|
565
|
+
name=name,
|
|
566
|
+
protocol=protocol,
|
|
567
|
+
secret_id=secret_id,
|
|
568
|
+
session_persistence=session_persistence,
|
|
569
|
+
timeout_client_data=timeout_client_data,
|
|
570
|
+
timeout_member_connect=timeout_member_connect,
|
|
571
|
+
timeout_member_data=timeout_member_data,
|
|
572
|
+
extra_headers=extra_headers,
|
|
573
|
+
extra_query=extra_query,
|
|
574
|
+
extra_body=extra_body,
|
|
575
|
+
timeout=timeout,
|
|
576
|
+
)
|
|
577
|
+
if not response.tasks:
|
|
578
|
+
raise ValueError("Expected at least one task to be created")
|
|
579
|
+
self._client.cloud.tasks.poll(
|
|
580
|
+
task_id=response.tasks[0],
|
|
581
|
+
extra_headers=extra_headers,
|
|
582
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
583
|
+
)
|
|
584
|
+
return self.get(
|
|
585
|
+
pool_id=pool_id,
|
|
586
|
+
project_id=project_id,
|
|
587
|
+
region_id=region_id,
|
|
588
|
+
extra_headers=extra_headers,
|
|
589
|
+
timeout=timeout,
|
|
590
|
+
)
|
|
591
|
+
|
|
402
592
|
|
|
403
593
|
class AsyncPoolsResource(AsyncAPIResource):
|
|
404
594
|
@cached_property
|
|
@@ -458,6 +648,10 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
458
648
|
Create load balancer pool
|
|
459
649
|
|
|
460
650
|
Args:
|
|
651
|
+
project_id: Project ID
|
|
652
|
+
|
|
653
|
+
region_id: Region ID
|
|
654
|
+
|
|
461
655
|
lb_algorithm: Load balancer algorithm
|
|
462
656
|
|
|
463
657
|
name: Pool name
|
|
@@ -556,6 +750,12 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
556
750
|
they will be overwritten.
|
|
557
751
|
|
|
558
752
|
Args:
|
|
753
|
+
project_id: Project ID
|
|
754
|
+
|
|
755
|
+
region_id: Region ID
|
|
756
|
+
|
|
757
|
+
pool_id: Pool ID
|
|
758
|
+
|
|
559
759
|
ca_secret_id: Secret ID of CA certificate bundle
|
|
560
760
|
|
|
561
761
|
crl_secret_id: Secret ID of CA revocation list file
|
|
@@ -639,12 +839,15 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
639
839
|
List load balancer pools
|
|
640
840
|
|
|
641
841
|
Args:
|
|
642
|
-
|
|
643
|
-
|
|
842
|
+
project_id: Project ID
|
|
843
|
+
|
|
844
|
+
region_id: Region ID
|
|
644
845
|
|
|
645
|
-
|
|
846
|
+
details: Show members and Health Monitor details
|
|
646
847
|
|
|
647
|
-
|
|
848
|
+
listener_id: Listener ID
|
|
849
|
+
|
|
850
|
+
loadbalancer_id: Load Balancer ID
|
|
648
851
|
|
|
649
852
|
extra_headers: Send extra headers
|
|
650
853
|
|
|
@@ -694,6 +897,12 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
694
897
|
Delete load balancer pool
|
|
695
898
|
|
|
696
899
|
Args:
|
|
900
|
+
project_id: Project ID
|
|
901
|
+
|
|
902
|
+
region_id: Region ID
|
|
903
|
+
|
|
904
|
+
pool_id: Pool ID
|
|
905
|
+
|
|
697
906
|
extra_headers: Send extra headers
|
|
698
907
|
|
|
699
908
|
extra_query: Add additional query parameters to the request
|
|
@@ -733,6 +942,12 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
733
942
|
Get load balancer pool
|
|
734
943
|
|
|
735
944
|
Args:
|
|
945
|
+
project_id: Project ID
|
|
946
|
+
|
|
947
|
+
region_id: Region ID
|
|
948
|
+
|
|
949
|
+
pool_id: Pool ID
|
|
950
|
+
|
|
736
951
|
extra_headers: Send extra headers
|
|
737
952
|
|
|
738
953
|
extra_query: Add additional query parameters to the request
|
|
@@ -755,6 +970,171 @@ class AsyncPoolsResource(AsyncAPIResource):
|
|
|
755
970
|
cast_to=LoadBalancerPool,
|
|
756
971
|
)
|
|
757
972
|
|
|
973
|
+
async def create_and_poll(
|
|
974
|
+
self,
|
|
975
|
+
*,
|
|
976
|
+
project_id: int | None = None,
|
|
977
|
+
region_id: int | None = None,
|
|
978
|
+
lb_algorithm: LbAlgorithm,
|
|
979
|
+
name: str,
|
|
980
|
+
protocol: LbPoolProtocol,
|
|
981
|
+
ca_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
982
|
+
crl_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
983
|
+
healthmonitor: Optional[pool_create_params.Healthmonitor] | NotGiven = NOT_GIVEN,
|
|
984
|
+
listener_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
985
|
+
loadbalancer_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
986
|
+
members: Optional[Iterable[pool_create_params.Member]] | NotGiven = NOT_GIVEN,
|
|
987
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
988
|
+
session_persistence: Optional[pool_create_params.SessionPersistence] | NotGiven = NOT_GIVEN,
|
|
989
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
990
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
991
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
992
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
993
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
994
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
995
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
996
|
+
extra_headers: Headers | None = None,
|
|
997
|
+
extra_query: Query | None = None,
|
|
998
|
+
extra_body: Body | None = None,
|
|
999
|
+
) -> LoadBalancerPool:
|
|
1000
|
+
response = await self.create(
|
|
1001
|
+
project_id=project_id,
|
|
1002
|
+
region_id=region_id,
|
|
1003
|
+
lb_algorithm=lb_algorithm,
|
|
1004
|
+
name=name,
|
|
1005
|
+
protocol=protocol,
|
|
1006
|
+
ca_secret_id=ca_secret_id,
|
|
1007
|
+
crl_secret_id=crl_secret_id,
|
|
1008
|
+
healthmonitor=healthmonitor,
|
|
1009
|
+
listener_id=listener_id,
|
|
1010
|
+
loadbalancer_id=loadbalancer_id,
|
|
1011
|
+
members=members,
|
|
1012
|
+
secret_id=secret_id,
|
|
1013
|
+
session_persistence=session_persistence,
|
|
1014
|
+
timeout_client_data=timeout_client_data,
|
|
1015
|
+
timeout_member_connect=timeout_member_connect,
|
|
1016
|
+
timeout_member_data=timeout_member_data,
|
|
1017
|
+
extra_headers=extra_headers,
|
|
1018
|
+
extra_query=extra_query,
|
|
1019
|
+
extra_body=extra_body,
|
|
1020
|
+
timeout=timeout,
|
|
1021
|
+
)
|
|
1022
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
1023
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
1024
|
+
task = await self._client.cloud.tasks.poll(
|
|
1025
|
+
task_id=response.tasks[0],
|
|
1026
|
+
extra_headers=extra_headers,
|
|
1027
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1028
|
+
)
|
|
1029
|
+
if not task.created_resources or not task.created_resources.pools or len(task.created_resources.pools) != 1:
|
|
1030
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
1031
|
+
return await self.get(
|
|
1032
|
+
pool_id=task.created_resources.pools[0],
|
|
1033
|
+
project_id=project_id,
|
|
1034
|
+
region_id=region_id,
|
|
1035
|
+
extra_headers=extra_headers,
|
|
1036
|
+
timeout=timeout,
|
|
1037
|
+
)
|
|
1038
|
+
|
|
1039
|
+
async def delete_and_poll(
|
|
1040
|
+
self,
|
|
1041
|
+
pool_id: str,
|
|
1042
|
+
*,
|
|
1043
|
+
project_id: int | None = None,
|
|
1044
|
+
region_id: int | None = None,
|
|
1045
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1046
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1047
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1048
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1049
|
+
extra_headers: Headers | None = None,
|
|
1050
|
+
extra_query: Query | None = None,
|
|
1051
|
+
extra_body: Body | None = None,
|
|
1052
|
+
) -> None:
|
|
1053
|
+
"""
|
|
1054
|
+
Delete pool and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1055
|
+
"""
|
|
1056
|
+
response = await self.delete(
|
|
1057
|
+
pool_id=pool_id,
|
|
1058
|
+
project_id=project_id,
|
|
1059
|
+
region_id=region_id,
|
|
1060
|
+
extra_headers=extra_headers,
|
|
1061
|
+
extra_query=extra_query,
|
|
1062
|
+
extra_body=extra_body,
|
|
1063
|
+
timeout=timeout,
|
|
1064
|
+
)
|
|
1065
|
+
if not response.tasks:
|
|
1066
|
+
raise ValueError("Expected at least one task to be created")
|
|
1067
|
+
await self._client.cloud.tasks.poll(
|
|
1068
|
+
task_id=response.tasks[0],
|
|
1069
|
+
extra_headers=extra_headers,
|
|
1070
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1071
|
+
)
|
|
1072
|
+
|
|
1073
|
+
async def update_and_poll(
|
|
1074
|
+
self,
|
|
1075
|
+
pool_id: str,
|
|
1076
|
+
*,
|
|
1077
|
+
project_id: int | None = None,
|
|
1078
|
+
region_id: int | None = None,
|
|
1079
|
+
ca_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1080
|
+
crl_secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1081
|
+
healthmonitor: Optional[pool_update_params.Healthmonitor] | NotGiven = NOT_GIVEN,
|
|
1082
|
+
lb_algorithm: LbAlgorithm | NotGiven = NOT_GIVEN,
|
|
1083
|
+
members: Optional[Iterable[pool_update_params.Member]] | NotGiven = NOT_GIVEN,
|
|
1084
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
1085
|
+
protocol: LbPoolProtocol | NotGiven = NOT_GIVEN,
|
|
1086
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1087
|
+
session_persistence: Optional[pool_update_params.SessionPersistence] | NotGiven = NOT_GIVEN,
|
|
1088
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1089
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1090
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1091
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1092
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1093
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1094
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1095
|
+
extra_headers: Headers | None = None,
|
|
1096
|
+
extra_query: Query | None = None,
|
|
1097
|
+
extra_body: Body | None = None,
|
|
1098
|
+
) -> LoadBalancerPool:
|
|
1099
|
+
"""
|
|
1100
|
+
Update pool and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1101
|
+
"""
|
|
1102
|
+
response = await self.update(
|
|
1103
|
+
pool_id=pool_id,
|
|
1104
|
+
project_id=project_id,
|
|
1105
|
+
region_id=region_id,
|
|
1106
|
+
ca_secret_id=ca_secret_id,
|
|
1107
|
+
crl_secret_id=crl_secret_id,
|
|
1108
|
+
healthmonitor=healthmonitor,
|
|
1109
|
+
lb_algorithm=lb_algorithm,
|
|
1110
|
+
members=members,
|
|
1111
|
+
name=name,
|
|
1112
|
+
protocol=protocol,
|
|
1113
|
+
secret_id=secret_id,
|
|
1114
|
+
session_persistence=session_persistence,
|
|
1115
|
+
timeout_client_data=timeout_client_data,
|
|
1116
|
+
timeout_member_connect=timeout_member_connect,
|
|
1117
|
+
timeout_member_data=timeout_member_data,
|
|
1118
|
+
timeout=timeout,
|
|
1119
|
+
extra_headers=extra_headers,
|
|
1120
|
+
extra_query=extra_query,
|
|
1121
|
+
extra_body=extra_body,
|
|
1122
|
+
)
|
|
1123
|
+
if not response.tasks:
|
|
1124
|
+
raise ValueError("Expected at least one task to be created")
|
|
1125
|
+
await self._client.cloud.tasks.poll(
|
|
1126
|
+
task_id=response.tasks[0],
|
|
1127
|
+
extra_headers=extra_headers,
|
|
1128
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1129
|
+
)
|
|
1130
|
+
return await self.get(
|
|
1131
|
+
pool_id=pool_id,
|
|
1132
|
+
project_id=project_id,
|
|
1133
|
+
region_id=region_id,
|
|
1134
|
+
extra_headers=extra_headers,
|
|
1135
|
+
timeout=timeout,
|
|
1136
|
+
)
|
|
1137
|
+
|
|
758
1138
|
|
|
759
1139
|
class PoolsResourceWithRawResponse:
|
|
760
1140
|
def __init__(self, pools: PoolsResource) -> None:
|
|
@@ -91,6 +91,10 @@ class NetworksResource(SyncAPIResource):
|
|
|
91
91
|
Create network
|
|
92
92
|
|
|
93
93
|
Args:
|
|
94
|
+
project_id: Project ID
|
|
95
|
+
|
|
96
|
+
region_id: Region ID
|
|
97
|
+
|
|
94
98
|
name: Network name
|
|
95
99
|
|
|
96
100
|
create_router: Defaults to True
|
|
@@ -150,6 +154,12 @@ class NetworksResource(SyncAPIResource):
|
|
|
150
154
|
Change network name
|
|
151
155
|
|
|
152
156
|
Args:
|
|
157
|
+
project_id: Project ID
|
|
158
|
+
|
|
159
|
+
region_id: Region ID
|
|
160
|
+
|
|
161
|
+
network_id: Network ID
|
|
162
|
+
|
|
153
163
|
name: Name.
|
|
154
164
|
|
|
155
165
|
extra_headers: Send extra headers
|
|
@@ -182,7 +192,7 @@ class NetworksResource(SyncAPIResource):
|
|
|
182
192
|
region_id: int | None = None,
|
|
183
193
|
limit: int | NotGiven = NOT_GIVEN,
|
|
184
194
|
offset: int | NotGiven = NOT_GIVEN,
|
|
185
|
-
order_by:
|
|
195
|
+
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
186
196
|
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
187
197
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
188
198
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -196,17 +206,23 @@ class NetworksResource(SyncAPIResource):
|
|
|
196
206
|
List networks
|
|
197
207
|
|
|
198
208
|
Args:
|
|
199
|
-
|
|
209
|
+
project_id: Project ID
|
|
210
|
+
|
|
211
|
+
region_id: Region ID
|
|
212
|
+
|
|
213
|
+
limit: Optional. Limit the number of returned items
|
|
200
214
|
|
|
201
|
-
offset: Offset value is used to exclude the first set of records from the
|
|
215
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
216
|
+
result
|
|
202
217
|
|
|
203
|
-
order_by:
|
|
218
|
+
order_by: Ordering networks list result by `name`, `created_at` fields of the network and
|
|
219
|
+
directions (`created_at.desc`).
|
|
204
220
|
|
|
205
|
-
tag_key: Filter by tag keys.
|
|
221
|
+
tag_key: Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
|
|
206
222
|
|
|
207
|
-
tag_key_value: Filter by tag key-value pairs.
|
|
208
|
-
|
|
209
|
-
"
|
|
223
|
+
tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
|
|
224
|
+
"tag_key_value={"key": "value"}" --url
|
|
225
|
+
"https://example.com/cloud/v1/resource/1/1"
|
|
210
226
|
|
|
211
227
|
extra_headers: Send extra headers
|
|
212
228
|
|
|
@@ -259,6 +275,12 @@ class NetworksResource(SyncAPIResource):
|
|
|
259
275
|
Delete network
|
|
260
276
|
|
|
261
277
|
Args:
|
|
278
|
+
project_id: Project ID
|
|
279
|
+
|
|
280
|
+
region_id: Region ID
|
|
281
|
+
|
|
282
|
+
network_id: Network ID
|
|
283
|
+
|
|
262
284
|
extra_headers: Send extra headers
|
|
263
285
|
|
|
264
286
|
extra_query: Add additional query parameters to the request
|
|
@@ -298,6 +320,12 @@ class NetworksResource(SyncAPIResource):
|
|
|
298
320
|
Get network
|
|
299
321
|
|
|
300
322
|
Args:
|
|
323
|
+
project_id: Project ID
|
|
324
|
+
|
|
325
|
+
region_id: Region ID
|
|
326
|
+
|
|
327
|
+
network_id: Network ID
|
|
328
|
+
|
|
301
329
|
extra_headers: Send extra headers
|
|
302
330
|
|
|
303
331
|
extra_query: Add additional query parameters to the request
|
|
@@ -369,6 +397,10 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
369
397
|
Create network
|
|
370
398
|
|
|
371
399
|
Args:
|
|
400
|
+
project_id: Project ID
|
|
401
|
+
|
|
402
|
+
region_id: Region ID
|
|
403
|
+
|
|
372
404
|
name: Network name
|
|
373
405
|
|
|
374
406
|
create_router: Defaults to True
|
|
@@ -428,6 +460,12 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
428
460
|
Change network name
|
|
429
461
|
|
|
430
462
|
Args:
|
|
463
|
+
project_id: Project ID
|
|
464
|
+
|
|
465
|
+
region_id: Region ID
|
|
466
|
+
|
|
467
|
+
network_id: Network ID
|
|
468
|
+
|
|
431
469
|
name: Name.
|
|
432
470
|
|
|
433
471
|
extra_headers: Send extra headers
|
|
@@ -460,7 +498,7 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
460
498
|
region_id: int | None = None,
|
|
461
499
|
limit: int | NotGiven = NOT_GIVEN,
|
|
462
500
|
offset: int | NotGiven = NOT_GIVEN,
|
|
463
|
-
order_by:
|
|
501
|
+
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
|
|
464
502
|
tag_key: List[str] | NotGiven = NOT_GIVEN,
|
|
465
503
|
tag_key_value: str | NotGiven = NOT_GIVEN,
|
|
466
504
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -474,17 +512,23 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
474
512
|
List networks
|
|
475
513
|
|
|
476
514
|
Args:
|
|
477
|
-
|
|
515
|
+
project_id: Project ID
|
|
516
|
+
|
|
517
|
+
region_id: Region ID
|
|
518
|
+
|
|
519
|
+
limit: Optional. Limit the number of returned items
|
|
478
520
|
|
|
479
|
-
offset: Offset value is used to exclude the first set of records from the
|
|
521
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
522
|
+
result
|
|
480
523
|
|
|
481
|
-
order_by:
|
|
524
|
+
order_by: Ordering networks list result by `name`, `created_at` fields of the network and
|
|
525
|
+
directions (`created_at.desc`).
|
|
482
526
|
|
|
483
|
-
tag_key: Filter by tag keys.
|
|
527
|
+
tag_key: Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
|
|
484
528
|
|
|
485
|
-
tag_key_value: Filter by tag key-value pairs.
|
|
486
|
-
|
|
487
|
-
"
|
|
529
|
+
tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
|
|
530
|
+
"tag_key_value={"key": "value"}" --url
|
|
531
|
+
"https://example.com/cloud/v1/resource/1/1"
|
|
488
532
|
|
|
489
533
|
extra_headers: Send extra headers
|
|
490
534
|
|
|
@@ -537,6 +581,12 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
537
581
|
Delete network
|
|
538
582
|
|
|
539
583
|
Args:
|
|
584
|
+
project_id: Project ID
|
|
585
|
+
|
|
586
|
+
region_id: Region ID
|
|
587
|
+
|
|
588
|
+
network_id: Network ID
|
|
589
|
+
|
|
540
590
|
extra_headers: Send extra headers
|
|
541
591
|
|
|
542
592
|
extra_query: Add additional query parameters to the request
|
|
@@ -576,6 +626,12 @@ class AsyncNetworksResource(AsyncAPIResource):
|
|
|
576
626
|
Get network
|
|
577
627
|
|
|
578
628
|
Args:
|
|
629
|
+
project_id: Project ID
|
|
630
|
+
|
|
631
|
+
region_id: Region ID
|
|
632
|
+
|
|
633
|
+
network_id: Network ID
|
|
634
|
+
|
|
579
635
|
extra_headers: Send extra headers
|
|
580
636
|
|
|
581
637
|
extra_query: Add additional query parameters to the request
|