gcore 0.15.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 +18 -8
- gcore/_version.py +1 -1
- gcore/resources/cdn/audit_log.py +4 -12
- gcore/resources/cdn/cdn.py +130 -39
- gcore/resources/cdn/certificates.py +16 -40
- gcore/resources/cdn/ip_ranges.py +4 -8
- gcore/resources/cdn/{logs/logs.py → logs.py} +13 -53
- gcore/resources/cdn/logs_uploader/configs.py +14 -42
- gcore/resources/cdn/logs_uploader/policies.py +14 -42
- gcore/resources/cdn/logs_uploader/targets.py +14 -42
- gcore/resources/cdn/metrics.py +2 -6
- gcore/resources/cdn/network_capacity.py +2 -6
- gcore/resources/cdn/origin_groups.py +12 -32
- gcore/resources/cdn/resources/resources.py +18 -46
- gcore/resources/cdn/resources/rules.py +12 -36
- gcore/resources/cdn/resources/shield.py +4 -12
- gcore/resources/cdn/rule_templates.py +12 -36
- gcore/resources/cdn/shields.py +2 -6
- gcore/resources/cdn/statistics.py +16 -40
- gcore/resources/cdn/trusted_ca_certificates.py +10 -30
- gcore/resources/cloud/audit_logs.py +2 -6
- gcore/resources/cloud/baremetal/flavors.py +2 -6
- gcore/resources/cloud/baremetal/images.py +2 -6
- gcore/resources/cloud/baremetal/servers.py +14 -18
- gcore/resources/cloud/billing_reservations.py +25 -208
- gcore/resources/cloud/cloud.py +18 -0
- gcore/resources/cloud/cost_reports.py +44 -62
- gcore/resources/cloud/file_shares/access_rules.py +6 -18
- gcore/resources/cloud/file_shares/file_shares.py +126 -42
- gcore/resources/cloud/floating_ips.py +22 -42
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +2 -6
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +30 -54
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +16 -24
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -6
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +18 -42
- gcore/resources/cloud/inference/api_keys.py +10 -30
- gcore/resources/cloud/inference/applications/deployments.py +135 -155
- gcore/resources/cloud/inference/applications/templates.py +4 -12
- gcore/resources/cloud/inference/deployments/deployments.py +28 -48
- gcore/resources/cloud/inference/deployments/logs.py +2 -6
- gcore/resources/cloud/inference/flavors.py +4 -12
- gcore/resources/cloud/inference/inference.py +2 -6
- gcore/resources/cloud/inference/registry_credentials.py +10 -30
- gcore/resources/cloud/inference/secrets.py +10 -30
- gcore/resources/cloud/instances/flavors.py +2 -6
- gcore/resources/cloud/instances/images.py +24 -36
- gcore/resources/cloud/instances/instances.py +119 -94
- gcore/resources/cloud/instances/interfaces.py +18 -18
- gcore/resources/cloud/instances/metrics.py +2 -6
- gcore/resources/cloud/ip_ranges.py +2 -6
- gcore/resources/cloud/k8s/clusters/clusters.py +18 -54
- gcore/resources/cloud/k8s/clusters/nodes.py +4 -12
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +4 -12
- gcore/resources/cloud/k8s/clusters/pools/pools.py +12 -36
- gcore/resources/cloud/k8s/flavors.py +2 -6
- gcore/resources/cloud/k8s/k8s.py +2 -6
- gcore/resources/cloud/load_balancers/flavors.py +2 -6
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +22 -30
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +22 -30
- gcore/resources/cloud/load_balancers/listeners.py +38 -46
- gcore/resources/cloud/load_balancers/load_balancers.py +509 -521
- gcore/resources/cloud/load_balancers/metrics.py +8 -12
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +4 -12
- gcore/resources/cloud/load_balancers/pools/members.py +4 -12
- gcore/resources/cloud/load_balancers/pools/pools.py +38 -46
- gcore/resources/cloud/load_balancers/statuses.py +10 -18
- gcore/resources/cloud/networks/networks.py +18 -30
- gcore/resources/cloud/networks/routers.py +14 -42
- gcore/resources/cloud/networks/subnets.py +14 -30
- gcore/resources/cloud/placement_groups.py +16 -24
- gcore/resources/cloud/projects.py +117 -129
- gcore/resources/cloud/quotas/quotas.py +6 -18
- gcore/resources/cloud/quotas/requests.py +8 -24
- gcore/resources/cloud/regions.py +4 -8
- gcore/resources/cloud/registries/artifacts.py +4 -12
- gcore/resources/cloud/registries/registries.py +10 -30
- gcore/resources/cloud/registries/repositories.py +4 -12
- gcore/resources/cloud/registries/tags.py +2 -6
- gcore/resources/cloud/registries/users.py +12 -36
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +28 -30
- gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -30
- gcore/resources/cloud/secrets.py +12 -24
- gcore/resources/cloud/security_groups/rules.py +6 -18
- gcore/resources/cloud/security_groups/security_groups.py +14 -42
- gcore/resources/cloud/ssh_keys.py +10 -30
- gcore/resources/cloud/tasks.py +36 -33
- gcore/resources/cloud/usage_reports.py +18 -24
- gcore/resources/cloud/users/role_assignments.py +8 -24
- gcore/resources/cloud/volumes.py +47 -61
- gcore/resources/dns/dns.py +4 -8
- gcore/resources/dns/locations.py +8 -20
- gcore/resources/dns/metrics.py +2 -6
- gcore/resources/dns/pickers/pickers.py +2 -2
- gcore/resources/dns/pickers/presets.py +2 -6
- gcore/resources/dns/zones/dnssec.py +4 -12
- gcore/resources/dns/zones/rrsets.py +12 -36
- gcore/resources/dns/zones/zones.py +22 -58
- gcore/resources/fastedge/apps/apps.py +12 -28
- gcore/resources/fastedge/apps/logs.py +2 -6
- gcore/resources/fastedge/binaries.py +8 -24
- gcore/resources/fastedge/fastedge.py +2 -2
- gcore/resources/fastedge/kv_stores.py +10 -22
- gcore/resources/fastedge/secrets.py +12 -36
- gcore/resources/fastedge/statistics.py +4 -12
- gcore/resources/fastedge/templates.py +10 -30
- gcore/resources/iam/api_tokens.py +8 -24
- gcore/resources/iam/iam.py +2 -2
- gcore/resources/iam/users.py +10 -26
- gcore/resources/security/bgp_announces.py +4 -12
- gcore/resources/security/events.py +2 -6
- gcore/resources/security/profile_templates.py +2 -6
- gcore/resources/security/profiles.py +16 -40
- gcore/resources/storage/buckets/buckets.py +6 -18
- gcore/resources/storage/buckets/cors.py +4 -12
- gcore/resources/storage/buckets/lifecycle.py +4 -12
- gcore/resources/storage/buckets/policy.py +6 -18
- gcore/resources/storage/credentials.py +2 -6
- gcore/resources/storage/locations.py +2 -6
- gcore/resources/storage/statistics.py +4 -12
- gcore/resources/storage/storage.py +16 -48
- gcore/resources/streaming/ai_tasks.py +10 -18
- gcore/resources/streaming/broadcasts.py +12 -36
- gcore/resources/streaming/directories.py +10 -30
- gcore/resources/streaming/players.py +12 -28
- gcore/resources/streaming/playlists.py +12 -36
- gcore/resources/streaming/quality_sets.py +4 -12
- gcore/resources/streaming/restreams.py +10 -30
- gcore/resources/streaming/statistics.py +46 -138
- gcore/resources/streaming/streams/overlays.py +12 -36
- gcore/resources/streaming/streams/streams.py +20 -52
- gcore/resources/streaming/videos/subtitles.py +10 -30
- gcore/resources/streaming/videos/videos.py +16 -40
- gcore/resources/waap/advanced_rules.py +2 -6
- gcore/resources/waap/custom_page_sets.py +12 -36
- gcore/resources/waap/domains/advanced_rules.py +12 -36
- gcore/resources/waap/domains/api_discovery.py +12 -36
- gcore/resources/waap/domains/api_path_groups.py +2 -6
- gcore/resources/waap/domains/api_paths.py +10 -30
- gcore/resources/waap/domains/custom_rules.py +14 -42
- gcore/resources/waap/domains/domains.py +12 -32
- gcore/resources/waap/domains/firewall_rules.py +14 -42
- gcore/resources/waap/domains/insight_silences.py +10 -30
- gcore/resources/waap/domains/insights.py +6 -18
- gcore/resources/waap/domains/settings.py +4 -12
- gcore/resources/waap/domains/statistics.py +12 -36
- gcore/resources/waap/insights.py +2 -6
- gcore/resources/waap/ip_info/ip_info.py +16 -48
- gcore/resources/waap/ip_info/metrics.py +2 -6
- gcore/resources/waap/organizations.py +2 -6
- gcore/resources/waap/statistics.py +2 -6
- gcore/resources/waap/tags.py +2 -2
- gcore/resources/waap/waap.py +2 -2
- 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/logs_aggregated_stats.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 +2 -1
- gcore/types/cloud/billing_reservation.py +52 -114
- gcore/types/cloud/billing_reservation_list_params.py +4 -42
- gcore/types/cloud/billing_reservations.py +16 -0
- gcore/types/cloud/cost_report_get_aggregated_params.py +2 -2
- gcore/types/cloud/cost_report_get_detailed_params.py +2 -2
- gcore/types/cloud/inference/applications/__init__.py +1 -1
- gcore/types/cloud/inference/applications/{deployment_patch_params.py → deployment_update_params.py} +2 -2
- gcore/types/cloud/instance_list_params.py +1 -1
- gcore/types/cloud/instance_update_params.py +31 -3
- gcore/types/cloud/load_balancer_create_params.py +1 -1
- gcore/types/cloud/load_balancer_listener_detail.py +1 -1
- gcore/types/cloud/load_balancers/listener_create_params.py +1 -1
- gcore/types/cloud/load_balancers/listener_list_params.py +1 -1
- gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
- gcore/types/cloud/load_balancers/pool_list_params.py +1 -1
- gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
- gcore/types/cloud/task_list_params.py +3 -3
- gcore/types/cloud/usage_report_get_params.py +2 -2
- gcore/types/security/profile_create_params.py +2 -2
- {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/METADATA +2 -2
- {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/RECORD +193 -195
- gcore/resources/cdn/logs/__init__.py +0 -33
- gcore/resources/cdn/logs/settings.py +0 -1081
- gcore/types/cdn/logs/__init__.py +0 -7
- gcore/types/cdn/logs/log_settings.py +0 -172
- gcore/types/cdn/logs/setting_create_params.py +0 -200
- gcore/types/cdn/logs/setting_update_params.py +0 -200
- {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/WHEEL +0 -0
- {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -161,9 +161,7 @@ class ServersResource(SyncAPIResource):
|
|
|
161
161
|
if region_id is None:
|
|
162
162
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
163
163
|
return self._post(
|
|
164
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}"
|
|
165
|
-
if self._client._base_url_overridden
|
|
166
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}",
|
|
164
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}",
|
|
167
165
|
body=maybe_transform(
|
|
168
166
|
{
|
|
169
167
|
"flavor": flavor,
|
|
@@ -301,9 +299,7 @@ class ServersResource(SyncAPIResource):
|
|
|
301
299
|
if region_id is None:
|
|
302
300
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
303
301
|
return self._get_api_list(
|
|
304
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}"
|
|
305
|
-
if self._client._base_url_overridden
|
|
306
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}",
|
|
302
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}",
|
|
307
303
|
page=SyncOffsetPage[BaremetalServer],
|
|
308
304
|
options=make_request_options(
|
|
309
305
|
extra_headers=extra_headers,
|
|
@@ -386,9 +382,7 @@ class ServersResource(SyncAPIResource):
|
|
|
386
382
|
if not server_id:
|
|
387
383
|
raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
|
|
388
384
|
return self._post(
|
|
389
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild"
|
|
390
|
-
if self._client._base_url_overridden
|
|
391
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
|
|
385
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
|
|
392
386
|
body=maybe_transform(
|
|
393
387
|
{
|
|
394
388
|
"image_id": image_id,
|
|
@@ -421,6 +415,7 @@ class ServersResource(SyncAPIResource):
|
|
|
421
415
|
user_data: str | Omit = omit,
|
|
422
416
|
username: str | Omit = omit,
|
|
423
417
|
polling_interval_seconds: int | Omit = omit,
|
|
418
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
424
419
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
425
420
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
426
421
|
extra_headers: Headers | None = None,
|
|
@@ -456,6 +451,7 @@ class ServersResource(SyncAPIResource):
|
|
|
456
451
|
response.tasks[0],
|
|
457
452
|
extra_headers=extra_headers,
|
|
458
453
|
polling_interval_seconds=polling_interval_seconds,
|
|
454
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
459
455
|
)
|
|
460
456
|
if not task.created_resources or not task.created_resources.instances:
|
|
461
457
|
raise ValueError("No server was created")
|
|
@@ -481,6 +477,7 @@ class ServersResource(SyncAPIResource):
|
|
|
481
477
|
image_id: str | Omit = omit,
|
|
482
478
|
user_data: str | Omit = omit,
|
|
483
479
|
polling_interval_seconds: int | Omit = omit,
|
|
480
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
484
481
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
485
482
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
486
483
|
extra_headers: Headers | None = None,
|
|
@@ -506,6 +503,7 @@ class ServersResource(SyncAPIResource):
|
|
|
506
503
|
response.tasks[0],
|
|
507
504
|
extra_headers=extra_headers,
|
|
508
505
|
polling_interval_seconds=polling_interval_seconds,
|
|
506
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
509
507
|
)
|
|
510
508
|
servers = self.list(
|
|
511
509
|
project_id=project_id,
|
|
@@ -654,9 +652,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
654
652
|
if region_id is None:
|
|
655
653
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
656
654
|
return await self._post(
|
|
657
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}"
|
|
658
|
-
if self._client._base_url_overridden
|
|
659
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}",
|
|
655
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}",
|
|
660
656
|
body=await async_maybe_transform(
|
|
661
657
|
{
|
|
662
658
|
"flavor": flavor,
|
|
@@ -794,9 +790,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
794
790
|
if region_id is None:
|
|
795
791
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
796
792
|
return self._get_api_list(
|
|
797
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}"
|
|
798
|
-
if self._client._base_url_overridden
|
|
799
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}",
|
|
793
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}",
|
|
800
794
|
page=AsyncOffsetPage[BaremetalServer],
|
|
801
795
|
options=make_request_options(
|
|
802
796
|
extra_headers=extra_headers,
|
|
@@ -879,9 +873,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
879
873
|
if not server_id:
|
|
880
874
|
raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
|
|
881
875
|
return await self._post(
|
|
882
|
-
f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild"
|
|
883
|
-
if self._client._base_url_overridden
|
|
884
|
-
else f"https://api.gcore.com//cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
|
|
876
|
+
f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
|
|
885
877
|
body=await async_maybe_transform(
|
|
886
878
|
{
|
|
887
879
|
"image_id": image_id,
|
|
@@ -914,6 +906,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
914
906
|
user_data: str | Omit = omit,
|
|
915
907
|
username: str | Omit = omit,
|
|
916
908
|
polling_interval_seconds: int | Omit = omit,
|
|
909
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
917
910
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
918
911
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
919
912
|
extra_headers: Headers | None = None,
|
|
@@ -949,6 +942,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
949
942
|
response.tasks[0],
|
|
950
943
|
extra_headers=extra_headers,
|
|
951
944
|
polling_interval_seconds=polling_interval_seconds,
|
|
945
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
952
946
|
)
|
|
953
947
|
if not task.created_resources or not task.created_resources.instances:
|
|
954
948
|
raise ValueError("No server was created")
|
|
@@ -974,6 +968,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
974
968
|
image_id: str | Omit = omit,
|
|
975
969
|
user_data: str | Omit = omit,
|
|
976
970
|
polling_interval_seconds: int | Omit = omit,
|
|
971
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
977
972
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
978
973
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
979
974
|
extra_headers: Headers | None = None,
|
|
@@ -999,6 +994,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
999
994
|
response.tasks[0],
|
|
1000
995
|
extra_headers=extra_headers,
|
|
1001
996
|
polling_interval_seconds=polling_interval_seconds,
|
|
997
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
1002
998
|
)
|
|
1003
999
|
servers = await self.list(
|
|
1004
1000
|
project_id=project_id,
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List, Union
|
|
6
|
-
from datetime import date, datetime
|
|
7
5
|
from typing_extensions import Literal
|
|
8
6
|
|
|
9
7
|
import httpx
|
|
10
8
|
|
|
11
9
|
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
12
|
-
from ..._utils import maybe_transform
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
13
11
|
from ..._compat import cached_property
|
|
14
12
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
15
13
|
from ..._response import (
|
|
@@ -18,10 +16,9 @@ from ..._response import (
|
|
|
18
16
|
async_to_raw_response_wrapper,
|
|
19
17
|
async_to_streamed_response_wrapper,
|
|
20
18
|
)
|
|
21
|
-
from ...pagination import SyncOffsetPage, AsyncOffsetPage
|
|
22
19
|
from ...types.cloud import billing_reservation_list_params
|
|
23
|
-
from ..._base_client import
|
|
24
|
-
from ...types.cloud.
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.cloud.billing_reservations import BillingReservations
|
|
25
22
|
|
|
26
23
|
__all__ = ["BillingReservationsResource", "AsyncBillingReservationsResource"]
|
|
27
24
|
|
|
@@ -49,67 +46,29 @@ class BillingReservationsResource(SyncAPIResource):
|
|
|
49
46
|
def list(
|
|
50
47
|
self,
|
|
51
48
|
*,
|
|
52
|
-
activated_from: Union[str, date] | Omit = omit,
|
|
53
|
-
activated_to: Union[str, date] | Omit = omit,
|
|
54
|
-
created_from: Union[str, datetime] | Omit = omit,
|
|
55
|
-
created_to: Union[str, datetime] | Omit = omit,
|
|
56
|
-
deactivated_from: Union[str, date] | Omit = omit,
|
|
57
|
-
deactivated_to: Union[str, date] | Omit = omit,
|
|
58
|
-
limit: int | Omit = omit,
|
|
59
49
|
metric_name: str | Omit = omit,
|
|
60
|
-
|
|
61
|
-
order_by: Literal[
|
|
62
|
-
"active_from.asc",
|
|
63
|
-
"active_from.desc",
|
|
64
|
-
"active_to.asc",
|
|
65
|
-
"active_to.desc",
|
|
66
|
-
"created_at.asc",
|
|
67
|
-
"created_at.desc",
|
|
68
|
-
]
|
|
69
|
-
| Omit = omit,
|
|
50
|
+
order_by: Literal["active_from.asc", "active_from.desc", "active_to.asc", "active_to.desc"] | Omit = omit,
|
|
70
51
|
region_id: int | Omit = omit,
|
|
71
|
-
|
|
72
|
-
Literal[
|
|
73
|
-
"ACTIVATED", "APPROVED", "COPIED", "CREATED", "EXPIRED", "REJECTED", "RESERVED", "WAITING_FOR_PAYMENT"
|
|
74
|
-
]
|
|
75
|
-
]
|
|
76
|
-
| Omit = omit,
|
|
52
|
+
show_inactive: bool | Omit = omit,
|
|
77
53
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
78
54
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
79
55
|
extra_headers: Headers | None = None,
|
|
80
56
|
extra_query: Query | None = None,
|
|
81
57
|
extra_body: Body | None = None,
|
|
82
58
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
83
|
-
) ->
|
|
59
|
+
) -> BillingReservations:
|
|
84
60
|
"""
|
|
85
|
-
|
|
61
|
+
Get a list of billing reservations along with detailed information on resource
|
|
62
|
+
configurations and associated pricing.
|
|
86
63
|
|
|
87
64
|
Args:
|
|
88
|
-
activated_from: Lower bound, starting from what date the reservation was/will be activated
|
|
89
|
-
|
|
90
|
-
activated_to: High bound, before what date the reservation was/will be activated
|
|
91
|
-
|
|
92
|
-
created_from: Lower bound the filter, showing result(s) equal to or greater than date the
|
|
93
|
-
reservation was created
|
|
94
|
-
|
|
95
|
-
created_to: High bound the filter, showing result(s) equal to or less date the reservation
|
|
96
|
-
was created
|
|
97
|
-
|
|
98
|
-
deactivated_from: Lower bound, starting from what date the reservation was/will be deactivated
|
|
99
|
-
|
|
100
|
-
deactivated_to: High bound, before what date the reservation was/will be deactivated
|
|
101
|
-
|
|
102
|
-
limit: Limit of reservation list page
|
|
103
|
-
|
|
104
65
|
metric_name: Name from billing features for specific resource
|
|
105
66
|
|
|
106
|
-
offset: Offset in reservation list
|
|
107
|
-
|
|
108
67
|
order_by: Order by field and direction.
|
|
109
68
|
|
|
110
69
|
region_id: Region for reservation
|
|
111
70
|
|
|
112
|
-
|
|
71
|
+
show_inactive: Include inactive commits in the response
|
|
113
72
|
|
|
114
73
|
extra_headers: Send extra headers
|
|
115
74
|
|
|
@@ -119,11 +78,8 @@ class BillingReservationsResource(SyncAPIResource):
|
|
|
119
78
|
|
|
120
79
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
121
80
|
"""
|
|
122
|
-
return self.
|
|
123
|
-
"/cloud/
|
|
124
|
-
if self._client._base_url_overridden
|
|
125
|
-
else "https://api.gcore.com//cloud/v1/reservations",
|
|
126
|
-
page=SyncOffsetPage[BillingReservation],
|
|
81
|
+
return self._get(
|
|
82
|
+
"/cloud/v2/reservations",
|
|
127
83
|
options=make_request_options(
|
|
128
84
|
extra_headers=extra_headers,
|
|
129
85
|
extra_query=extra_query,
|
|
@@ -131,58 +87,15 @@ class BillingReservationsResource(SyncAPIResource):
|
|
|
131
87
|
timeout=timeout,
|
|
132
88
|
query=maybe_transform(
|
|
133
89
|
{
|
|
134
|
-
"activated_from": activated_from,
|
|
135
|
-
"activated_to": activated_to,
|
|
136
|
-
"created_from": created_from,
|
|
137
|
-
"created_to": created_to,
|
|
138
|
-
"deactivated_from": deactivated_from,
|
|
139
|
-
"deactivated_to": deactivated_to,
|
|
140
|
-
"limit": limit,
|
|
141
90
|
"metric_name": metric_name,
|
|
142
|
-
"offset": offset,
|
|
143
91
|
"order_by": order_by,
|
|
144
92
|
"region_id": region_id,
|
|
145
|
-
"
|
|
93
|
+
"show_inactive": show_inactive,
|
|
146
94
|
},
|
|
147
95
|
billing_reservation_list_params.BillingReservationListParams,
|
|
148
96
|
),
|
|
149
97
|
),
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
def get(
|
|
154
|
-
self,
|
|
155
|
-
reservation_id: int,
|
|
156
|
-
*,
|
|
157
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
158
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
159
|
-
extra_headers: Headers | None = None,
|
|
160
|
-
extra_query: Query | None = None,
|
|
161
|
-
extra_body: Body | None = None,
|
|
162
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
163
|
-
) -> BillingReservation:
|
|
164
|
-
"""
|
|
165
|
-
Get reservation
|
|
166
|
-
|
|
167
|
-
Args:
|
|
168
|
-
reservation_id: ID of the reservation
|
|
169
|
-
|
|
170
|
-
extra_headers: Send extra headers
|
|
171
|
-
|
|
172
|
-
extra_query: Add additional query parameters to the request
|
|
173
|
-
|
|
174
|
-
extra_body: Add additional JSON properties to the request
|
|
175
|
-
|
|
176
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
177
|
-
"""
|
|
178
|
-
return self._get(
|
|
179
|
-
f"/cloud/v1/reservations/{reservation_id}"
|
|
180
|
-
if self._client._base_url_overridden
|
|
181
|
-
else f"https://api.gcore.com//cloud/v1/reservations/{reservation_id}",
|
|
182
|
-
options=make_request_options(
|
|
183
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
184
|
-
),
|
|
185
|
-
cast_to=BillingReservation,
|
|
98
|
+
cast_to=BillingReservations,
|
|
186
99
|
)
|
|
187
100
|
|
|
188
101
|
|
|
@@ -206,70 +119,32 @@ class AsyncBillingReservationsResource(AsyncAPIResource):
|
|
|
206
119
|
"""
|
|
207
120
|
return AsyncBillingReservationsResourceWithStreamingResponse(self)
|
|
208
121
|
|
|
209
|
-
def list(
|
|
122
|
+
async def list(
|
|
210
123
|
self,
|
|
211
124
|
*,
|
|
212
|
-
activated_from: Union[str, date] | Omit = omit,
|
|
213
|
-
activated_to: Union[str, date] | Omit = omit,
|
|
214
|
-
created_from: Union[str, datetime] | Omit = omit,
|
|
215
|
-
created_to: Union[str, datetime] | Omit = omit,
|
|
216
|
-
deactivated_from: Union[str, date] | Omit = omit,
|
|
217
|
-
deactivated_to: Union[str, date] | Omit = omit,
|
|
218
|
-
limit: int | Omit = omit,
|
|
219
125
|
metric_name: str | Omit = omit,
|
|
220
|
-
|
|
221
|
-
order_by: Literal[
|
|
222
|
-
"active_from.asc",
|
|
223
|
-
"active_from.desc",
|
|
224
|
-
"active_to.asc",
|
|
225
|
-
"active_to.desc",
|
|
226
|
-
"created_at.asc",
|
|
227
|
-
"created_at.desc",
|
|
228
|
-
]
|
|
229
|
-
| Omit = omit,
|
|
126
|
+
order_by: Literal["active_from.asc", "active_from.desc", "active_to.asc", "active_to.desc"] | Omit = omit,
|
|
230
127
|
region_id: int | Omit = omit,
|
|
231
|
-
|
|
232
|
-
Literal[
|
|
233
|
-
"ACTIVATED", "APPROVED", "COPIED", "CREATED", "EXPIRED", "REJECTED", "RESERVED", "WAITING_FOR_PAYMENT"
|
|
234
|
-
]
|
|
235
|
-
]
|
|
236
|
-
| Omit = omit,
|
|
128
|
+
show_inactive: bool | Omit = omit,
|
|
237
129
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
238
130
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
239
131
|
extra_headers: Headers | None = None,
|
|
240
132
|
extra_query: Query | None = None,
|
|
241
133
|
extra_body: Body | None = None,
|
|
242
134
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
243
|
-
) ->
|
|
135
|
+
) -> BillingReservations:
|
|
244
136
|
"""
|
|
245
|
-
|
|
137
|
+
Get a list of billing reservations along with detailed information on resource
|
|
138
|
+
configurations and associated pricing.
|
|
246
139
|
|
|
247
140
|
Args:
|
|
248
|
-
activated_from: Lower bound, starting from what date the reservation was/will be activated
|
|
249
|
-
|
|
250
|
-
activated_to: High bound, before what date the reservation was/will be activated
|
|
251
|
-
|
|
252
|
-
created_from: Lower bound the filter, showing result(s) equal to or greater than date the
|
|
253
|
-
reservation was created
|
|
254
|
-
|
|
255
|
-
created_to: High bound the filter, showing result(s) equal to or less date the reservation
|
|
256
|
-
was created
|
|
257
|
-
|
|
258
|
-
deactivated_from: Lower bound, starting from what date the reservation was/will be deactivated
|
|
259
|
-
|
|
260
|
-
deactivated_to: High bound, before what date the reservation was/will be deactivated
|
|
261
|
-
|
|
262
|
-
limit: Limit of reservation list page
|
|
263
|
-
|
|
264
141
|
metric_name: Name from billing features for specific resource
|
|
265
142
|
|
|
266
|
-
offset: Offset in reservation list
|
|
267
|
-
|
|
268
143
|
order_by: Order by field and direction.
|
|
269
144
|
|
|
270
145
|
region_id: Region for reservation
|
|
271
146
|
|
|
272
|
-
|
|
147
|
+
show_inactive: Include inactive commits in the response
|
|
273
148
|
|
|
274
149
|
extra_headers: Send extra headers
|
|
275
150
|
|
|
@@ -279,70 +154,24 @@ class AsyncBillingReservationsResource(AsyncAPIResource):
|
|
|
279
154
|
|
|
280
155
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
281
156
|
"""
|
|
282
|
-
return self.
|
|
283
|
-
"/cloud/
|
|
284
|
-
if self._client._base_url_overridden
|
|
285
|
-
else "https://api.gcore.com//cloud/v1/reservations",
|
|
286
|
-
page=AsyncOffsetPage[BillingReservation],
|
|
157
|
+
return await self._get(
|
|
158
|
+
"/cloud/v2/reservations",
|
|
287
159
|
options=make_request_options(
|
|
288
160
|
extra_headers=extra_headers,
|
|
289
161
|
extra_query=extra_query,
|
|
290
162
|
extra_body=extra_body,
|
|
291
163
|
timeout=timeout,
|
|
292
|
-
query=
|
|
164
|
+
query=await async_maybe_transform(
|
|
293
165
|
{
|
|
294
|
-
"activated_from": activated_from,
|
|
295
|
-
"activated_to": activated_to,
|
|
296
|
-
"created_from": created_from,
|
|
297
|
-
"created_to": created_to,
|
|
298
|
-
"deactivated_from": deactivated_from,
|
|
299
|
-
"deactivated_to": deactivated_to,
|
|
300
|
-
"limit": limit,
|
|
301
166
|
"metric_name": metric_name,
|
|
302
|
-
"offset": offset,
|
|
303
167
|
"order_by": order_by,
|
|
304
168
|
"region_id": region_id,
|
|
305
|
-
"
|
|
169
|
+
"show_inactive": show_inactive,
|
|
306
170
|
},
|
|
307
171
|
billing_reservation_list_params.BillingReservationListParams,
|
|
308
172
|
),
|
|
309
173
|
),
|
|
310
|
-
|
|
311
|
-
)
|
|
312
|
-
|
|
313
|
-
async def get(
|
|
314
|
-
self,
|
|
315
|
-
reservation_id: int,
|
|
316
|
-
*,
|
|
317
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
318
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
319
|
-
extra_headers: Headers | None = None,
|
|
320
|
-
extra_query: Query | None = None,
|
|
321
|
-
extra_body: Body | None = None,
|
|
322
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
323
|
-
) -> BillingReservation:
|
|
324
|
-
"""
|
|
325
|
-
Get reservation
|
|
326
|
-
|
|
327
|
-
Args:
|
|
328
|
-
reservation_id: ID of the reservation
|
|
329
|
-
|
|
330
|
-
extra_headers: Send extra headers
|
|
331
|
-
|
|
332
|
-
extra_query: Add additional query parameters to the request
|
|
333
|
-
|
|
334
|
-
extra_body: Add additional JSON properties to the request
|
|
335
|
-
|
|
336
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
337
|
-
"""
|
|
338
|
-
return await self._get(
|
|
339
|
-
f"/cloud/v1/reservations/{reservation_id}"
|
|
340
|
-
if self._client._base_url_overridden
|
|
341
|
-
else f"https://api.gcore.com//cloud/v1/reservations/{reservation_id}",
|
|
342
|
-
options=make_request_options(
|
|
343
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
344
|
-
),
|
|
345
|
-
cast_to=BillingReservation,
|
|
174
|
+
cast_to=BillingReservations,
|
|
346
175
|
)
|
|
347
176
|
|
|
348
177
|
|
|
@@ -353,9 +182,6 @@ class BillingReservationsResourceWithRawResponse:
|
|
|
353
182
|
self.list = to_raw_response_wrapper(
|
|
354
183
|
billing_reservations.list,
|
|
355
184
|
)
|
|
356
|
-
self.get = to_raw_response_wrapper(
|
|
357
|
-
billing_reservations.get,
|
|
358
|
-
)
|
|
359
185
|
|
|
360
186
|
|
|
361
187
|
class AsyncBillingReservationsResourceWithRawResponse:
|
|
@@ -365,9 +191,6 @@ class AsyncBillingReservationsResourceWithRawResponse:
|
|
|
365
191
|
self.list = async_to_raw_response_wrapper(
|
|
366
192
|
billing_reservations.list,
|
|
367
193
|
)
|
|
368
|
-
self.get = async_to_raw_response_wrapper(
|
|
369
|
-
billing_reservations.get,
|
|
370
|
-
)
|
|
371
194
|
|
|
372
195
|
|
|
373
196
|
class BillingReservationsResourceWithStreamingResponse:
|
|
@@ -377,9 +200,6 @@ class BillingReservationsResourceWithStreamingResponse:
|
|
|
377
200
|
self.list = to_streamed_response_wrapper(
|
|
378
201
|
billing_reservations.list,
|
|
379
202
|
)
|
|
380
|
-
self.get = to_streamed_response_wrapper(
|
|
381
|
-
billing_reservations.get,
|
|
382
|
-
)
|
|
383
203
|
|
|
384
204
|
|
|
385
205
|
class AsyncBillingReservationsResourceWithStreamingResponse:
|
|
@@ -389,6 +209,3 @@ class AsyncBillingReservationsResourceWithStreamingResponse:
|
|
|
389
209
|
self.list = async_to_streamed_response_wrapper(
|
|
390
210
|
billing_reservations.list,
|
|
391
211
|
)
|
|
392
|
-
self.get = async_to_streamed_response_wrapper(
|
|
393
|
-
billing_reservations.get,
|
|
394
|
-
)
|
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
|