gcore 0.16.0__py3-none-any.whl → 0.23.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/_models.py +37 -15
- gcore/_streaming.py +12 -12
- gcore/_utils/_sync.py +3 -31
- gcore/_utils/_utils.py +1 -1
- gcore/_version.py +1 -1
- gcore/resources/cdn/audit_log.py +4 -4
- gcore/resources/cdn/cdn.py +120 -21
- gcore/resources/cdn/ip_ranges.py +97 -5
- gcore/resources/cdn/{logs/logs.py → logs.py} +9 -9
- gcore/resources/cdn/resources/resources.py +20 -20
- gcore/resources/cdn/statistics.py +56 -58
- gcore/resources/cloud/__init__.py +40 -12
- gcore/resources/cloud/audit_logs.py +20 -0
- gcore/resources/cloud/baremetal/servers.py +48 -14
- gcore/resources/cloud/billing_reservations.py +2 -2
- gcore/resources/cloud/cloud.py +100 -18
- gcore/resources/cloud/databases/__init__.py +33 -0
- gcore/resources/cloud/databases/databases.py +102 -0
- gcore/resources/cloud/databases/postgres/__init__.py +61 -0
- gcore/resources/cloud/databases/postgres/clusters/__init__.py +33 -0
- gcore/resources/cloud/databases/postgres/clusters/clusters.py +716 -0
- gcore/resources/cloud/databases/postgres/clusters/user_credentials.py +281 -0
- gcore/resources/cloud/databases/postgres/configurations.py +169 -0
- gcore/resources/cloud/databases/postgres/custom_configurations.py +197 -0
- gcore/resources/cloud/databases/postgres/postgres.py +166 -0
- gcore/resources/cloud/file_shares/file_shares.py +154 -49
- gcore/resources/cloud/floating_ips.py +42 -10
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +70 -10
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +40 -6
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +16 -0
- gcore/resources/cloud/gpu_virtual_clusters/__init__.py +89 -0
- gcore/resources/cloud/gpu_virtual_clusters/flavors.py +211 -0
- gcore/resources/cloud/gpu_virtual_clusters/gpu_virtual_clusters.py +1551 -0
- gcore/resources/cloud/gpu_virtual_clusters/images.py +582 -0
- gcore/resources/cloud/gpu_virtual_clusters/interfaces.py +187 -0
- gcore/resources/cloud/gpu_virtual_clusters/servers.py +506 -0
- gcore/resources/cloud/gpu_virtual_clusters/volumes.py +187 -0
- gcore/resources/cloud/inference/deployments/deployments.py +52 -4
- gcore/resources/cloud/instances/images.py +72 -18
- gcore/resources/cloud/instances/instances.py +110 -18
- gcore/resources/cloud/instances/interfaces.py +12 -0
- gcore/resources/cloud/k8s/__init__.py +12 -12
- gcore/resources/cloud/k8s/clusters/clusters.py +25 -25
- gcore/resources/cloud/k8s/clusters/pools/pools.py +14 -14
- gcore/resources/cloud/k8s/k8s.py +24 -24
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1420 -218
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +134 -22
- gcore/resources/cloud/load_balancers/listeners.py +77 -6
- gcore/resources/cloud/load_balancers/load_balancers.py +92 -14
- gcore/resources/cloud/load_balancers/pools/pools.py +52 -4
- gcore/resources/cloud/networks/networks.py +30 -10
- gcore/resources/cloud/networks/subnets.py +26 -10
- gcore/resources/cloud/placement_groups.py +8 -0
- gcore/resources/cloud/projects.py +99 -119
- gcore/resources/cloud/quotas/requests.py +0 -8
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +18 -0
- gcore/resources/cloud/secrets.py +16 -0
- gcore/resources/cloud/security_groups/security_groups.py +38 -12
- gcore/resources/cloud/ssh_keys.py +10 -0
- gcore/resources/cloud/tasks.py +22 -7
- gcore/resources/cloud/volumes.py +65 -23
- gcore/resources/dns/zones/rrsets.py +10 -10
- gcore/resources/dns/zones/zones.py +2 -2
- gcore/resources/security/bgp_announces.py +0 -4
- gcore/resources/security/profiles.py +31 -7
- gcore/resources/storage/credentials.py +0 -28
- gcore/resources/storage/storage.py +2 -2
- gcore/types/cdn/__init__.py +5 -0
- gcore/types/cdn/alibaba_regions.py +22 -0
- gcore/types/cdn/audit_log_list_params.py +2 -2
- 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 +17 -12
- gcore/types/cdn/ip_range_list_ips_params.py +19 -0
- gcore/types/cdn/ip_range_list_params.py +19 -0
- gcore/types/cdn/resource_create_params.py +17 -12
- gcore/types/cdn/resource_purge_params.py +4 -4
- gcore/types/cdn/resource_replace_params.py +17 -12
- gcore/types/cdn/resource_update_params.py +17 -12
- gcore/types/cdn/resource_usage_stats.py +16 -15
- gcore/types/cdn/resources/cdn_resource_rule.py +15 -10
- gcore/types/cdn/resources/rule_create_params.py +15 -10
- gcore/types/cdn/resources/rule_replace_params.py +15 -10
- gcore/types/cdn/resources/rule_update_params.py +15 -10
- gcore/types/cdn/rule_template.py +15 -10
- gcore/types/cdn/rule_template_create_params.py +15 -10
- gcore/types/cdn/rule_template_replace_params.py +15 -10
- gcore/types/cdn/rule_template_update_params.py +15 -10
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +4 -1
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +5 -12
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +10 -21
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +6 -1
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +5 -2
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +3 -0
- gcore/types/cloud/__init__.py +9 -3
- gcore/types/cloud/audit_log_entry.py +9 -3
- gcore/types/cloud/audit_log_list_params.py +12 -0
- gcore/types/cloud/baremetal/server_create_params.py +7 -7
- gcore/types/cloud/baremetal_flavor.py +0 -6
- gcore/types/cloud/billing_reservation_list_params.py +1 -1
- gcore/types/cloud/blackhole_port.py +4 -1
- gcore/types/cloud/databases/postgres/__init__.py +12 -0
- gcore/types/cloud/databases/postgres/cluster_create_params.py +108 -0
- gcore/types/cloud/databases/postgres/cluster_list_params.py +19 -0
- gcore/types/cloud/databases/postgres/cluster_update_params.py +102 -0
- gcore/types/cloud/databases/postgres/clusters/__init__.py +5 -0
- gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py +13 -0
- gcore/types/cloud/databases/postgres/custom_configuration_validate_params.py +19 -0
- gcore/types/cloud/databases/postgres/pg_conf_validation.py +15 -0
- gcore/types/cloud/databases/postgres/postgres_cluster.py +118 -0
- gcore/types/cloud/databases/postgres/postgres_cluster_short.py +22 -0
- gcore/types/cloud/databases/postgres/postgres_configuration.py +31 -0
- gcore/types/cloud/file_share_create_params.py +8 -8
- gcore/types/cloud/file_share_update_params.py +7 -2
- gcore/types/cloud/floating_ip.py +5 -1
- gcore/types/cloud/floating_ip_create_params.py +4 -4
- gcore/types/cloud/floating_ip_detailed.py +5 -1
- gcore/types/cloud/floating_ip_list_params.py +8 -0
- gcore/types/cloud/floating_ip_update_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +18 -3
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +7 -2
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +16 -4
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +5 -2
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +4 -4
- gcore/types/cloud/gpu_image.py +9 -0
- gcore/types/cloud/gpu_virtual_cluster.py +189 -0
- gcore/types/cloud/gpu_virtual_cluster_action_params.py +127 -0
- gcore/types/cloud/gpu_virtual_cluster_create_params.py +213 -0
- gcore/types/cloud/gpu_virtual_cluster_delete_params.py +41 -0
- gcore/types/cloud/gpu_virtual_cluster_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_cluster_update_params.py +18 -0
- gcore/types/cloud/gpu_virtual_clusters/__init__.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/flavor_list_params.py +21 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server.py +77 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_server_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume.py +64 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_cluster_volume_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor.py +155 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_flavor_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface.py +190 -0
- gcore/types/cloud/gpu_virtual_clusters/gpu_virtual_interface_list.py +16 -0
- gcore/types/cloud/gpu_virtual_clusters/image_upload_params.py +56 -0
- gcore/types/cloud/gpu_virtual_clusters/server_delete_params.py +44 -0
- gcore/types/cloud/gpu_virtual_clusters/server_list_params.py +75 -0
- gcore/types/cloud/image.py +9 -0
- gcore/types/cloud/inference/deployment_create_params.py +1 -1
- gcore/types/cloud/inference/deployment_update_params.py +1 -1
- gcore/types/cloud/inference/inference_deployment.py +1 -1
- gcore/types/cloud/instance_create_params.py +27 -27
- gcore/types/cloud/instance_update_params.py +7 -2
- gcore/types/cloud/instances/image_create_from_volume_params.py +4 -4
- gcore/types/cloud/instances/image_update_params.py +4 -4
- gcore/types/cloud/instances/image_upload_params.py +4 -4
- gcore/types/cloud/k8s/__init__.py +4 -4
- gcore/types/cloud/k8s/cluster_update_params.py +5 -5
- gcore/types/cloud/k8s/clusters/__init__.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +2 -2
- gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster.py +4 -4
- gcore/types/cloud/k8s/k8s_cluster_certificate.py +2 -2
- gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +14 -2
- gcore/types/cloud/k8s/k8s_cluster_list.py +4 -4
- gcore/types/cloud/k8s_cluster_version.py +2 -2
- gcore/types/cloud/k8s_cluster_version_list.py +4 -4
- gcore/types/cloud/load_balancer_create_params.py +14 -8
- gcore/types/cloud/load_balancer_flavor_detail.py +2 -2
- gcore/types/cloud/load_balancer_l7_policy.py +29 -16
- gcore/types/cloud/load_balancer_l7_policy_list.py +3 -3
- gcore/types/cloud/load_balancer_l7_rule.py +14 -23
- gcore/types/cloud/load_balancer_l7_rule_list.py +3 -3
- gcore/types/cloud/load_balancer_listener_detail.py +2 -2
- gcore/types/cloud/load_balancer_update_params.py +7 -2
- gcore/types/cloud/load_balancers/__init__.py +1 -0
- gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +5 -10
- gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +7 -11
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +102 -18
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +94 -16
- gcore/types/cloud/load_balancers/listener_create_params.py +4 -1
- gcore/types/cloud/load_balancers/listener_delete_params.py +18 -0
- gcore/types/cloud/load_balancers/listener_update_params.py +4 -1
- gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
- gcore/types/cloud/network_create_params.py +4 -4
- gcore/types/cloud/network_update_params.py +7 -2
- gcore/types/cloud/networks/subnet_create_params.py +4 -4
- gcore/types/cloud/networks/subnet_update_params.py +7 -2
- gcore/types/cloud/project_create_params.py +0 -6
- gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
- gcore/types/cloud/quotas/request_create_params.py +0 -3
- gcore/types/cloud/region.py +3 -3
- gcore/types/cloud/security_group.py +8 -1
- gcore/types/cloud/security_group_create_params.py +7 -5
- gcore/types/cloud/security_group_list_params.py +6 -4
- gcore/types/cloud/security_group_update_params.py +7 -2
- gcore/types/cloud/ssh_key_list_params.py +7 -0
- gcore/types/cloud/tag.py +2 -2
- gcore/types/cloud/task_id_list.py +3 -3
- gcore/types/cloud/volume_create_params.py +12 -12
- gcore/types/cloud/volume_update_params.py +7 -2
- gcore/types/dns/zone_list_params.py +1 -1
- gcore/types/iam/api_token_create.py +70 -1
- gcore/types/security/bgp_announce_list_params.py +0 -2
- gcore/types/security/client_profile.py +1 -0
- gcore/types/security/profile_create_params.py +4 -2
- gcore/types/security/profile_recreate_params.py +4 -2
- gcore/types/security/profile_replace_params.py +4 -2
- gcore/types/storage/credential_recreate_params.py +0 -17
- gcore/types/storage/storage.py +1 -1
- gcore/types/storage/storage_create_params.py +1 -1
- gcore/types/streaming/stream.py +3 -2
- gcore/types/streaming/video.py +1 -1
- gcore/types/waap/domains/custom_rule_create_params.py +1 -1
- gcore/types/waap/domains/custom_rule_update_params.py +1 -1
- gcore/types/waap/domains/waap_custom_rule.py +1 -1
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/METADATA +14 -14
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/RECORD +219 -168
- gcore/resources/cdn/logs/__init__.py +0 -19
- /gcore/types/{cdn/logs → cloud/databases}/__init__.py +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/WHEEL +0 -0
- {gcore-0.16.0.dist-info → gcore-0.23.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -108,9 +108,10 @@ class SubnetsResource(SyncAPIResource):
|
|
|
108
108
|
|
|
109
109
|
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
110
110
|
can be associated with a resource, enabling efficient filtering and grouping for
|
|
111
|
-
better organization and management.
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
better organization and management. Both tag keys and values have a maximum
|
|
112
|
+
length of 255 characters. Some tags are read-only and cannot be modified by the
|
|
113
|
+
user. Tags are also integrated with cost reports, allowing cost data to be
|
|
114
|
+
filtered based on tag keys or values.
|
|
114
115
|
|
|
115
116
|
extra_headers: Send extra headers
|
|
116
117
|
|
|
@@ -165,6 +166,7 @@ class SubnetsResource(SyncAPIResource):
|
|
|
165
166
|
router_id_to_connect: Optional[str] | Omit = omit,
|
|
166
167
|
tags: Dict[str, str] | Omit = omit,
|
|
167
168
|
polling_interval_seconds: int | Omit = omit,
|
|
169
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
168
170
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
169
171
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
170
172
|
extra_headers: Headers | None = None,
|
|
@@ -198,6 +200,7 @@ class SubnetsResource(SyncAPIResource):
|
|
|
198
200
|
task_id=response.tasks[0],
|
|
199
201
|
extra_headers=extra_headers,
|
|
200
202
|
polling_interval_seconds=polling_interval_seconds,
|
|
203
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
201
204
|
)
|
|
202
205
|
if not task.created_resources or not task.created_resources.subnets or len(task.created_resources.subnets) != 1:
|
|
203
206
|
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
@@ -260,15 +263,20 @@ class SubnetsResource(SyncAPIResource):
|
|
|
260
263
|
- **Add/update tags:**
|
|
261
264
|
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
262
265
|
updates existing ones.
|
|
263
|
-
|
|
266
|
+
|
|
267
|
+
- **Delete tags:** `{'tags': {'old_tag': null}}` removes specific tags.
|
|
268
|
+
|
|
264
269
|
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
265
270
|
tags are preserved).
|
|
271
|
+
|
|
266
272
|
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
267
273
|
specified tags.
|
|
274
|
+
|
|
268
275
|
- **Mixed operations:**
|
|
269
|
-
`{'tags': {'environment': 'production', '
|
|
276
|
+
`{'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}}`
|
|
270
277
|
adds/updates 'environment' and '`cost_center`' while removing
|
|
271
278
|
'`deprecated_tag`', preserving other existing tags.
|
|
279
|
+
|
|
272
280
|
- **Replace all:** first delete existing tags with null values, then add new
|
|
273
281
|
ones in the same request.
|
|
274
282
|
|
|
@@ -565,9 +573,10 @@ class AsyncSubnetsResource(AsyncAPIResource):
|
|
|
565
573
|
|
|
566
574
|
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
|
|
567
575
|
can be associated with a resource, enabling efficient filtering and grouping for
|
|
568
|
-
better organization and management.
|
|
569
|
-
|
|
570
|
-
|
|
576
|
+
better organization and management. Both tag keys and values have a maximum
|
|
577
|
+
length of 255 characters. Some tags are read-only and cannot be modified by the
|
|
578
|
+
user. Tags are also integrated with cost reports, allowing cost data to be
|
|
579
|
+
filtered based on tag keys or values.
|
|
571
580
|
|
|
572
581
|
extra_headers: Send extra headers
|
|
573
582
|
|
|
@@ -622,6 +631,7 @@ class AsyncSubnetsResource(AsyncAPIResource):
|
|
|
622
631
|
router_id_to_connect: Optional[str] | Omit = omit,
|
|
623
632
|
tags: Dict[str, str] | Omit = omit,
|
|
624
633
|
polling_interval_seconds: int | Omit = omit,
|
|
634
|
+
polling_timeout_seconds: int | Omit = omit,
|
|
625
635
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
626
636
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
627
637
|
extra_headers: Headers | None = None,
|
|
@@ -655,6 +665,7 @@ class AsyncSubnetsResource(AsyncAPIResource):
|
|
|
655
665
|
task_id=response.tasks[0],
|
|
656
666
|
extra_headers=extra_headers,
|
|
657
667
|
polling_interval_seconds=polling_interval_seconds,
|
|
668
|
+
polling_timeout_seconds=polling_timeout_seconds,
|
|
658
669
|
)
|
|
659
670
|
if not task.created_resources or not task.created_resources.subnets or len(task.created_resources.subnets) != 1:
|
|
660
671
|
raise ValueError(f"Expected exactly one resource to be created in a task")
|
|
@@ -717,15 +728,20 @@ class AsyncSubnetsResource(AsyncAPIResource):
|
|
|
717
728
|
- **Add/update tags:**
|
|
718
729
|
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
719
730
|
updates existing ones.
|
|
720
|
-
|
|
731
|
+
|
|
732
|
+
- **Delete tags:** `{'tags': {'old_tag': null}}` removes specific tags.
|
|
733
|
+
|
|
721
734
|
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
722
735
|
tags are preserved).
|
|
736
|
+
|
|
723
737
|
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
724
738
|
specified tags.
|
|
739
|
+
|
|
725
740
|
- **Mixed operations:**
|
|
726
|
-
`{'tags': {'environment': 'production', '
|
|
741
|
+
`{'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}}`
|
|
727
742
|
adds/updates 'environment' and '`cost_center`' while removing
|
|
728
743
|
'`deprecated_tag`', preserving other existing tags.
|
|
744
|
+
|
|
729
745
|
- **Replace all:** first delete existing tags with null values, then add new
|
|
730
746
|
ones in the same request.
|
|
731
747
|
|
|
@@ -26,6 +26,10 @@ __all__ = ["PlacementGroupsResource", "AsyncPlacementGroupsResource"]
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class PlacementGroupsResource(SyncAPIResource):
|
|
29
|
+
"""
|
|
30
|
+
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.
|
|
31
|
+
"""
|
|
32
|
+
|
|
29
33
|
@cached_property
|
|
30
34
|
def with_raw_response(self) -> PlacementGroupsResourceWithRawResponse:
|
|
31
35
|
"""
|
|
@@ -210,6 +214,10 @@ class PlacementGroupsResource(SyncAPIResource):
|
|
|
210
214
|
|
|
211
215
|
|
|
212
216
|
class AsyncPlacementGroupsResource(AsyncAPIResource):
|
|
217
|
+
"""
|
|
218
|
+
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.
|
|
219
|
+
"""
|
|
220
|
+
|
|
213
221
|
@cached_property
|
|
214
222
|
def with_raw_response(self) -> AsyncPlacementGroupsResourceWithRawResponse:
|
|
215
223
|
"""
|
|
@@ -18,7 +18,7 @@ from ..._response import (
|
|
|
18
18
|
async_to_streamed_response_wrapper,
|
|
19
19
|
)
|
|
20
20
|
from ...pagination import SyncOffsetPage, AsyncOffsetPage
|
|
21
|
-
from ...types.cloud import project_list_params, project_create_params,
|
|
21
|
+
from ...types.cloud import project_list_params, project_create_params, project_update_params
|
|
22
22
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
23
23
|
from ...types.cloud.project import Project
|
|
24
24
|
from ...types.cloud.task_id_list import TaskIDList
|
|
@@ -50,9 +50,7 @@ class ProjectsResource(SyncAPIResource):
|
|
|
50
50
|
self,
|
|
51
51
|
*,
|
|
52
52
|
name: str,
|
|
53
|
-
client_id: Optional[int] | Omit = omit,
|
|
54
53
|
description: Optional[str] | Omit = omit,
|
|
55
|
-
state: Optional[str] | Omit = omit,
|
|
56
54
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
55
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
58
56
|
extra_headers: Headers | None = None,
|
|
@@ -68,12 +66,8 @@ class ProjectsResource(SyncAPIResource):
|
|
|
68
66
|
Args:
|
|
69
67
|
name: Unique project name for a client. Each client always has one "default" project.
|
|
70
68
|
|
|
71
|
-
client_id: ID associated with the client.
|
|
72
|
-
|
|
73
69
|
description: Description of the project.
|
|
74
70
|
|
|
75
|
-
state: State of the project.
|
|
76
|
-
|
|
77
71
|
extra_headers: Send extra headers
|
|
78
72
|
|
|
79
73
|
extra_query: Add additional query parameters to the request
|
|
@@ -87,9 +81,7 @@ class ProjectsResource(SyncAPIResource):
|
|
|
87
81
|
body=maybe_transform(
|
|
88
82
|
{
|
|
89
83
|
"name": name,
|
|
90
|
-
"client_id": client_id,
|
|
91
84
|
"description": description,
|
|
92
|
-
"state": state,
|
|
93
85
|
},
|
|
94
86
|
project_create_params.ProjectCreateParams,
|
|
95
87
|
),
|
|
@@ -99,6 +91,52 @@ class ProjectsResource(SyncAPIResource):
|
|
|
99
91
|
cast_to=Project,
|
|
100
92
|
)
|
|
101
93
|
|
|
94
|
+
def update(
|
|
95
|
+
self,
|
|
96
|
+
*,
|
|
97
|
+
project_id: int | None = None,
|
|
98
|
+
name: str,
|
|
99
|
+
description: Optional[str] | Omit = omit,
|
|
100
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
101
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
102
|
+
extra_headers: Headers | None = None,
|
|
103
|
+
extra_query: Query | None = None,
|
|
104
|
+
extra_body: Body | None = None,
|
|
105
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
106
|
+
) -> Project:
|
|
107
|
+
"""
|
|
108
|
+
Update project name and description.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
name: Name of the entity, following a specific format.
|
|
112
|
+
|
|
113
|
+
description: Description of the project.
|
|
114
|
+
|
|
115
|
+
extra_headers: Send extra headers
|
|
116
|
+
|
|
117
|
+
extra_query: Add additional query parameters to the request
|
|
118
|
+
|
|
119
|
+
extra_body: Add additional JSON properties to the request
|
|
120
|
+
|
|
121
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
122
|
+
"""
|
|
123
|
+
if project_id is None:
|
|
124
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
125
|
+
return self._put(
|
|
126
|
+
f"/cloud/v1/projects/{project_id}",
|
|
127
|
+
body=maybe_transform(
|
|
128
|
+
{
|
|
129
|
+
"name": name,
|
|
130
|
+
"description": description,
|
|
131
|
+
},
|
|
132
|
+
project_update_params.ProjectUpdateParams,
|
|
133
|
+
),
|
|
134
|
+
options=make_request_options(
|
|
135
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
136
|
+
),
|
|
137
|
+
cast_to=Project,
|
|
138
|
+
)
|
|
139
|
+
|
|
102
140
|
def list(
|
|
103
141
|
self,
|
|
104
142
|
*,
|
|
@@ -233,10 +271,30 @@ class ProjectsResource(SyncAPIResource):
|
|
|
233
271
|
cast_to=Project,
|
|
234
272
|
)
|
|
235
273
|
|
|
236
|
-
|
|
274
|
+
|
|
275
|
+
class AsyncProjectsResource(AsyncAPIResource):
|
|
276
|
+
@cached_property
|
|
277
|
+
def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse:
|
|
278
|
+
"""
|
|
279
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
280
|
+
the raw response object instead of the parsed content.
|
|
281
|
+
|
|
282
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
283
|
+
"""
|
|
284
|
+
return AsyncProjectsResourceWithRawResponse(self)
|
|
285
|
+
|
|
286
|
+
@cached_property
|
|
287
|
+
def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse:
|
|
288
|
+
"""
|
|
289
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
290
|
+
|
|
291
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
292
|
+
"""
|
|
293
|
+
return AsyncProjectsResourceWithStreamingResponse(self)
|
|
294
|
+
|
|
295
|
+
async def create(
|
|
237
296
|
self,
|
|
238
297
|
*,
|
|
239
|
-
project_id: int | None = None,
|
|
240
298
|
name: str,
|
|
241
299
|
description: Optional[str] | Omit = omit,
|
|
242
300
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -246,13 +304,13 @@ class ProjectsResource(SyncAPIResource):
|
|
|
246
304
|
extra_body: Body | None = None,
|
|
247
305
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
248
306
|
) -> Project:
|
|
249
|
-
"""
|
|
307
|
+
"""Create a new project for a client.
|
|
250
308
|
|
|
251
|
-
Project management must be enabled to
|
|
252
|
-
|
|
309
|
+
Project management must be enabled to perform
|
|
310
|
+
this operation.
|
|
253
311
|
|
|
254
312
|
Args:
|
|
255
|
-
name:
|
|
313
|
+
name: Unique project name for a client. Each client always has one "default" project.
|
|
256
314
|
|
|
257
315
|
description: Description of the project.
|
|
258
316
|
|
|
@@ -264,16 +322,14 @@ class ProjectsResource(SyncAPIResource):
|
|
|
264
322
|
|
|
265
323
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
266
324
|
"""
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
f"/cloud/v1/projects/{project_id}",
|
|
271
|
-
body=maybe_transform(
|
|
325
|
+
return await self._post(
|
|
326
|
+
"/cloud/v1/projects",
|
|
327
|
+
body=await async_maybe_transform(
|
|
272
328
|
{
|
|
273
329
|
"name": name,
|
|
274
330
|
"description": description,
|
|
275
331
|
},
|
|
276
|
-
|
|
332
|
+
project_create_params.ProjectCreateParams,
|
|
277
333
|
),
|
|
278
334
|
options=make_request_options(
|
|
279
335
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -281,34 +337,12 @@ class ProjectsResource(SyncAPIResource):
|
|
|
281
337
|
cast_to=Project,
|
|
282
338
|
)
|
|
283
339
|
|
|
284
|
-
|
|
285
|
-
class AsyncProjectsResource(AsyncAPIResource):
|
|
286
|
-
@cached_property
|
|
287
|
-
def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse:
|
|
288
|
-
"""
|
|
289
|
-
This property can be used as a prefix for any HTTP method call to return
|
|
290
|
-
the raw response object instead of the parsed content.
|
|
291
|
-
|
|
292
|
-
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
293
|
-
"""
|
|
294
|
-
return AsyncProjectsResourceWithRawResponse(self)
|
|
295
|
-
|
|
296
|
-
@cached_property
|
|
297
|
-
def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse:
|
|
298
|
-
"""
|
|
299
|
-
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
300
|
-
|
|
301
|
-
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
302
|
-
"""
|
|
303
|
-
return AsyncProjectsResourceWithStreamingResponse(self)
|
|
304
|
-
|
|
305
|
-
async def create(
|
|
340
|
+
async def update(
|
|
306
341
|
self,
|
|
307
342
|
*,
|
|
343
|
+
project_id: int | None = None,
|
|
308
344
|
name: str,
|
|
309
|
-
client_id: Optional[int] | Omit = omit,
|
|
310
345
|
description: Optional[str] | Omit = omit,
|
|
311
|
-
state: Optional[str] | Omit = omit,
|
|
312
346
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
313
347
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
314
348
|
extra_headers: Headers | None = None,
|
|
@@ -316,20 +350,14 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|
|
316
350
|
extra_body: Body | None = None,
|
|
317
351
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
318
352
|
) -> Project:
|
|
319
|
-
"""
|
|
320
|
-
|
|
321
|
-
Project management must be enabled to perform
|
|
322
|
-
this operation.
|
|
353
|
+
"""
|
|
354
|
+
Update project name and description.
|
|
323
355
|
|
|
324
356
|
Args:
|
|
325
|
-
name:
|
|
326
|
-
|
|
327
|
-
client_id: ID associated with the client.
|
|
357
|
+
name: Name of the entity, following a specific format.
|
|
328
358
|
|
|
329
359
|
description: Description of the project.
|
|
330
360
|
|
|
331
|
-
state: State of the project.
|
|
332
|
-
|
|
333
361
|
extra_headers: Send extra headers
|
|
334
362
|
|
|
335
363
|
extra_query: Add additional query parameters to the request
|
|
@@ -338,16 +366,16 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|
|
338
366
|
|
|
339
367
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
340
368
|
"""
|
|
341
|
-
|
|
342
|
-
|
|
369
|
+
if project_id is None:
|
|
370
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
371
|
+
return await self._put(
|
|
372
|
+
f"/cloud/v1/projects/{project_id}",
|
|
343
373
|
body=await async_maybe_transform(
|
|
344
374
|
{
|
|
345
375
|
"name": name,
|
|
346
|
-
"client_id": client_id,
|
|
347
376
|
"description": description,
|
|
348
|
-
"state": state,
|
|
349
377
|
},
|
|
350
|
-
|
|
378
|
+
project_update_params.ProjectUpdateParams,
|
|
351
379
|
),
|
|
352
380
|
options=make_request_options(
|
|
353
381
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -489,54 +517,6 @@ class AsyncProjectsResource(AsyncAPIResource):
|
|
|
489
517
|
cast_to=Project,
|
|
490
518
|
)
|
|
491
519
|
|
|
492
|
-
async def replace(
|
|
493
|
-
self,
|
|
494
|
-
*,
|
|
495
|
-
project_id: int | None = None,
|
|
496
|
-
name: str,
|
|
497
|
-
description: Optional[str] | Omit = omit,
|
|
498
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
499
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
500
|
-
extra_headers: Headers | None = None,
|
|
501
|
-
extra_query: Query | None = None,
|
|
502
|
-
extra_body: Body | None = None,
|
|
503
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
504
|
-
) -> Project:
|
|
505
|
-
"""Update project name and description.
|
|
506
|
-
|
|
507
|
-
Project management must be enabled to
|
|
508
|
-
perform this operation.
|
|
509
|
-
|
|
510
|
-
Args:
|
|
511
|
-
name: Name of the entity, following a specific format.
|
|
512
|
-
|
|
513
|
-
description: Description of the project.
|
|
514
|
-
|
|
515
|
-
extra_headers: Send extra headers
|
|
516
|
-
|
|
517
|
-
extra_query: Add additional query parameters to the request
|
|
518
|
-
|
|
519
|
-
extra_body: Add additional JSON properties to the request
|
|
520
|
-
|
|
521
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
522
|
-
"""
|
|
523
|
-
if project_id is None:
|
|
524
|
-
project_id = self._client._get_cloud_project_id_path_param()
|
|
525
|
-
return await self._put(
|
|
526
|
-
f"/cloud/v1/projects/{project_id}",
|
|
527
|
-
body=await async_maybe_transform(
|
|
528
|
-
{
|
|
529
|
-
"name": name,
|
|
530
|
-
"description": description,
|
|
531
|
-
},
|
|
532
|
-
project_replace_params.ProjectReplaceParams,
|
|
533
|
-
),
|
|
534
|
-
options=make_request_options(
|
|
535
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
536
|
-
),
|
|
537
|
-
cast_to=Project,
|
|
538
|
-
)
|
|
539
|
-
|
|
540
520
|
|
|
541
521
|
class ProjectsResourceWithRawResponse:
|
|
542
522
|
def __init__(self, projects: ProjectsResource) -> None:
|
|
@@ -545,6 +525,9 @@ class ProjectsResourceWithRawResponse:
|
|
|
545
525
|
self.create = to_raw_response_wrapper(
|
|
546
526
|
projects.create,
|
|
547
527
|
)
|
|
528
|
+
self.update = to_raw_response_wrapper(
|
|
529
|
+
projects.update,
|
|
530
|
+
)
|
|
548
531
|
self.list = to_raw_response_wrapper(
|
|
549
532
|
projects.list,
|
|
550
533
|
)
|
|
@@ -554,9 +537,6 @@ class ProjectsResourceWithRawResponse:
|
|
|
554
537
|
self.get = to_raw_response_wrapper(
|
|
555
538
|
projects.get,
|
|
556
539
|
)
|
|
557
|
-
self.replace = to_raw_response_wrapper(
|
|
558
|
-
projects.replace,
|
|
559
|
-
)
|
|
560
540
|
|
|
561
541
|
|
|
562
542
|
class AsyncProjectsResourceWithRawResponse:
|
|
@@ -566,6 +546,9 @@ class AsyncProjectsResourceWithRawResponse:
|
|
|
566
546
|
self.create = async_to_raw_response_wrapper(
|
|
567
547
|
projects.create,
|
|
568
548
|
)
|
|
549
|
+
self.update = async_to_raw_response_wrapper(
|
|
550
|
+
projects.update,
|
|
551
|
+
)
|
|
569
552
|
self.list = async_to_raw_response_wrapper(
|
|
570
553
|
projects.list,
|
|
571
554
|
)
|
|
@@ -575,9 +558,6 @@ class AsyncProjectsResourceWithRawResponse:
|
|
|
575
558
|
self.get = async_to_raw_response_wrapper(
|
|
576
559
|
projects.get,
|
|
577
560
|
)
|
|
578
|
-
self.replace = async_to_raw_response_wrapper(
|
|
579
|
-
projects.replace,
|
|
580
|
-
)
|
|
581
561
|
|
|
582
562
|
|
|
583
563
|
class ProjectsResourceWithStreamingResponse:
|
|
@@ -587,6 +567,9 @@ class ProjectsResourceWithStreamingResponse:
|
|
|
587
567
|
self.create = to_streamed_response_wrapper(
|
|
588
568
|
projects.create,
|
|
589
569
|
)
|
|
570
|
+
self.update = to_streamed_response_wrapper(
|
|
571
|
+
projects.update,
|
|
572
|
+
)
|
|
590
573
|
self.list = to_streamed_response_wrapper(
|
|
591
574
|
projects.list,
|
|
592
575
|
)
|
|
@@ -596,9 +579,6 @@ class ProjectsResourceWithStreamingResponse:
|
|
|
596
579
|
self.get = to_streamed_response_wrapper(
|
|
597
580
|
projects.get,
|
|
598
581
|
)
|
|
599
|
-
self.replace = to_streamed_response_wrapper(
|
|
600
|
-
projects.replace,
|
|
601
|
-
)
|
|
602
582
|
|
|
603
583
|
|
|
604
584
|
class AsyncProjectsResourceWithStreamingResponse:
|
|
@@ -608,6 +588,9 @@ class AsyncProjectsResourceWithStreamingResponse:
|
|
|
608
588
|
self.create = async_to_streamed_response_wrapper(
|
|
609
589
|
projects.create,
|
|
610
590
|
)
|
|
591
|
+
self.update = async_to_streamed_response_wrapper(
|
|
592
|
+
projects.update,
|
|
593
|
+
)
|
|
611
594
|
self.list = async_to_streamed_response_wrapper(
|
|
612
595
|
projects.list,
|
|
613
596
|
)
|
|
@@ -617,6 +600,3 @@ class AsyncProjectsResourceWithStreamingResponse:
|
|
|
617
600
|
self.get = async_to_streamed_response_wrapper(
|
|
618
601
|
projects.get,
|
|
619
602
|
)
|
|
620
|
-
self.replace = async_to_streamed_response_wrapper(
|
|
621
|
-
projects.replace,
|
|
622
|
-
)
|
|
@@ -51,7 +51,6 @@ class RequestsResource(SyncAPIResource):
|
|
|
51
51
|
*,
|
|
52
52
|
description: str,
|
|
53
53
|
requested_limits: request_create_params.RequestedLimits,
|
|
54
|
-
client_id: int | Omit = omit,
|
|
55
54
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
56
55
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
57
56
|
extra_headers: Headers | None = None,
|
|
@@ -67,8 +66,6 @@ class RequestsResource(SyncAPIResource):
|
|
|
67
66
|
|
|
68
67
|
requested_limits: Limits you want to increase.
|
|
69
68
|
|
|
70
|
-
client_id: Client ID that requests the limit increase.
|
|
71
|
-
|
|
72
69
|
extra_headers: Send extra headers
|
|
73
70
|
|
|
74
71
|
extra_query: Add additional query parameters to the request
|
|
@@ -84,7 +81,6 @@ class RequestsResource(SyncAPIResource):
|
|
|
84
81
|
{
|
|
85
82
|
"description": description,
|
|
86
83
|
"requested_limits": requested_limits,
|
|
87
|
-
"client_id": client_id,
|
|
88
84
|
},
|
|
89
85
|
request_create_params.RequestCreateParams,
|
|
90
86
|
),
|
|
@@ -239,7 +235,6 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
239
235
|
*,
|
|
240
236
|
description: str,
|
|
241
237
|
requested_limits: request_create_params.RequestedLimits,
|
|
242
|
-
client_id: int | Omit = omit,
|
|
243
238
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
244
239
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
245
240
|
extra_headers: Headers | None = None,
|
|
@@ -255,8 +250,6 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
255
250
|
|
|
256
251
|
requested_limits: Limits you want to increase.
|
|
257
252
|
|
|
258
|
-
client_id: Client ID that requests the limit increase.
|
|
259
|
-
|
|
260
253
|
extra_headers: Send extra headers
|
|
261
254
|
|
|
262
255
|
extra_query: Add additional query parameters to the request
|
|
@@ -272,7 +265,6 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
272
265
|
{
|
|
273
266
|
"description": description,
|
|
274
267
|
"requested_limits": requested_limits,
|
|
275
|
-
"client_id": client_id,
|
|
276
268
|
},
|
|
277
269
|
request_create_params.RequestCreateParams,
|
|
278
270
|
),
|