gcore 0.16.0__py3-none-any.whl → 0.17.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/_client.py +16 -0
- gcore/_version.py +1 -1
- gcore/resources/cdn/cdn.py +120 -21
- gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
- gcore/resources/cloud/baremetal/servers.py +8 -0
- gcore/resources/cloud/cloud.py +18 -0
- gcore/resources/cloud/file_shares/file_shares.py +124 -33
- gcore/resources/cloud/floating_ips.py +8 -0
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +12 -0
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +8 -0
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +4 -0
- gcore/resources/cloud/inference/deployments/deployments.py +12 -0
- gcore/resources/cloud/instances/images.py +12 -0
- gcore/resources/cloud/instances/instances.py +20 -0
- gcore/resources/cloud/instances/interfaces.py +12 -0
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +12 -0
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +12 -0
- gcore/resources/cloud/load_balancers/listeners.py +12 -0
- gcore/resources/cloud/load_balancers/load_balancers.py +16 -0
- gcore/resources/cloud/load_balancers/pools/pools.py +12 -0
- gcore/resources/cloud/networks/networks.py +8 -0
- gcore/resources/cloud/networks/subnets.py +4 -0
- gcore/resources/cloud/placement_groups.py +8 -0
- gcore/resources/cloud/projects.py +109 -109
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
- gcore/resources/cloud/secrets.py +4 -0
- gcore/resources/cloud/tasks.py +22 -7
- gcore/resources/cloud/volumes.py +27 -1
- gcore/types/cdn/__init__.py +3 -0
- gcore/types/cdn/alibaba_regions.py +22 -0
- gcore/types/cdn/aws_regions.py +22 -0
- gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
- gcore/types/cdn/cdn_resource.py +1 -1
- gcore/types/cdn/resource_create_params.py +1 -1
- gcore/types/cdn/resource_replace_params.py +1 -1
- gcore/types/cdn/resource_update_params.py +1 -1
- gcore/types/cdn/resources/cdn_resource_rule.py +1 -1
- gcore/types/cdn/resources/rule_create_params.py +1 -1
- gcore/types/cdn/resources/rule_replace_params.py +1 -1
- gcore/types/cdn/resources/rule_update_params.py +1 -1
- gcore/types/cdn/rule_template.py +1 -1
- gcore/types/cdn/rule_template_create_params.py +1 -1
- gcore/types/cdn/rule_template_replace_params.py +1 -1
- gcore/types/cdn/rule_template_update_params.py +1 -1
- gcore/types/cloud/__init__.py +1 -1
- gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
- {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/METADATA +2 -2
- {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/RECORD +50 -49
- gcore/resources/cdn/logs/__init__.py +0 -19
- gcore/types/cdn/logs/__init__.py +0 -3
- {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/WHEEL +0 -0
- {gcore-0.16.0.dist-info → gcore-0.17.0.dist-info}/licenses/LICENSE +0 -0
gcore/_client.py
CHANGED
|
@@ -59,6 +59,7 @@ class Gcore(SyncAPIClient):
|
|
|
59
59
|
cloud_project_id: int | None
|
|
60
60
|
cloud_region_id: int | None
|
|
61
61
|
cloud_polling_interval_seconds: int | None
|
|
62
|
+
cloud_polling_timeout_seconds: int | None
|
|
62
63
|
|
|
63
64
|
def __init__(
|
|
64
65
|
self,
|
|
@@ -67,6 +68,7 @@ class Gcore(SyncAPIClient):
|
|
|
67
68
|
cloud_project_id: int | None = None,
|
|
68
69
|
cloud_region_id: int | None = None,
|
|
69
70
|
cloud_polling_interval_seconds: int | None = 3,
|
|
71
|
+
cloud_polling_timeout_seconds: int | None = 7200,
|
|
70
72
|
base_url: str | httpx.URL | None = None,
|
|
71
73
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
72
74
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -113,6 +115,10 @@ class Gcore(SyncAPIClient):
|
|
|
113
115
|
cloud_polling_interval_seconds = 3
|
|
114
116
|
self.cloud_polling_interval_seconds = cloud_polling_interval_seconds
|
|
115
117
|
|
|
118
|
+
if cloud_polling_timeout_seconds is None:
|
|
119
|
+
cloud_polling_timeout_seconds = 7200
|
|
120
|
+
self.cloud_polling_timeout_seconds = cloud_polling_timeout_seconds
|
|
121
|
+
|
|
116
122
|
if base_url is None:
|
|
117
123
|
base_url = os.environ.get("GCORE_BASE_URL")
|
|
118
124
|
if base_url is None:
|
|
@@ -168,6 +174,7 @@ class Gcore(SyncAPIClient):
|
|
|
168
174
|
cloud_project_id: int | None = None,
|
|
169
175
|
cloud_region_id: int | None = None,
|
|
170
176
|
cloud_polling_interval_seconds: int | None = None,
|
|
177
|
+
cloud_polling_timeout_seconds: int | None = None,
|
|
171
178
|
base_url: str | httpx.URL | None = None,
|
|
172
179
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
173
180
|
http_client: httpx.Client | None = None,
|
|
@@ -205,6 +212,7 @@ class Gcore(SyncAPIClient):
|
|
|
205
212
|
cloud_project_id=cloud_project_id or self.cloud_project_id,
|
|
206
213
|
cloud_region_id=cloud_region_id or self.cloud_region_id,
|
|
207
214
|
cloud_polling_interval_seconds=cloud_polling_interval_seconds or self.cloud_polling_interval_seconds,
|
|
215
|
+
cloud_polling_timeout_seconds=cloud_polling_timeout_seconds or self.cloud_polling_timeout_seconds,
|
|
208
216
|
base_url=base_url or self.base_url,
|
|
209
217
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
210
218
|
http_client=http_client,
|
|
@@ -288,6 +296,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
288
296
|
cloud_project_id: int | None
|
|
289
297
|
cloud_region_id: int | None
|
|
290
298
|
cloud_polling_interval_seconds: int | None
|
|
299
|
+
cloud_polling_timeout_seconds: int | None
|
|
291
300
|
|
|
292
301
|
def __init__(
|
|
293
302
|
self,
|
|
@@ -296,6 +305,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
296
305
|
cloud_project_id: int | None = None,
|
|
297
306
|
cloud_region_id: int | None = None,
|
|
298
307
|
cloud_polling_interval_seconds: int | None = 3,
|
|
308
|
+
cloud_polling_timeout_seconds: int | None = 7200,
|
|
299
309
|
base_url: str | httpx.URL | None = None,
|
|
300
310
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
301
311
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
@@ -342,6 +352,10 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
342
352
|
cloud_polling_interval_seconds = 3
|
|
343
353
|
self.cloud_polling_interval_seconds = cloud_polling_interval_seconds
|
|
344
354
|
|
|
355
|
+
if cloud_polling_timeout_seconds is None:
|
|
356
|
+
cloud_polling_timeout_seconds = 7200
|
|
357
|
+
self.cloud_polling_timeout_seconds = cloud_polling_timeout_seconds
|
|
358
|
+
|
|
345
359
|
if base_url is None:
|
|
346
360
|
base_url = os.environ.get("GCORE_BASE_URL")
|
|
347
361
|
if base_url is None:
|
|
@@ -397,6 +411,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
397
411
|
cloud_project_id: int | None = None,
|
|
398
412
|
cloud_region_id: int | None = None,
|
|
399
413
|
cloud_polling_interval_seconds: int | None = None,
|
|
414
|
+
cloud_polling_timeout_seconds: int | None = None,
|
|
400
415
|
base_url: str | httpx.URL | None = None,
|
|
401
416
|
timeout: float | Timeout | None | NotGiven = not_given,
|
|
402
417
|
http_client: httpx.AsyncClient | None = None,
|
|
@@ -434,6 +449,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
434
449
|
cloud_project_id=cloud_project_id or self.cloud_project_id,
|
|
435
450
|
cloud_region_id=cloud_region_id or self.cloud_region_id,
|
|
436
451
|
cloud_polling_interval_seconds=cloud_polling_interval_seconds or self.cloud_polling_interval_seconds,
|
|
452
|
+
cloud_polling_timeout_seconds=cloud_polling_timeout_seconds or self.cloud_polling_timeout_seconds,
|
|
437
453
|
base_url=base_url or self.base_url,
|
|
438
454
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
439
455
|
http_client=http_client,
|
gcore/_version.py
CHANGED
gcore/resources/cdn/cdn.py
CHANGED
|
@@ -4,6 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
+
from .logs import (
|
|
8
|
+
LogsResource,
|
|
9
|
+
AsyncLogsResource,
|
|
10
|
+
LogsResourceWithRawResponse,
|
|
11
|
+
AsyncLogsResourceWithRawResponse,
|
|
12
|
+
LogsResourceWithStreamingResponse,
|
|
13
|
+
AsyncLogsResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
7
15
|
from .metrics import (
|
|
8
16
|
MetricsResource,
|
|
9
17
|
AsyncMetricsResource,
|
|
@@ -39,14 +47,6 @@ from .ip_ranges import (
|
|
|
39
47
|
IPRangesResourceWithStreamingResponse,
|
|
40
48
|
AsyncIPRangesResourceWithStreamingResponse,
|
|
41
49
|
)
|
|
42
|
-
from .logs.logs import (
|
|
43
|
-
LogsResource,
|
|
44
|
-
AsyncLogsResource,
|
|
45
|
-
LogsResourceWithRawResponse,
|
|
46
|
-
AsyncLogsResourceWithRawResponse,
|
|
47
|
-
LogsResourceWithStreamingResponse,
|
|
48
|
-
AsyncLogsResourceWithStreamingResponse,
|
|
49
|
-
)
|
|
50
50
|
from .statistics import (
|
|
51
51
|
StatisticsResource,
|
|
52
52
|
AsyncStatisticsResource,
|
|
@@ -63,7 +63,6 @@ from ..._response import (
|
|
|
63
63
|
async_to_streamed_response_wrapper,
|
|
64
64
|
)
|
|
65
65
|
from ...types.cdn import cdn_update_account_params, cdn_list_purge_statuses_params
|
|
66
|
-
from ...pagination import SyncOffsetPageCdn, AsyncOffsetPageCdn
|
|
67
66
|
from .certificates import (
|
|
68
67
|
CertificatesResource,
|
|
69
68
|
AsyncCertificatesResource,
|
|
@@ -80,7 +79,7 @@ from .origin_groups import (
|
|
|
80
79
|
OriginGroupsResourceWithStreamingResponse,
|
|
81
80
|
AsyncOriginGroupsResourceWithStreamingResponse,
|
|
82
81
|
)
|
|
83
|
-
from ..._base_client import
|
|
82
|
+
from ..._base_client import make_request_options
|
|
84
83
|
from .rule_templates import (
|
|
85
84
|
RuleTemplatesResource,
|
|
86
85
|
AsyncRuleTemplatesResource,
|
|
@@ -105,6 +104,7 @@ from .resources.resources import (
|
|
|
105
104
|
ResourcesResourceWithStreamingResponse,
|
|
106
105
|
AsyncResourcesResourceWithStreamingResponse,
|
|
107
106
|
)
|
|
107
|
+
from ...types.cdn.aws_regions import AwsRegions
|
|
108
108
|
from ...types.cdn.cdn_account import CdnAccount
|
|
109
109
|
from .trusted_ca_certificates import (
|
|
110
110
|
TrustedCaCertificatesResource,
|
|
@@ -114,7 +114,7 @@ from .trusted_ca_certificates import (
|
|
|
114
114
|
TrustedCaCertificatesResourceWithStreamingResponse,
|
|
115
115
|
AsyncTrustedCaCertificatesResourceWithStreamingResponse,
|
|
116
116
|
)
|
|
117
|
-
from ...types.cdn.
|
|
117
|
+
from ...types.cdn.alibaba_regions import AlibabaRegions
|
|
118
118
|
from .logs_uploader.logs_uploader import (
|
|
119
119
|
LogsUploaderResource,
|
|
120
120
|
AsyncLogsUploaderResource,
|
|
@@ -125,6 +125,7 @@ from .logs_uploader.logs_uploader import (
|
|
|
125
125
|
)
|
|
126
126
|
from ...types.cdn.cdn_account_limits import CdnAccountLimits
|
|
127
127
|
from ...types.cdn.cdn_available_features import CdnAvailableFeatures
|
|
128
|
+
from ...types.cdn.cdn_list_purge_statuses_response import CdnListPurgeStatusesResponse
|
|
128
129
|
|
|
129
130
|
__all__ = ["CdnResource", "AsyncCdnResource"]
|
|
130
131
|
|
|
@@ -258,6 +259,44 @@ class CdnResource(SyncAPIResource):
|
|
|
258
259
|
cast_to=CdnAvailableFeatures,
|
|
259
260
|
)
|
|
260
261
|
|
|
262
|
+
def list_alibaba_regions(
|
|
263
|
+
self,
|
|
264
|
+
*,
|
|
265
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
266
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
267
|
+
extra_headers: Headers | None = None,
|
|
268
|
+
extra_query: Query | None = None,
|
|
269
|
+
extra_body: Body | None = None,
|
|
270
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
271
|
+
) -> AlibabaRegions:
|
|
272
|
+
"""Get the list of Alibaba Cloud regions."""
|
|
273
|
+
return self._get(
|
|
274
|
+
"/cdn/alibaba_regions",
|
|
275
|
+
options=make_request_options(
|
|
276
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
277
|
+
),
|
|
278
|
+
cast_to=AlibabaRegions,
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
def list_aws_regions(
|
|
282
|
+
self,
|
|
283
|
+
*,
|
|
284
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
|
+
extra_headers: Headers | None = None,
|
|
287
|
+
extra_query: Query | None = None,
|
|
288
|
+
extra_body: Body | None = None,
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
+
) -> AwsRegions:
|
|
291
|
+
"""Get the list of Amazon AWS regions."""
|
|
292
|
+
return self._get(
|
|
293
|
+
"/cdn/aws_regions",
|
|
294
|
+
options=make_request_options(
|
|
295
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
296
|
+
),
|
|
297
|
+
cast_to=AwsRegions,
|
|
298
|
+
)
|
|
299
|
+
|
|
261
300
|
def list_purge_statuses(
|
|
262
301
|
self,
|
|
263
302
|
*,
|
|
@@ -274,7 +313,7 @@ class CdnResource(SyncAPIResource):
|
|
|
274
313
|
extra_query: Query | None = None,
|
|
275
314
|
extra_body: Body | None = None,
|
|
276
315
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
277
|
-
) ->
|
|
316
|
+
) -> CdnListPurgeStatusesResponse:
|
|
278
317
|
"""
|
|
279
318
|
Get purges history.
|
|
280
319
|
|
|
@@ -330,9 +369,8 @@ class CdnResource(SyncAPIResource):
|
|
|
330
369
|
|
|
331
370
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
332
371
|
"""
|
|
333
|
-
return self.
|
|
372
|
+
return self._get(
|
|
334
373
|
"/cdn/purge_statuses",
|
|
335
|
-
page=SyncOffsetPageCdn[PurgeStatus],
|
|
336
374
|
options=make_request_options(
|
|
337
375
|
extra_headers=extra_headers,
|
|
338
376
|
extra_query=extra_query,
|
|
@@ -351,7 +389,7 @@ class CdnResource(SyncAPIResource):
|
|
|
351
389
|
cdn_list_purge_statuses_params.CdnListPurgeStatusesParams,
|
|
352
390
|
),
|
|
353
391
|
),
|
|
354
|
-
|
|
392
|
+
cast_to=CdnListPurgeStatusesResponse,
|
|
355
393
|
)
|
|
356
394
|
|
|
357
395
|
def update_account(
|
|
@@ -522,7 +560,45 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
522
560
|
cast_to=CdnAvailableFeatures,
|
|
523
561
|
)
|
|
524
562
|
|
|
525
|
-
def
|
|
563
|
+
async def list_alibaba_regions(
|
|
564
|
+
self,
|
|
565
|
+
*,
|
|
566
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
567
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
568
|
+
extra_headers: Headers | None = None,
|
|
569
|
+
extra_query: Query | None = None,
|
|
570
|
+
extra_body: Body | None = None,
|
|
571
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
572
|
+
) -> AlibabaRegions:
|
|
573
|
+
"""Get the list of Alibaba Cloud regions."""
|
|
574
|
+
return await self._get(
|
|
575
|
+
"/cdn/alibaba_regions",
|
|
576
|
+
options=make_request_options(
|
|
577
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
578
|
+
),
|
|
579
|
+
cast_to=AlibabaRegions,
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
async def list_aws_regions(
|
|
583
|
+
self,
|
|
584
|
+
*,
|
|
585
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
586
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
587
|
+
extra_headers: Headers | None = None,
|
|
588
|
+
extra_query: Query | None = None,
|
|
589
|
+
extra_body: Body | None = None,
|
|
590
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
591
|
+
) -> AwsRegions:
|
|
592
|
+
"""Get the list of Amazon AWS regions."""
|
|
593
|
+
return await self._get(
|
|
594
|
+
"/cdn/aws_regions",
|
|
595
|
+
options=make_request_options(
|
|
596
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
597
|
+
),
|
|
598
|
+
cast_to=AwsRegions,
|
|
599
|
+
)
|
|
600
|
+
|
|
601
|
+
async def list_purge_statuses(
|
|
526
602
|
self,
|
|
527
603
|
*,
|
|
528
604
|
cname: str | Omit = omit,
|
|
@@ -538,7 +614,7 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
538
614
|
extra_query: Query | None = None,
|
|
539
615
|
extra_body: Body | None = None,
|
|
540
616
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
541
|
-
) ->
|
|
617
|
+
) -> CdnListPurgeStatusesResponse:
|
|
542
618
|
"""
|
|
543
619
|
Get purges history.
|
|
544
620
|
|
|
@@ -594,15 +670,14 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
594
670
|
|
|
595
671
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
596
672
|
"""
|
|
597
|
-
return self.
|
|
673
|
+
return await self._get(
|
|
598
674
|
"/cdn/purge_statuses",
|
|
599
|
-
page=AsyncOffsetPageCdn[PurgeStatus],
|
|
600
675
|
options=make_request_options(
|
|
601
676
|
extra_headers=extra_headers,
|
|
602
677
|
extra_query=extra_query,
|
|
603
678
|
extra_body=extra_body,
|
|
604
679
|
timeout=timeout,
|
|
605
|
-
query=
|
|
680
|
+
query=await async_maybe_transform(
|
|
606
681
|
{
|
|
607
682
|
"cname": cname,
|
|
608
683
|
"from_created": from_created,
|
|
@@ -615,7 +690,7 @@ class AsyncCdnResource(AsyncAPIResource):
|
|
|
615
690
|
cdn_list_purge_statuses_params.CdnListPurgeStatusesParams,
|
|
616
691
|
),
|
|
617
692
|
),
|
|
618
|
-
|
|
693
|
+
cast_to=CdnListPurgeStatusesResponse,
|
|
619
694
|
)
|
|
620
695
|
|
|
621
696
|
async def update_account(
|
|
@@ -670,6 +745,12 @@ class CdnResourceWithRawResponse:
|
|
|
670
745
|
self.get_available_features = to_raw_response_wrapper(
|
|
671
746
|
cdn.get_available_features,
|
|
672
747
|
)
|
|
748
|
+
self.list_alibaba_regions = to_raw_response_wrapper(
|
|
749
|
+
cdn.list_alibaba_regions,
|
|
750
|
+
)
|
|
751
|
+
self.list_aws_regions = to_raw_response_wrapper(
|
|
752
|
+
cdn.list_aws_regions,
|
|
753
|
+
)
|
|
673
754
|
self.list_purge_statuses = to_raw_response_wrapper(
|
|
674
755
|
cdn.list_purge_statuses,
|
|
675
756
|
)
|
|
@@ -743,6 +824,12 @@ class AsyncCdnResourceWithRawResponse:
|
|
|
743
824
|
self.get_available_features = async_to_raw_response_wrapper(
|
|
744
825
|
cdn.get_available_features,
|
|
745
826
|
)
|
|
827
|
+
self.list_alibaba_regions = async_to_raw_response_wrapper(
|
|
828
|
+
cdn.list_alibaba_regions,
|
|
829
|
+
)
|
|
830
|
+
self.list_aws_regions = async_to_raw_response_wrapper(
|
|
831
|
+
cdn.list_aws_regions,
|
|
832
|
+
)
|
|
746
833
|
self.list_purge_statuses = async_to_raw_response_wrapper(
|
|
747
834
|
cdn.list_purge_statuses,
|
|
748
835
|
)
|
|
@@ -816,6 +903,12 @@ class CdnResourceWithStreamingResponse:
|
|
|
816
903
|
self.get_available_features = to_streamed_response_wrapper(
|
|
817
904
|
cdn.get_available_features,
|
|
818
905
|
)
|
|
906
|
+
self.list_alibaba_regions = to_streamed_response_wrapper(
|
|
907
|
+
cdn.list_alibaba_regions,
|
|
908
|
+
)
|
|
909
|
+
self.list_aws_regions = to_streamed_response_wrapper(
|
|
910
|
+
cdn.list_aws_regions,
|
|
911
|
+
)
|
|
819
912
|
self.list_purge_statuses = to_streamed_response_wrapper(
|
|
820
913
|
cdn.list_purge_statuses,
|
|
821
914
|
)
|
|
@@ -889,6 +982,12 @@ class AsyncCdnResourceWithStreamingResponse:
|
|
|
889
982
|
self.get_available_features = async_to_streamed_response_wrapper(
|
|
890
983
|
cdn.get_available_features,
|
|
891
984
|
)
|
|
985
|
+
self.list_alibaba_regions = async_to_streamed_response_wrapper(
|
|
986
|
+
cdn.list_alibaba_regions,
|
|
987
|
+
)
|
|
988
|
+
self.list_aws_regions = async_to_streamed_response_wrapper(
|
|
989
|
+
cdn.list_aws_regions,
|
|
990
|
+
)
|
|
892
991
|
self.list_purge_statuses = async_to_streamed_response_wrapper(
|
|
893
992
|
cdn.list_purge_statuses,
|
|
894
993
|
)
|
|
@@ -4,11 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
7
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
8
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
9
|
+
from ..._compat import cached_property
|
|
10
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ..._response import (
|
|
12
12
|
BinaryAPIResponse,
|
|
13
13
|
AsyncBinaryAPIResponse,
|
|
14
14
|
StreamedBinaryAPIResponse,
|
|
@@ -22,10 +22,10 @@ from ...._response import (
|
|
|
22
22
|
async_to_custom_raw_response_wrapper,
|
|
23
23
|
async_to_custom_streamed_response_wrapper,
|
|
24
24
|
)
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
25
|
+
from ...types.cdn import log_list_params, log_download_params
|
|
26
|
+
from ...pagination import SyncOffsetPageCdnLogs, AsyncOffsetPageCdnLogs
|
|
27
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
28
|
+
from ...types.cdn.cdn_log_entry import Data
|
|
29
29
|
|
|
30
30
|
__all__ = ["LogsResource", "AsyncLogsResource"]
|
|
31
31
|
|
|
@@ -415,6 +415,7 @@ class ServersResource(SyncAPIResource):
|
|
|
415
415
|
user_data: str | Omit = omit,
|
|
416
416
|
username: str | Omit = omit,
|
|
417
417
|
polling_interval_seconds: int | Omit = omit,
|
|
418
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
418
419
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
419
420
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
420
421
|
extra_headers: Headers | None = None,
|
|
@@ -450,6 +451,7 @@ class ServersResource(SyncAPIResource):
|
|
|
450
451
|
response.tasks[0],
|
|
451
452
|
extra_headers=extra_headers,
|
|
452
453
|
polling_interval_seconds=polling_interval_seconds,
|
|
454
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
453
455
|
)
|
|
454
456
|
if not task.created_resources or not task.created_resources.instances:
|
|
455
457
|
raise ValueError("No server was created")
|
|
@@ -475,6 +477,7 @@ class ServersResource(SyncAPIResource):
|
|
|
475
477
|
image_id: str | Omit = omit,
|
|
476
478
|
user_data: str | Omit = omit,
|
|
477
479
|
polling_interval_seconds: int | Omit = omit,
|
|
480
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
478
481
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
479
482
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
480
483
|
extra_headers: Headers | None = None,
|
|
@@ -500,6 +503,7 @@ class ServersResource(SyncAPIResource):
|
|
|
500
503
|
response.tasks[0],
|
|
501
504
|
extra_headers=extra_headers,
|
|
502
505
|
polling_interval_seconds=polling_interval_seconds,
|
|
506
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
503
507
|
)
|
|
504
508
|
servers = self.list(
|
|
505
509
|
project_id=project_id,
|
|
@@ -902,6 +906,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
902
906
|
user_data: str | Omit = omit,
|
|
903
907
|
username: str | Omit = omit,
|
|
904
908
|
polling_interval_seconds: int | Omit = omit,
|
|
909
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
905
910
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
906
911
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
907
912
|
extra_headers: Headers | None = None,
|
|
@@ -937,6 +942,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
937
942
|
response.tasks[0],
|
|
938
943
|
extra_headers=extra_headers,
|
|
939
944
|
polling_interval_seconds=polling_interval_seconds,
|
|
945
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
940
946
|
)
|
|
941
947
|
if not task.created_resources or not task.created_resources.instances:
|
|
942
948
|
raise ValueError("No server was created")
|
|
@@ -962,6 +968,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
962
968
|
image_id: str | Omit = omit,
|
|
963
969
|
user_data: str | Omit = omit,
|
|
964
970
|
polling_interval_seconds: int | Omit = omit,
|
|
971
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
965
972
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
966
973
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
967
974
|
extra_headers: Headers | None = None,
|
|
@@ -987,6 +994,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
987
994
|
response.tasks[0],
|
|
988
995
|
extra_headers=extra_headers,
|
|
989
996
|
polling_interval_seconds=polling_interval_seconds,
|
|
997
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
990
998
|
)
|
|
991
999
|
servers = await self.list(
|
|
992
1000
|
project_id=project_id,
|
gcore/resources/cloud/cloud.py
CHANGED
|
@@ -283,6 +283,9 @@ class CloudResource(SyncAPIResource):
|
|
|
283
283
|
|
|
284
284
|
@cached_property
|
|
285
285
|
def placement_groups(self) -> PlacementGroupsResource:
|
|
286
|
+
"""
|
|
287
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
288
|
+
"""
|
|
286
289
|
return PlacementGroupsResource(self._client)
|
|
287
290
|
|
|
288
291
|
@cached_property
|
|
@@ -412,6 +415,9 @@ class AsyncCloudResource(AsyncAPIResource):
|
|
|
412
415
|
|
|
413
416
|
@cached_property
|
|
414
417
|
def placement_groups(self) -> AsyncPlacementGroupsResource:
|
|
418
|
+
"""
|
|
419
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
420
|
+
"""
|
|
415
421
|
return AsyncPlacementGroupsResource(self._client)
|
|
416
422
|
|
|
417
423
|
@cached_property
|
|
@@ -544,6 +550,9 @@ class CloudResourceWithRawResponse:
|
|
|
544
550
|
|
|
545
551
|
@cached_property
|
|
546
552
|
def placement_groups(self) -> PlacementGroupsResourceWithRawResponse:
|
|
553
|
+
"""
|
|
554
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
555
|
+
"""
|
|
547
556
|
return PlacementGroupsResourceWithRawResponse(self._cloud.placement_groups)
|
|
548
557
|
|
|
549
558
|
@cached_property
|
|
@@ -657,6 +666,9 @@ class AsyncCloudResourceWithRawResponse:
|
|
|
657
666
|
|
|
658
667
|
@cached_property
|
|
659
668
|
def placement_groups(self) -> AsyncPlacementGroupsResourceWithRawResponse:
|
|
669
|
+
"""
|
|
670
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
671
|
+
"""
|
|
660
672
|
return AsyncPlacementGroupsResourceWithRawResponse(self._cloud.placement_groups)
|
|
661
673
|
|
|
662
674
|
@cached_property
|
|
@@ -770,6 +782,9 @@ class CloudResourceWithStreamingResponse:
|
|
|
770
782
|
|
|
771
783
|
@cached_property
|
|
772
784
|
def placement_groups(self) -> PlacementGroupsResourceWithStreamingResponse:
|
|
785
|
+
"""
|
|
786
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
787
|
+
"""
|
|
773
788
|
return PlacementGroupsResourceWithStreamingResponse(self._cloud.placement_groups)
|
|
774
789
|
|
|
775
790
|
@cached_property
|
|
@@ -883,6 +898,9 @@ class AsyncCloudResourceWithStreamingResponse:
|
|
|
883
898
|
|
|
884
899
|
@cached_property
|
|
885
900
|
def placement_groups(self) -> AsyncPlacementGroupsResourceWithStreamingResponse:
|
|
901
|
+
"""
|
|
902
|
+
Placement Groups allow you to specific a policy that determines whether Virtual Machines will be hosted on the same physical server or on different ones.
|
|
903
|
+
"""
|
|
886
904
|
return AsyncPlacementGroupsResourceWithStreamingResponse(self._cloud.placement_groups)
|
|
887
905
|
|
|
888
906
|
@cached_property
|