gcore 0.1.0a2__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +5 -0
- gcore/_base_client.py +22 -2
- gcore/_client.py +9 -0
- gcore/_models.py +2 -0
- gcore/_types.py +2 -0
- gcore/_utils/_proxy.py +4 -1
- gcore/_utils/_resources_proxy.py +24 -0
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/baremetal/flavors.py +2 -2
- gcore/resources/cloud/baremetal/images.py +2 -2
- gcore/resources/cloud/baremetal/servers.py +280 -52
- gcore/resources/cloud/billing_reservations.py +24 -0
- gcore/resources/cloud/file_shares/file_shares.py +16 -0
- gcore/resources/cloud/floating_ips.py +4 -4
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +358 -8
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +206 -2
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +84 -4
- gcore/resources/cloud/inference/deployments/deployments.py +328 -10
- gcore/resources/cloud/instances/flavors.py +2 -2
- gcore/resources/cloud/instances/images.py +318 -2
- gcore/resources/cloud/instances/instances.py +534 -70
- gcore/resources/cloud/instances/interfaces.py +4 -4
- gcore/resources/cloud/load_balancers/flavors.py +2 -2
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +302 -20
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +326 -0
- gcore/resources/cloud/load_balancers/listeners.py +385 -20
- gcore/resources/cloud/load_balancers/load_balancers.py +392 -24
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +24 -0
- gcore/resources/cloud/load_balancers/pools/members.py +34 -6
- gcore/resources/cloud/load_balancers/pools/pools.py +388 -8
- gcore/resources/cloud/networks/networks.py +72 -16
- gcore/resources/cloud/networks/subnets.py +6 -6
- gcore/resources/cloud/registries/registries.py +6 -10
- gcore/resources/cloud/registries/users.py +4 -10
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +10 -10
- gcore/resources/cloud/secrets.py +56 -11
- gcore/resources/cloud/security_groups/security_groups.py +2 -2
- gcore/resources/cloud/ssh_keys.py +2 -2
- gcore/resources/cloud/tasks.py +203 -184
- gcore/resources/cloud/users/role_assignments.py +4 -4
- gcore/resources/cloud/volumes.py +18 -18
- gcore/resources/waap/__init__.py +131 -0
- gcore/resources/waap/advanced_rules.py +135 -0
- gcore/resources/waap/clients.py +135 -0
- gcore/resources/waap/custom_page_sets.py +805 -0
- gcore/resources/waap/domains/__init__.py +173 -0
- gcore/resources/waap/domains/advanced_rules.py +876 -0
- gcore/resources/waap/domains/analytics/__init__.py +33 -0
- gcore/resources/waap/domains/analytics/analytics.py +676 -0
- gcore/resources/waap/domains/analytics/requests.py +378 -0
- gcore/resources/waap/domains/api_discovery/__init__.py +33 -0
- gcore/resources/waap/domains/api_discovery/api_discovery.py +530 -0
- gcore/resources/waap/domains/api_discovery/scan_results.py +352 -0
- gcore/resources/waap/domains/api_path_groups.py +163 -0
- gcore/resources/waap/domains/api_paths.py +771 -0
- gcore/resources/waap/domains/custom_rules.py +889 -0
- gcore/resources/waap/domains/domains.py +914 -0
- gcore/resources/waap/domains/firewall_rules.py +884 -0
- gcore/resources/waap/domains/insight_silences.py +689 -0
- gcore/resources/waap/domains/insights.py +425 -0
- gcore/resources/waap/domains/policies.py +173 -0
- gcore/resources/waap/domains/settings.py +271 -0
- gcore/resources/waap/ip_info.py +1017 -0
- gcore/resources/waap/organizations.py +217 -0
- gcore/resources/waap/statistics.py +225 -0
- gcore/resources/waap/tags.py +233 -0
- gcore/resources/waap/waap.py +391 -0
- gcore/types/cloud/__init__.py +1 -0
- gcore/types/cloud/allowed_address_pairs.py +2 -2
- gcore/types/cloud/baremetal/baremetal_server.py +1 -1
- gcore/types/cloud/baremetal/image_list_params.py +1 -1
- gcore/types/cloud/baremetal/server_create_params.py +9 -9
- gcore/types/cloud/baremetal/server_list_params.py +8 -8
- gcore/types/cloud/baremetal/server_rebuild_params.py +1 -1
- gcore/types/cloud/baremetal_flavor.py +3 -3
- gcore/types/cloud/billing_reservation_list_params.py +5 -0
- gcore/types/cloud/container_probe_config.py +1 -1
- gcore/types/cloud/container_probe_config_create_param.py +2 -3
- gcore/types/cloud/container_scale_triggers.py +2 -2
- gcore/types/cloud/file_share.py +3 -0
- gcore/types/cloud/file_share_list_params.py +7 -1
- gcore/types/cloud/floating_ip_detailed.py +1 -1
- gcore/types/cloud/floating_ip_list_params.py +2 -2
- gcore/types/cloud/gpu_baremetal_cluster.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +21 -1
- gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +1 -1
- gcore/types/cloud/gpu_baremetal_cluster_server.py +1 -1
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +1 -1
- gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +10 -10
- gcore/types/cloud/gpu_baremetal_flavor.py +3 -3
- gcore/types/cloud/image.py +1 -1
- gcore/types/cloud/inference/deployment_create_params.py +4 -4
- gcore/types/cloud/inference/deployment_update_params.py +206 -9
- gcore/types/cloud/inference/inference.py +5 -5
- gcore/types/cloud/instance.py +1 -1
- gcore/types/cloud/instance_create_params.py +8 -10
- gcore/types/cloud/instance_list_params.py +8 -8
- gcore/types/cloud/instances/flavor_list_suitable_params.py +4 -1
- gcore/types/cloud/instances/image_list_params.py +1 -1
- gcore/types/cloud/instances/instance_flavor.py +3 -3
- gcore/types/cloud/instances/interface_attach_params.py +10 -10
- gcore/types/cloud/load_balancer_create_params.py +17 -15
- gcore/types/cloud/load_balancer_flavor_detail.py +3 -3
- gcore/types/cloud/load_balancer_l7_policy.py +5 -5
- gcore/types/cloud/load_balancer_list_params.py +5 -5
- gcore/types/cloud/load_balancer_listener_detail.py +17 -17
- gcore/types/cloud/load_balancer_pool.py +13 -13
- gcore/types/cloud/load_balancer_pool_list.py +99 -4
- gcore/types/cloud/load_balancers/l7_policy_create_params.py +5 -5
- gcore/types/cloud/load_balancers/l7_policy_replace_params.py +5 -5
- gcore/types/cloud/load_balancers/listener_create_params.py +6 -4
- gcore/types/cloud/load_balancers/listener_get_params.py +3 -1
- gcore/types/cloud/load_balancers/listener_list_params.py +4 -2
- gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +6 -4
- gcore/types/cloud/load_balancers/pool_list_params.py +5 -6
- gcore/types/cloud/load_balancers/pool_update_params.py +6 -4
- gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +2 -0
- gcore/types/cloud/load_balancers/pools/member_add_params.py +5 -3
- gcore/types/cloud/member.py +2 -2
- gcore/types/cloud/network.py +22 -22
- gcore/types/cloud/network_create_params.py +2 -0
- gcore/types/cloud/network_details.py +25 -24
- gcore/types/cloud/network_list_params.py +15 -10
- gcore/types/cloud/network_update_params.py +2 -0
- gcore/types/cloud/networks/subnet_create_params.py +1 -1
- gcore/types/cloud/networks/subnet_list_params.py +2 -2
- gcore/types/cloud/quota_get_all_response.py +18 -0
- gcore/types/cloud/quota_get_by_region_response.py +18 -0
- gcore/types/cloud/quotas/request_create_params.py +9 -0
- gcore/types/cloud/quotas/request_get_response.py +9 -0
- gcore/types/cloud/quotas/request_list_response.py +9 -0
- gcore/types/cloud/region.py +4 -4
- gcore/types/cloud/registries/user_create_multiple_params.py +3 -5
- gcore/types/cloud/registries/user_create_params.py +3 -5
- gcore/types/cloud/registry_create_params.py +3 -5
- gcore/types/cloud/reserved_fixed_ip_create_params.py +2 -2
- gcore/types/cloud/reserved_fixed_ip_list_params.py +3 -3
- gcore/types/cloud/secret_list_params.py +24 -0
- gcore/types/cloud/security_group_list_params.py +1 -1
- gcore/types/cloud/session_persistence.py +1 -1
- gcore/types/cloud/ssh_key_created.py +3 -6
- gcore/types/cloud/task.py +1 -4
- gcore/types/cloud/task_list_params.py +56 -46
- gcore/types/cloud/users/role_assignment_create_params.py +1 -1
- gcore/types/cloud/users/role_assignment_update_params.py +1 -1
- gcore/types/cloud/volume_create_params.py +6 -6
- gcore/types/cloud/volume_list_params.py +3 -3
- gcore/types/waap/__init__.py +108 -0
- gcore/types/waap/client_me_response.py +34 -0
- gcore/types/waap/custom_page_set_create_params.py +35 -0
- gcore/types/waap/custom_page_set_list_params.py +25 -0
- gcore/types/waap/custom_page_set_preview_params.py +34 -0
- gcore/types/waap/custom_page_set_update_params.py +35 -0
- gcore/types/waap/domain_list_params.py +30 -0
- gcore/types/waap/domain_list_rule_sets_response.py +10 -0
- gcore/types/waap/domain_update_params.py +12 -0
- gcore/types/waap/domains/__init__.py +47 -0
- gcore/types/waap/domains/advanced_rule_create_params.py +80 -0
- gcore/types/waap/domains/advanced_rule_list_params.py +58 -0
- gcore/types/waap/domains/advanced_rule_update_params.py +83 -0
- gcore/types/waap/domains/analytics/__init__.py +5 -0
- gcore/types/waap/domains/analytics/request_list_params.py +53 -0
- gcore/types/waap/domains/analytics_get_event_statistics_params.py +34 -0
- gcore/types/waap/domains/analytics_list_ddos_attacks_params.py +28 -0
- gcore/types/waap/domains/analytics_list_ddos_info_params.py +31 -0
- gcore/types/waap/domains/analytics_list_event_traffic_params.py +26 -0
- gcore/types/waap/domains/analytics_list_event_traffic_response.py +10 -0
- gcore/types/waap/domains/api_discovery/__init__.py +7 -0
- gcore/types/waap/domains/api_discovery/scan_result_get_response.py +29 -0
- gcore/types/waap/domains/api_discovery/scan_result_list_params.py +41 -0
- gcore/types/waap/domains/api_discovery/scan_result_list_response.py +29 -0
- gcore/types/waap/domains/api_discovery_get_settings_response.py +36 -0
- gcore/types/waap/domains/api_discovery_scan_openapi_response.py +10 -0
- gcore/types/waap/domains/api_discovery_update_settings_params.py +34 -0
- gcore/types/waap/domains/api_discovery_update_settings_response.py +36 -0
- gcore/types/waap/domains/api_discovery_upload_openapi_params.py +19 -0
- gcore/types/waap/domains/api_discovery_upload_openapi_response.py +10 -0
- gcore/types/waap/domains/api_path_create_params.py +31 -0
- gcore/types/waap/domains/api_path_create_response.py +50 -0
- gcore/types/waap/domains/api_path_get_response.py +50 -0
- gcore/types/waap/domains/api_path_group_list_response.py +12 -0
- gcore/types/waap/domains/api_path_list_params.py +62 -0
- gcore/types/waap/domains/api_path_list_response.py +50 -0
- gcore/types/waap/domains/api_path_update_params.py +29 -0
- gcore/types/waap/domains/custom_rule_create_params.py +368 -0
- gcore/types/waap/domains/custom_rule_delete_multiple_params.py +13 -0
- gcore/types/waap/domains/custom_rule_list_params.py +35 -0
- gcore/types/waap/domains/custom_rule_update_params.py +371 -0
- gcore/types/waap/domains/firewall_rule_create_params.py +75 -0
- gcore/types/waap/domains/firewall_rule_delete_multiple_params.py +13 -0
- gcore/types/waap/domains/firewall_rule_list_params.py +33 -0
- gcore/types/waap/domains/firewall_rule_update_params.py +78 -0
- gcore/types/waap/domains/insight_list_params.py +34 -0
- gcore/types/waap/domains/insight_replace_params.py +17 -0
- gcore/types/waap/domains/insight_silence_create_params.py +28 -0
- gcore/types/waap/domains/insight_silence_list_params.py +33 -0
- gcore/types/waap/domains/insight_silence_update_params.py +28 -0
- gcore/types/waap/domains/setting_update_params.py +48 -0
- gcore/types/waap/ip_info_get_attack_time_series_params.py +12 -0
- gcore/types/waap/ip_info_get_attack_time_series_response.py +10 -0
- gcore/types/waap/ip_info_get_blocked_requests_params.py +15 -0
- gcore/types/waap/ip_info_get_blocked_requests_response.py +10 -0
- gcore/types/waap/ip_info_get_counts_params.py +19 -0
- gcore/types/waap/ip_info_get_ddos_attack_series_params.py +12 -0
- gcore/types/waap/ip_info_get_params.py +12 -0
- gcore/types/waap/ip_info_get_top_sessions_params.py +15 -0
- gcore/types/waap/ip_info_get_top_sessions_response.py +10 -0
- gcore/types/waap/ip_info_get_top_urls_params.py +15 -0
- gcore/types/waap/ip_info_get_top_urls_response.py +10 -0
- gcore/types/waap/ip_info_get_top_user_agents_params.py +15 -0
- gcore/types/waap/ip_info_get_top_user_agents_response.py +10 -0
- gcore/types/waap/ip_info_list_attacked_countries_params.py +12 -0
- gcore/types/waap/ip_info_list_attacked_countries_response.py +10 -0
- gcore/types/waap/organization_list_params.py +22 -0
- gcore/types/waap/statistic_get_usage_series_params.py +25 -0
- gcore/types/waap/tag_list_params.py +28 -0
- gcore/types/waap/waap_advanced_rule.py +83 -0
- gcore/types/waap/waap_advanced_rule_descriptor.py +49 -0
- gcore/types/waap/waap_advanced_rule_descriptor_list.py +15 -0
- gcore/types/waap/waap_block_csrf_page_data.py +28 -0
- gcore/types/waap/waap_block_csrf_page_data_param.py +28 -0
- gcore/types/waap/waap_block_page_data.py +28 -0
- gcore/types/waap/waap_block_page_data_param.py +28 -0
- gcore/types/waap/waap_blocked_statistics.py +36 -0
- gcore/types/waap/waap_captcha_page_data.py +31 -0
- gcore/types/waap/waap_captcha_page_data_param.py +31 -0
- gcore/types/waap/waap_common_tag.py +16 -0
- gcore/types/waap/waap_cookie_disabled_page_data.py +18 -0
- gcore/types/waap/waap_cookie_disabled_page_data_param.py +18 -0
- gcore/types/waap/waap_count_statistics.py +36 -0
- gcore/types/waap/waap_custom_page_preview.py +10 -0
- gcore/types/waap/waap_custom_page_set.py +36 -0
- gcore/types/waap/waap_custom_rule.py +373 -0
- gcore/types/waap/waap_customer_rule_state.py +7 -0
- gcore/types/waap/waap_ddos_attack.py +16 -0
- gcore/types/waap/waap_ddos_info.py +17 -0
- gcore/types/waap/waap_detailed_domain.py +37 -0
- gcore/types/waap/waap_domain_api_settings.py +22 -0
- gcore/types/waap/waap_domain_ddos_settings.py +31 -0
- gcore/types/waap/waap_domain_policy.py +29 -0
- gcore/types/waap/waap_domain_settings_model.py +15 -0
- gcore/types/waap/waap_domain_status.py +7 -0
- gcore/types/waap/waap_event_statistics.py +15 -0
- gcore/types/waap/waap_firewall_rule.py +78 -0
- gcore/types/waap/waap_get_account_overview_response.py +34 -0
- gcore/types/waap/waap_handshake_page_data.py +25 -0
- gcore/types/waap/waap_handshake_page_data_param.py +25 -0
- gcore/types/waap/waap_insight.py +38 -0
- gcore/types/waap/waap_insight_silence.py +28 -0
- gcore/types/waap/waap_insight_silence_sort_by.py +9 -0
- gcore/types/waap/waap_insight_sort_by.py +20 -0
- gcore/types/waap/waap_insight_status.py +7 -0
- gcore/types/waap/waap_ip_country_attack.py +16 -0
- gcore/types/waap/waap_ip_ddos_info_model.py +23 -0
- gcore/types/waap/waap_ip_info.py +57 -0
- gcore/types/waap/waap_ip_info_counts.py +16 -0
- gcore/types/waap/waap_javascript_disabled_page_data.py +18 -0
- gcore/types/waap/waap_javascript_disabled_page_data_param.py +18 -0
- gcore/types/waap/waap_network_details.py +17 -0
- gcore/types/waap/waap_organization.py +13 -0
- gcore/types/waap/waap_page_type.py +9 -0
- gcore/types/waap/waap_paginated_custom_page_set.py +22 -0
- gcore/types/waap/waap_paginated_ddos_attack.py +22 -0
- gcore/types/waap/waap_paginated_ddos_info.py +22 -0
- gcore/types/waap/waap_paginated_request_summary.py +22 -0
- gcore/types/waap/waap_pattern_matched_tag.py +37 -0
- gcore/types/waap/waap_policy_action.py +7 -0
- gcore/types/waap/waap_policy_mode.py +10 -0
- gcore/types/waap/waap_request_details.py +92 -0
- gcore/types/waap/waap_request_organization.py +13 -0
- gcore/types/waap/waap_request_summary.py +59 -0
- gcore/types/waap/waap_resolution.py +7 -0
- gcore/types/waap/waap_rule_action_type.py +7 -0
- gcore/types/waap/waap_rule_blocked_requests.py +16 -0
- gcore/types/waap/waap_rule_set.py +41 -0
- gcore/types/waap/waap_statistic_item.py +18 -0
- gcore/types/waap/waap_statistics_series.py +16 -0
- gcore/types/waap/waap_summary_domain.py +26 -0
- gcore/types/waap/waap_tag.py +16 -0
- gcore/types/waap/waap_time_series_attack.py +23 -0
- gcore/types/waap/waap_top_session.py +24 -0
- gcore/types/waap/waap_top_url.py +13 -0
- gcore/types/waap/waap_top_user_agent.py +13 -0
- gcore/types/waap/waap_traffic_metrics.py +68 -0
- gcore/types/waap/waap_traffic_type.py +28 -0
- gcore/types/waap/waap_user_agent_details.py +40 -0
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/METADATA +3 -3
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/RECORD +293 -126
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/WHEEL +0 -0
- {gcore-0.1.0a2.dist-info → gcore-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -132,6 +132,42 @@ class ImagesResource(SyncAPIResource):
|
|
|
132
132
|
cast_to=TaskIDList,
|
|
133
133
|
)
|
|
134
134
|
|
|
135
|
+
def delete_and_poll(
|
|
136
|
+
self,
|
|
137
|
+
image_id: str,
|
|
138
|
+
*,
|
|
139
|
+
project_id: int | None = None,
|
|
140
|
+
region_id: int | None = None,
|
|
141
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
142
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
143
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
144
|
+
extra_headers: Headers | None = None,
|
|
145
|
+
extra_query: Query | None = None,
|
|
146
|
+
extra_body: Body | None = None,
|
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
148
|
+
) -> None:
|
|
149
|
+
"""
|
|
150
|
+
Delete a bare metal GPU image and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
151
|
+
"""
|
|
152
|
+
response = self.delete(
|
|
153
|
+
image_id=image_id,
|
|
154
|
+
project_id=project_id,
|
|
155
|
+
region_id=region_id,
|
|
156
|
+
extra_headers=extra_headers,
|
|
157
|
+
extra_query=extra_query,
|
|
158
|
+
extra_body=extra_body,
|
|
159
|
+
timeout=timeout,
|
|
160
|
+
)
|
|
161
|
+
if not response.tasks or len(response.tasks) < 1:
|
|
162
|
+
raise ValueError("Expected at least one task to be created")
|
|
163
|
+
self._client.cloud.tasks.poll(
|
|
164
|
+
response.tasks[0],
|
|
165
|
+
extra_headers=extra_headers,
|
|
166
|
+
extra_query=extra_query,
|
|
167
|
+
extra_body=extra_body,
|
|
168
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
169
|
+
)
|
|
170
|
+
|
|
135
171
|
def get(
|
|
136
172
|
self,
|
|
137
173
|
image_id: str,
|
|
@@ -211,7 +247,7 @@ class ImagesResource(SyncAPIResource):
|
|
|
211
247
|
|
|
212
248
|
url: Image URL
|
|
213
249
|
|
|
214
|
-
architecture: Image architecture type: aarch64, x86_64
|
|
250
|
+
architecture: Image architecture type: aarch64, `x86_64`
|
|
215
251
|
|
|
216
252
|
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
217
253
|
deleted.
|
|
@@ -267,6 +303,72 @@ class ImagesResource(SyncAPIResource):
|
|
|
267
303
|
cast_to=TaskIDList,
|
|
268
304
|
)
|
|
269
305
|
|
|
306
|
+
def upload_and_poll(
|
|
307
|
+
self,
|
|
308
|
+
*,
|
|
309
|
+
project_id: int | None = None,
|
|
310
|
+
region_id: int | None = None,
|
|
311
|
+
name: str,
|
|
312
|
+
url: str,
|
|
313
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
314
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
315
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
316
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
317
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
318
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
319
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
320
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
321
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
322
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
|
+
extra_headers: Headers | None = None,
|
|
325
|
+
extra_query: Query | None = None,
|
|
326
|
+
extra_body: Body | None = None,
|
|
327
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
328
|
+
) -> GPUImage:
|
|
329
|
+
"""
|
|
330
|
+
Upload a new bare metal GPU image and wait for the upload to complete.
|
|
331
|
+
"""
|
|
332
|
+
response = self.upload(
|
|
333
|
+
project_id=project_id,
|
|
334
|
+
region_id=region_id,
|
|
335
|
+
name=name,
|
|
336
|
+
url=url,
|
|
337
|
+
architecture=architecture,
|
|
338
|
+
cow_format=cow_format,
|
|
339
|
+
hw_firmware_type=hw_firmware_type,
|
|
340
|
+
os_distro=os_distro,
|
|
341
|
+
os_type=os_type,
|
|
342
|
+
os_version=os_version,
|
|
343
|
+
ssh_key=ssh_key,
|
|
344
|
+
tags=tags,
|
|
345
|
+
extra_headers=extra_headers,
|
|
346
|
+
extra_query=extra_query,
|
|
347
|
+
extra_body=extra_body,
|
|
348
|
+
timeout=timeout,
|
|
349
|
+
)
|
|
350
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
351
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
352
|
+
task = self._client.cloud.tasks.poll(
|
|
353
|
+
response.tasks[0],
|
|
354
|
+
extra_headers=extra_headers,
|
|
355
|
+
extra_query=extra_query,
|
|
356
|
+
extra_body=extra_body,
|
|
357
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
358
|
+
)
|
|
359
|
+
if not task.created_resources or not task.created_resources.images:
|
|
360
|
+
raise ValueError("No image was created")
|
|
361
|
+
image_id = task.created_resources.images[0]
|
|
362
|
+
return self.get(
|
|
363
|
+
image_id=image_id,
|
|
364
|
+
project_id=project_id,
|
|
365
|
+
region_id=region_id,
|
|
366
|
+
extra_headers=extra_headers,
|
|
367
|
+
extra_query=extra_query,
|
|
368
|
+
extra_body=extra_body,
|
|
369
|
+
timeout=timeout,
|
|
370
|
+
)
|
|
371
|
+
|
|
270
372
|
|
|
271
373
|
class AsyncImagesResource(AsyncAPIResource):
|
|
272
374
|
@cached_property
|
|
@@ -373,6 +475,42 @@ class AsyncImagesResource(AsyncAPIResource):
|
|
|
373
475
|
cast_to=TaskIDList,
|
|
374
476
|
)
|
|
375
477
|
|
|
478
|
+
async def delete_and_poll(
|
|
479
|
+
self,
|
|
480
|
+
image_id: str,
|
|
481
|
+
*,
|
|
482
|
+
project_id: int | None = None,
|
|
483
|
+
region_id: int | None = None,
|
|
484
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
485
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
486
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
487
|
+
extra_headers: Headers | None = None,
|
|
488
|
+
extra_query: Query | None = None,
|
|
489
|
+
extra_body: Body | None = None,
|
|
490
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
491
|
+
) -> None:
|
|
492
|
+
"""
|
|
493
|
+
Delete a bare metal GPU image and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
494
|
+
"""
|
|
495
|
+
response = await self.delete(
|
|
496
|
+
image_id=image_id,
|
|
497
|
+
project_id=project_id,
|
|
498
|
+
region_id=region_id,
|
|
499
|
+
extra_headers=extra_headers,
|
|
500
|
+
extra_query=extra_query,
|
|
501
|
+
extra_body=extra_body,
|
|
502
|
+
timeout=timeout,
|
|
503
|
+
)
|
|
504
|
+
if not response.tasks or len(response.tasks) < 1:
|
|
505
|
+
raise ValueError("Expected at least one task to be created")
|
|
506
|
+
await self._client.cloud.tasks.poll(
|
|
507
|
+
response.tasks[0],
|
|
508
|
+
extra_headers=extra_headers,
|
|
509
|
+
extra_query=extra_query,
|
|
510
|
+
extra_body=extra_body,
|
|
511
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
512
|
+
)
|
|
513
|
+
|
|
376
514
|
async def get(
|
|
377
515
|
self,
|
|
378
516
|
image_id: str,
|
|
@@ -452,7 +590,7 @@ class AsyncImagesResource(AsyncAPIResource):
|
|
|
452
590
|
|
|
453
591
|
url: Image URL
|
|
454
592
|
|
|
455
|
-
architecture: Image architecture type: aarch64, x86_64
|
|
593
|
+
architecture: Image architecture type: aarch64, `x86_64`
|
|
456
594
|
|
|
457
595
|
cow_format: When True, image cannot be deleted unless all volumes, created from it, are
|
|
458
596
|
deleted.
|
|
@@ -508,6 +646,72 @@ class AsyncImagesResource(AsyncAPIResource):
|
|
|
508
646
|
cast_to=TaskIDList,
|
|
509
647
|
)
|
|
510
648
|
|
|
649
|
+
async def upload_and_poll(
|
|
650
|
+
self,
|
|
651
|
+
*,
|
|
652
|
+
project_id: int | None = None,
|
|
653
|
+
region_id: int | None = None,
|
|
654
|
+
name: str,
|
|
655
|
+
url: str,
|
|
656
|
+
architecture: Optional[Literal["aarch64", "x86_64"]] | NotGiven = NOT_GIVEN,
|
|
657
|
+
cow_format: bool | NotGiven = NOT_GIVEN,
|
|
658
|
+
hw_firmware_type: Optional[Literal["bios", "uefi"]] | NotGiven = NOT_GIVEN,
|
|
659
|
+
os_distro: Optional[str] | NotGiven = NOT_GIVEN,
|
|
660
|
+
os_type: Optional[Literal["linux", "windows"]] | NotGiven = NOT_GIVEN,
|
|
661
|
+
os_version: Optional[str] | NotGiven = NOT_GIVEN,
|
|
662
|
+
ssh_key: Literal["allow", "deny", "required"] | NotGiven = NOT_GIVEN,
|
|
663
|
+
tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
|
|
664
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
665
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
667
|
+
extra_headers: Headers | None = None,
|
|
668
|
+
extra_query: Query | None = None,
|
|
669
|
+
extra_body: Body | None = None,
|
|
670
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
671
|
+
) -> GPUImage:
|
|
672
|
+
"""
|
|
673
|
+
Upload a new bare metal GPU image and wait for the upload to complete.
|
|
674
|
+
"""
|
|
675
|
+
response = await self.upload(
|
|
676
|
+
project_id=project_id,
|
|
677
|
+
region_id=region_id,
|
|
678
|
+
name=name,
|
|
679
|
+
url=url,
|
|
680
|
+
architecture=architecture,
|
|
681
|
+
cow_format=cow_format,
|
|
682
|
+
hw_firmware_type=hw_firmware_type,
|
|
683
|
+
os_distro=os_distro,
|
|
684
|
+
os_type=os_type,
|
|
685
|
+
os_version=os_version,
|
|
686
|
+
ssh_key=ssh_key,
|
|
687
|
+
tags=tags,
|
|
688
|
+
extra_headers=extra_headers,
|
|
689
|
+
extra_query=extra_query,
|
|
690
|
+
extra_body=extra_body,
|
|
691
|
+
timeout=timeout,
|
|
692
|
+
)
|
|
693
|
+
if not response.tasks or len(response.tasks) != 1:
|
|
694
|
+
raise ValueError(f"Expected exactly one task to be created")
|
|
695
|
+
task = await self._client.cloud.tasks.poll(
|
|
696
|
+
response.tasks[0],
|
|
697
|
+
extra_headers=extra_headers,
|
|
698
|
+
extra_query=extra_query,
|
|
699
|
+
extra_body=extra_body,
|
|
700
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
701
|
+
)
|
|
702
|
+
if not task.created_resources or not task.created_resources.images:
|
|
703
|
+
raise ValueError("No image was created")
|
|
704
|
+
image_id = task.created_resources.images[0]
|
|
705
|
+
return await self.get(
|
|
706
|
+
image_id=image_id,
|
|
707
|
+
project_id=project_id,
|
|
708
|
+
region_id=region_id,
|
|
709
|
+
extra_headers=extra_headers,
|
|
710
|
+
extra_query=extra_query,
|
|
711
|
+
extra_body=extra_body,
|
|
712
|
+
timeout=timeout,
|
|
713
|
+
)
|
|
714
|
+
|
|
511
715
|
|
|
512
716
|
class ImagesResourceWithRawResponse:
|
|
513
717
|
def __init__(self, images: ImagesResource) -> None:
|
|
@@ -100,6 +100,46 @@ class ServersResource(SyncAPIResource):
|
|
|
100
100
|
cast_to=TaskIDList,
|
|
101
101
|
)
|
|
102
102
|
|
|
103
|
+
def delete_and_poll(
|
|
104
|
+
self,
|
|
105
|
+
instance_id: str,
|
|
106
|
+
*,
|
|
107
|
+
project_id: int | None = None,
|
|
108
|
+
region_id: int | None = None,
|
|
109
|
+
cluster_id: str,
|
|
110
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
111
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
112
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
113
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
114
|
+
extra_headers: Headers | None = None,
|
|
115
|
+
extra_query: Query | None = None,
|
|
116
|
+
extra_body: Body | None = None,
|
|
117
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
118
|
+
) -> None:
|
|
119
|
+
"""
|
|
120
|
+
Delete a bare metal GPU server from cluster and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
121
|
+
"""
|
|
122
|
+
response = self.delete(
|
|
123
|
+
instance_id=instance_id,
|
|
124
|
+
project_id=project_id,
|
|
125
|
+
region_id=region_id,
|
|
126
|
+
cluster_id=cluster_id,
|
|
127
|
+
delete_floatings=delete_floatings,
|
|
128
|
+
extra_headers=extra_headers,
|
|
129
|
+
extra_query=extra_query,
|
|
130
|
+
extra_body=extra_body,
|
|
131
|
+
timeout=timeout,
|
|
132
|
+
)
|
|
133
|
+
if not response.tasks or len(response.tasks) < 1:
|
|
134
|
+
raise ValueError("Expected at least one task to be created")
|
|
135
|
+
self._client.cloud.tasks.poll(
|
|
136
|
+
response.tasks[0],
|
|
137
|
+
extra_headers=extra_headers,
|
|
138
|
+
extra_query=extra_query,
|
|
139
|
+
extra_body=extra_body,
|
|
140
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
141
|
+
)
|
|
142
|
+
|
|
103
143
|
@overload
|
|
104
144
|
def attach_interface(
|
|
105
145
|
self,
|
|
@@ -233,7 +273,7 @@ class ServersResource(SyncAPIResource):
|
|
|
233
273
|
|
|
234
274
|
security_groups: List of security group IDs
|
|
235
275
|
|
|
236
|
-
type: Must be 'any_subnet'
|
|
276
|
+
type: Must be '`any_subnet`'
|
|
237
277
|
|
|
238
278
|
extra_headers: Send extra headers
|
|
239
279
|
|
|
@@ -281,7 +321,7 @@ class ServersResource(SyncAPIResource):
|
|
|
281
321
|
|
|
282
322
|
security_groups: List of security group IDs
|
|
283
323
|
|
|
284
|
-
type: Must be 'reserved_fixed_ip'. Union tag
|
|
324
|
+
type: Must be '`reserved_fixed_ip`'. Union tag
|
|
285
325
|
|
|
286
326
|
extra_headers: Send extra headers
|
|
287
327
|
|
|
@@ -587,6 +627,46 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
587
627
|
cast_to=TaskIDList,
|
|
588
628
|
)
|
|
589
629
|
|
|
630
|
+
async def delete_and_poll(
|
|
631
|
+
self,
|
|
632
|
+
instance_id: str,
|
|
633
|
+
*,
|
|
634
|
+
project_id: int | None = None,
|
|
635
|
+
region_id: int | None = None,
|
|
636
|
+
cluster_id: str,
|
|
637
|
+
delete_floatings: bool | NotGiven = NOT_GIVEN,
|
|
638
|
+
polling_interval_seconds: int | NotGiven = NOT_GIVEN,
|
|
639
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
640
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
641
|
+
extra_headers: Headers | None = None,
|
|
642
|
+
extra_query: Query | None = None,
|
|
643
|
+
extra_body: Body | None = None,
|
|
644
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
645
|
+
) -> None:
|
|
646
|
+
"""
|
|
647
|
+
Delete a bare metal GPU server from cluster and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
|
|
648
|
+
"""
|
|
649
|
+
response = await self.delete(
|
|
650
|
+
instance_id=instance_id,
|
|
651
|
+
project_id=project_id,
|
|
652
|
+
region_id=region_id,
|
|
653
|
+
cluster_id=cluster_id,
|
|
654
|
+
delete_floatings=delete_floatings,
|
|
655
|
+
extra_headers=extra_headers,
|
|
656
|
+
extra_query=extra_query,
|
|
657
|
+
extra_body=extra_body,
|
|
658
|
+
timeout=timeout,
|
|
659
|
+
)
|
|
660
|
+
if not response.tasks or len(response.tasks) < 1:
|
|
661
|
+
raise ValueError("Expected at least one task to be created")
|
|
662
|
+
await self._client.cloud.tasks.poll(
|
|
663
|
+
response.tasks[0],
|
|
664
|
+
extra_headers=extra_headers,
|
|
665
|
+
extra_query=extra_query,
|
|
666
|
+
extra_body=extra_body,
|
|
667
|
+
polling_interval_seconds=polling_interval_seconds,
|
|
668
|
+
)
|
|
669
|
+
|
|
590
670
|
@overload
|
|
591
671
|
async def attach_interface(
|
|
592
672
|
self,
|
|
@@ -720,7 +800,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
720
800
|
|
|
721
801
|
security_groups: List of security group IDs
|
|
722
802
|
|
|
723
|
-
type: Must be 'any_subnet'
|
|
803
|
+
type: Must be '`any_subnet`'
|
|
724
804
|
|
|
725
805
|
extra_headers: Send extra headers
|
|
726
806
|
|
|
@@ -768,7 +848,7 @@ class AsyncServersResource(AsyncAPIResource):
|
|
|
768
848
|
|
|
769
849
|
security_groups: List of security group IDs
|
|
770
850
|
|
|
771
|
-
type: Must be 'reserved_fixed_ip'. Union tag
|
|
851
|
+
type: Must be '`reserved_fixed_ip`'. Union tag
|
|
772
852
|
|
|
773
853
|
extra_headers: Send extra headers
|
|
774
854
|
|