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
|
@@ -81,6 +81,10 @@ class ListenersResource(SyncAPIResource):
|
|
|
81
81
|
Create load balancer listener
|
|
82
82
|
|
|
83
83
|
Args:
|
|
84
|
+
project_id: Project ID
|
|
85
|
+
|
|
86
|
+
region_id: Region ID
|
|
87
|
+
|
|
84
88
|
loadbalancer_id: Load balancer ID
|
|
85
89
|
|
|
86
90
|
name: Load balancer listener name
|
|
@@ -174,6 +178,12 @@ class ListenersResource(SyncAPIResource):
|
|
|
174
178
|
Update listener
|
|
175
179
|
|
|
176
180
|
Args:
|
|
181
|
+
project_id: Project ID
|
|
182
|
+
|
|
183
|
+
region_id: Region ID
|
|
184
|
+
|
|
185
|
+
listener_id: Listener ID
|
|
186
|
+
|
|
177
187
|
allowed_cidrs: Network CIDRs from which service will be accessible
|
|
178
188
|
|
|
179
189
|
connection_limit: Limit of simultaneous connections
|
|
@@ -248,9 +258,13 @@ class ListenersResource(SyncAPIResource):
|
|
|
248
258
|
List load balancer listeners
|
|
249
259
|
|
|
250
260
|
Args:
|
|
251
|
-
|
|
261
|
+
project_id: Project ID
|
|
252
262
|
|
|
253
|
-
|
|
263
|
+
region_id: Region ID
|
|
264
|
+
|
|
265
|
+
loadbalancer_id: Load Balancer ID
|
|
266
|
+
|
|
267
|
+
show_stats: Show stats
|
|
254
268
|
|
|
255
269
|
extra_headers: Send extra headers
|
|
256
270
|
|
|
@@ -299,6 +313,12 @@ class ListenersResource(SyncAPIResource):
|
|
|
299
313
|
Delete load balancer listener
|
|
300
314
|
|
|
301
315
|
Args:
|
|
316
|
+
project_id: Project ID
|
|
317
|
+
|
|
318
|
+
region_id: Region ID
|
|
319
|
+
|
|
320
|
+
listener_id: Listener ID
|
|
321
|
+
|
|
302
322
|
extra_headers: Send extra headers
|
|
303
323
|
|
|
304
324
|
extra_query: Add additional query parameters to the request
|
|
@@ -339,7 +359,13 @@ class ListenersResource(SyncAPIResource):
|
|
|
339
359
|
Get listener
|
|
340
360
|
|
|
341
361
|
Args:
|
|
342
|
-
|
|
362
|
+
project_id: Project ID
|
|
363
|
+
|
|
364
|
+
region_id: Region ID
|
|
365
|
+
|
|
366
|
+
listener_id: Listener ID
|
|
367
|
+
|
|
368
|
+
show_stats: Show stats
|
|
343
369
|
|
|
344
370
|
extra_headers: Send extra headers
|
|
345
371
|
|
|
@@ -367,6 +393,163 @@ class ListenersResource(SyncAPIResource):
|
|
|
367
393
|
cast_to=LoadBalancerListenerDetail,
|
|
368
394
|
)
|
|
369
395
|
|
|
396
|
+
def create_and_poll(
|
|
397
|
+
self,
|
|
398
|
+
*,
|
|
399
|
+
project_id: int | None = None,
|
|
400
|
+
region_id: int | None = None,
|
|
401
|
+
loadbalancer_id: str,
|
|
402
|
+
name: str,
|
|
403
|
+
protocol: LbListenerProtocol,
|
|
404
|
+
protocol_port: int,
|
|
405
|
+
allowed_cidrs: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
406
|
+
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
407
|
+
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
408
|
+
secret_id: str | NotGiven = NOT_GIVEN,
|
|
409
|
+
sni_secret_id: List[str] | NotGiven = NOT_GIVEN,
|
|
410
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
411
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
412
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
413
|
+
user_list: Iterable[listener_create_params.UserList] | NotGiven = NOT_GIVEN,
|
|
414
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
415
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
416
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
417
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
418
|
+
extra_headers: Headers | None = None,
|
|
419
|
+
extra_query: Query | None = None,
|
|
420
|
+
extra_body: Body | None = None,
|
|
421
|
+
) -> LoadBalancerListenerDetail:
|
|
422
|
+
response = self.create(
|
|
423
|
+
project_id=project_id,
|
|
424
|
+
region_id=region_id,
|
|
425
|
+
loadbalancer_id=loadbalancer_id,
|
|
426
|
+
name=name,
|
|
427
|
+
protocol=protocol,
|
|
428
|
+
protocol_port=protocol_port,
|
|
429
|
+
allowed_cidrs=allowed_cidrs,
|
|
430
|
+
connection_limit=connection_limit,
|
|
431
|
+
insert_x_forwarded=insert_x_forwarded,
|
|
432
|
+
secret_id=secret_id,
|
|
433
|
+
sni_secret_id=sni_secret_id,
|
|
434
|
+
timeout_client_data=timeout_client_data,
|
|
435
|
+
timeout_member_connect=timeout_member_connect,
|
|
436
|
+
timeout_member_data=timeout_member_data,
|
|
437
|
+
user_list=user_list,
|
|
438
|
+
extra_headers=extra_headers,
|
|
439
|
+
extra_query=extra_query,
|
|
440
|
+
extra_body=extra_body,
|
|
441
|
+
timeout=timeout,
|
|
442
|
+
)
|
|
443
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
444
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
445
|
+
task = self._client.cloud.tasks.poll(
|
|
446
|
+
task_id=response.tasks[0],
|
|
447
|
+
extra_headers=extra_headers,
|
|
448
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
449
|
+
)
|
|
450
|
+
if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
|
|
451
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
452
|
+
return self.get(
|
|
453
|
+
listener_id=task.created_resources.listeners[0],
|
|
454
|
+
project_id=project_id,
|
|
455
|
+
region_id=region_id,
|
|
456
|
+
extra_headers=extra_headers,
|
|
457
|
+
timeout=timeout,
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
def delete_and_poll(
|
|
461
|
+
self,
|
|
462
|
+
listener_id: str,
|
|
463
|
+
*,
|
|
464
|
+
project_id: int | None = None,
|
|
465
|
+
region_id: int | None = None,
|
|
466
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
467
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
468
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
469
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
470
|
+
extra_headers: Headers | None = None,
|
|
471
|
+
extra_query: Query | None = None,
|
|
472
|
+
extra_body: Body | None = None,
|
|
473
|
+
) -> None:
|
|
474
|
+
"""
|
|
475
|
+
Delete listener and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
476
|
+
"""
|
|
477
|
+
response = self.delete(
|
|
478
|
+
listener_id=listener_id,
|
|
479
|
+
project_id=project_id,
|
|
480
|
+
region_id=region_id,
|
|
481
|
+
extra_headers=extra_headers,
|
|
482
|
+
extra_query=extra_query,
|
|
483
|
+
extra_body=extra_body,
|
|
484
|
+
timeout=timeout,
|
|
485
|
+
)
|
|
486
|
+
if not response.tasks:
|
|
487
|
+
raise ValueError("Expected at least one task to be created")
|
|
488
|
+
self._client.cloud.tasks.poll(
|
|
489
|
+
task_id=response.tasks[0],
|
|
490
|
+
extra_headers=extra_headers,
|
|
491
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
def update_and_poll(
|
|
495
|
+
self,
|
|
496
|
+
listener_id: str,
|
|
497
|
+
*,
|
|
498
|
+
project_id: int | None = None,
|
|
499
|
+
region_id: int | None = None,
|
|
500
|
+
allowed_cidrs: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
501
|
+
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
502
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
503
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
504
|
+
sni_secret_id: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
505
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
506
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
507
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
508
|
+
user_list: Optional[Iterable[listener_update_params.UserList]] | NotGiven = NOT_GIVEN,
|
|
509
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
510
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
511
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
512
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
513
|
+
extra_headers: Headers | None = None,
|
|
514
|
+
extra_query: Query | None = None,
|
|
515
|
+
extra_body: Body | None = None,
|
|
516
|
+
) -> LoadBalancerListenerDetail:
|
|
517
|
+
"""
|
|
518
|
+
Update listener and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
519
|
+
"""
|
|
520
|
+
response = self.update(
|
|
521
|
+
listener_id=listener_id,
|
|
522
|
+
project_id=project_id,
|
|
523
|
+
region_id=region_id,
|
|
524
|
+
allowed_cidrs=allowed_cidrs,
|
|
525
|
+
connection_limit=connection_limit,
|
|
526
|
+
name=name,
|
|
527
|
+
secret_id=secret_id,
|
|
528
|
+
sni_secret_id=sni_secret_id,
|
|
529
|
+
timeout_client_data=timeout_client_data,
|
|
530
|
+
timeout_member_connect=timeout_member_connect,
|
|
531
|
+
timeout_member_data=timeout_member_data,
|
|
532
|
+
user_list=user_list,
|
|
533
|
+
extra_headers=extra_headers,
|
|
534
|
+
extra_query=extra_query,
|
|
535
|
+
extra_body=extra_body,
|
|
536
|
+
timeout=timeout,
|
|
537
|
+
)
|
|
538
|
+
if not response.tasks:
|
|
539
|
+
raise ValueError("Expected at least one task to be created")
|
|
540
|
+
self._client.cloud.tasks.poll(
|
|
541
|
+
task_id=response.tasks[0],
|
|
542
|
+
extra_headers=extra_headers,
|
|
543
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
544
|
+
)
|
|
545
|
+
return self.get(
|
|
546
|
+
listener_id=listener_id,
|
|
547
|
+
project_id=project_id,
|
|
548
|
+
region_id=region_id,
|
|
549
|
+
extra_headers=extra_headers,
|
|
550
|
+
timeout=timeout,
|
|
551
|
+
)
|
|
552
|
+
|
|
370
553
|
|
|
371
554
|
class AsyncListenersResource(AsyncAPIResource):
|
|
372
555
|
@cached_property
|
|
@@ -417,6 +600,10 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
417
600
|
Create load balancer listener
|
|
418
601
|
|
|
419
602
|
Args:
|
|
603
|
+
project_id: Project ID
|
|
604
|
+
|
|
605
|
+
region_id: Region ID
|
|
606
|
+
|
|
420
607
|
loadbalancer_id: Load balancer ID
|
|
421
608
|
|
|
422
609
|
name: Load balancer listener name
|
|
@@ -510,6 +697,12 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
510
697
|
Update listener
|
|
511
698
|
|
|
512
699
|
Args:
|
|
700
|
+
project_id: Project ID
|
|
701
|
+
|
|
702
|
+
region_id: Region ID
|
|
703
|
+
|
|
704
|
+
listener_id: Listener ID
|
|
705
|
+
|
|
513
706
|
allowed_cidrs: Network CIDRs from which service will be accessible
|
|
514
707
|
|
|
515
708
|
connection_limit: Limit of simultaneous connections
|
|
@@ -584,9 +777,13 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
584
777
|
List load balancer listeners
|
|
585
778
|
|
|
586
779
|
Args:
|
|
587
|
-
|
|
780
|
+
project_id: Project ID
|
|
781
|
+
|
|
782
|
+
region_id: Region ID
|
|
588
783
|
|
|
589
|
-
|
|
784
|
+
loadbalancer_id: Load Balancer ID
|
|
785
|
+
|
|
786
|
+
show_stats: Show stats
|
|
590
787
|
|
|
591
788
|
extra_headers: Send extra headers
|
|
592
789
|
|
|
@@ -635,6 +832,12 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
635
832
|
Delete load balancer listener
|
|
636
833
|
|
|
637
834
|
Args:
|
|
835
|
+
project_id: Project ID
|
|
836
|
+
|
|
837
|
+
region_id: Region ID
|
|
838
|
+
|
|
839
|
+
listener_id: Listener ID
|
|
840
|
+
|
|
638
841
|
extra_headers: Send extra headers
|
|
639
842
|
|
|
640
843
|
extra_query: Add additional query parameters to the request
|
|
@@ -675,7 +878,13 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
675
878
|
Get listener
|
|
676
879
|
|
|
677
880
|
Args:
|
|
678
|
-
|
|
881
|
+
project_id: Project ID
|
|
882
|
+
|
|
883
|
+
region_id: Region ID
|
|
884
|
+
|
|
885
|
+
listener_id: Listener ID
|
|
886
|
+
|
|
887
|
+
show_stats: Show stats
|
|
679
888
|
|
|
680
889
|
extra_headers: Send extra headers
|
|
681
890
|
|
|
@@ -703,6 +912,162 @@ class AsyncListenersResource(AsyncAPIResource):
|
|
|
703
912
|
cast_to=LoadBalancerListenerDetail,
|
|
704
913
|
)
|
|
705
914
|
|
|
915
|
+
async def create_and_poll(
|
|
916
|
+
self,
|
|
917
|
+
*,
|
|
918
|
+
project_id: int | None = None,
|
|
919
|
+
region_id: int | None = None,
|
|
920
|
+
loadbalancer_id: str,
|
|
921
|
+
name: str,
|
|
922
|
+
protocol: LbListenerProtocol,
|
|
923
|
+
protocol_port: int,
|
|
924
|
+
allowed_cidrs: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
925
|
+
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
926
|
+
insert_x_forwarded: bool | NotGiven = NOT_GIVEN,
|
|
927
|
+
secret_id: str | NotGiven = NOT_GIVEN,
|
|
928
|
+
sni_secret_id: List[str] | NotGiven = NOT_GIVEN,
|
|
929
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
930
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
931
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
932
|
+
user_list: Iterable[listener_create_params.UserList] | NotGiven = NOT_GIVEN,
|
|
933
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
934
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
935
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
936
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
937
|
+
extra_headers: Headers | None = None,
|
|
938
|
+
extra_query: Query | None = None,
|
|
939
|
+
extra_body: Body | None = None,
|
|
940
|
+
) -> LoadBalancerListenerDetail:
|
|
941
|
+
response = await self.create(
|
|
942
|
+
project_id=project_id,
|
|
943
|
+
region_id=region_id,
|
|
944
|
+
loadbalancer_id=loadbalancer_id,
|
|
945
|
+
name=name,
|
|
946
|
+
protocol=protocol,
|
|
947
|
+
protocol_port=protocol_port,
|
|
948
|
+
allowed_cidrs=allowed_cidrs,
|
|
949
|
+
connection_limit=connection_limit,
|
|
950
|
+
insert_x_forwarded=insert_x_forwarded,
|
|
951
|
+
secret_id=secret_id,
|
|
952
|
+
sni_secret_id=sni_secret_id,
|
|
953
|
+
timeout_client_data=timeout_client_data,
|
|
954
|
+
timeout_member_connect=timeout_member_connect,
|
|
955
|
+
timeout_member_data=timeout_member_data,
|
|
956
|
+
user_list=user_list,
|
|
957
|
+
extra_headers=extra_headers,
|
|
958
|
+
extra_query=extra_query,
|
|
959
|
+
extra_body=extra_body,
|
|
960
|
+
timeout=timeout,
|
|
961
|
+
)
|
|
962
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
963
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
964
|
+
task = await self._client.cloud.tasks.poll(
|
|
965
|
+
task_id=response.tasks[0],
|
|
966
|
+
extra_headers=extra_headers,
|
|
967
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
968
|
+
)
|
|
969
|
+
if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
|
|
970
|
+
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
971
|
+
return await self.get(
|
|
972
|
+
listener_id=task.created_resources.listeners[0],
|
|
973
|
+
project_id=project_id,
|
|
974
|
+
region_id=region_id,
|
|
975
|
+
extra_headers=extra_headers,
|
|
976
|
+
timeout=timeout,
|
|
977
|
+
)
|
|
978
|
+
|
|
979
|
+
async def delete_and_poll(
|
|
980
|
+
self,
|
|
981
|
+
listener_id: str,
|
|
982
|
+
*,
|
|
983
|
+
project_id: int | None = None,
|
|
984
|
+
region_id: int | None = None,
|
|
985
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
986
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
987
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
988
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
989
|
+
extra_headers: Headers | None = None,
|
|
990
|
+
extra_query: Query | None = None,
|
|
991
|
+
extra_body: Body | None = None,
|
|
992
|
+
) -> None:
|
|
993
|
+
"""
|
|
994
|
+
Delete listener and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
995
|
+
"""
|
|
996
|
+
response = await self.delete(
|
|
997
|
+
listener_id=listener_id,
|
|
998
|
+
project_id=project_id,
|
|
999
|
+
region_id=region_id,
|
|
1000
|
+
extra_headers=extra_headers,
|
|
1001
|
+
extra_query=extra_query,
|
|
1002
|
+
extra_body=extra_body,
|
|
1003
|
+
timeout=timeout,
|
|
1004
|
+
)
|
|
1005
|
+
if not response.tasks:
|
|
1006
|
+
raise ValueError("Expected at least one task to be created")
|
|
1007
|
+
await self._client.cloud.tasks.poll(
|
|
1008
|
+
task_id=response.tasks[0],
|
|
1009
|
+
extra_headers=extra_headers,
|
|
1010
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1011
|
+
)
|
|
1012
|
+
|
|
1013
|
+
async def update_and_poll(
|
|
1014
|
+
self,
|
|
1015
|
+
listener_id: str,
|
|
1016
|
+
*,
|
|
1017
|
+
project_id: int | None = None,
|
|
1018
|
+
region_id: int | None = None,
|
|
1019
|
+
allowed_cidrs: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
1020
|
+
connection_limit: int | NotGiven = NOT_GIVEN,
|
|
1021
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
1022
|
+
secret_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
1023
|
+
sni_secret_id: Optional[List[str]] | NotGiven = NOT_GIVEN,
|
|
1024
|
+
timeout_client_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1025
|
+
timeout_member_connect: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1026
|
+
timeout_member_data: Optional[int] | NotGiven = NOT_GIVEN,
|
|
1027
|
+
user_list: Optional[Iterable[listener_update_params.UserList]] | NotGiven = NOT_GIVEN,
|
|
1028
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
1029
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
1030
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1031
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1032
|
+
extra_headers: Headers | None = None,
|
|
1033
|
+
extra_query: Query | None = None,
|
|
1034
|
+
extra_body: Body | None = None,
|
|
1035
|
+
) -> LoadBalancerListenerDetail:
|
|
1036
|
+
"""
|
|
1037
|
+
Update listener and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
1038
|
+
"""
|
|
1039
|
+
response = await self.update(
|
|
1040
|
+
listener_id=listener_id,
|
|
1041
|
+
project_id=project_id,
|
|
1042
|
+
region_id=region_id,
|
|
1043
|
+
allowed_cidrs=allowed_cidrs,
|
|
1044
|
+
connection_limit=connection_limit,
|
|
1045
|
+
name=name,
|
|
1046
|
+
secret_id=secret_id,
|
|
1047
|
+
sni_secret_id=sni_secret_id,
|
|
1048
|
+
timeout_client_data=timeout_client_data,
|
|
1049
|
+
timeout_member_connect=timeout_member_connect,
|
|
1050
|
+
timeout_member_data=timeout_member_data,
|
|
1051
|
+
user_list=user_list,
|
|
1052
|
+
extra_headers=extra_headers,
|
|
1053
|
+
extra_query=extra_query,
|
|
1054
|
+
extra_body=extra_body,
|
|
1055
|
+
timeout=timeout,
|
|
1056
|
+
)
|
|
1057
|
+
if not response.tasks:
|
|
1058
|
+
raise ValueError("Expected at least one task to be created")
|
|
1059
|
+
await self._client.cloud.tasks.poll(
|
|
1060
|
+
task_id=response.tasks[0],
|
|
1061
|
+
extra_headers=extra_headers,
|
|
1062
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
1063
|
+
)
|
|
1064
|
+
return await self.get(
|
|
1065
|
+
listener_id=listener_id,
|
|
1066
|
+
project_id=project_id,
|
|
1067
|
+
region_id=region_id,
|
|
1068
|
+
extra_headers=extra_headers,
|
|
1069
|
+
timeout=timeout,
|
|
1070
|
+
)
|
|
706
1071
|
|
|
707
1072
|
class ListenersResourceWithRawResponse:
|
|
708
1073
|
def __init__(self, listeners: ListenersResource) -> None:
|