gcore 0.1.0a2__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gcore might be problematic. Click here for more details.

Files changed (78) hide show
  1. gcore/__init__.py +5 -0
  2. gcore/_client.py +9 -0
  3. gcore/_utils/_proxy.py +4 -1
  4. gcore/_utils/_resources_proxy.py +24 -0
  5. gcore/_version.py +1 -1
  6. gcore/resources/__init__.py +14 -0
  7. gcore/resources/cloud/baremetal/servers.py +234 -0
  8. gcore/resources/cloud/billing_reservations.py +24 -0
  9. gcore/resources/cloud/file_shares/file_shares.py +16 -0
  10. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +352 -2
  11. gcore/resources/cloud/gpu_baremetal_clusters/images.py +204 -0
  12. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +80 -0
  13. gcore/resources/cloud/inference/deployments/deployments.py +322 -4
  14. gcore/resources/cloud/instances/images.py +316 -0
  15. gcore/resources/cloud/instances/instances.py +472 -0
  16. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +282 -0
  17. gcore/resources/cloud/load_balancers/l7_policies/rules.py +326 -0
  18. gcore/resources/cloud/load_balancers/listeners.py +371 -6
  19. gcore/resources/cloud/load_balancers/load_balancers.py +364 -0
  20. gcore/resources/cloud/load_balancers/pools/health_monitors.py +24 -0
  21. gcore/resources/cloud/load_balancers/pools/members.py +28 -0
  22. gcore/resources/cloud/load_balancers/pools/pools.py +388 -8
  23. gcore/resources/cloud/networks/networks.py +72 -16
  24. gcore/resources/cloud/secrets.py +56 -11
  25. gcore/resources/cloud/tasks.py +107 -96
  26. gcore/resources/waap/__init__.py +33 -0
  27. gcore/resources/waap/domains/__init__.py +33 -0
  28. gcore/resources/waap/domains/domains.py +515 -0
  29. gcore/resources/waap/domains/settings.py +271 -0
  30. gcore/resources/waap/waap.py +102 -0
  31. gcore/types/cloud/__init__.py +1 -0
  32. gcore/types/cloud/billing_reservation_list_params.py +5 -0
  33. gcore/types/cloud/container_probe_config_create_param.py +1 -2
  34. gcore/types/cloud/file_share.py +3 -0
  35. gcore/types/cloud/file_share_list_params.py +7 -1
  36. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +20 -0
  37. gcore/types/cloud/inference/deployment_update_params.py +203 -6
  38. gcore/types/cloud/inference/inference.py +3 -1
  39. gcore/types/cloud/load_balancer_listener_detail.py +13 -13
  40. gcore/types/cloud/load_balancer_pool.py +13 -13
  41. gcore/types/cloud/load_balancer_pool_list.py +99 -4
  42. gcore/types/cloud/load_balancers/listener_create_params.py +2 -0
  43. gcore/types/cloud/load_balancers/listener_get_params.py +3 -1
  44. gcore/types/cloud/load_balancers/listener_list_params.py +4 -2
  45. gcore/types/cloud/load_balancers/listener_update_params.py +2 -0
  46. gcore/types/cloud/load_balancers/pool_create_params.py +2 -0
  47. gcore/types/cloud/load_balancers/pool_list_params.py +5 -6
  48. gcore/types/cloud/load_balancers/pool_update_params.py +2 -0
  49. gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +2 -0
  50. gcore/types/cloud/load_balancers/pools/member_add_params.py +2 -0
  51. gcore/types/cloud/network.py +21 -21
  52. gcore/types/cloud/network_create_params.py +2 -0
  53. gcore/types/cloud/network_details.py +24 -23
  54. gcore/types/cloud/network_list_params.py +15 -10
  55. gcore/types/cloud/network_update_params.py +2 -0
  56. gcore/types/cloud/quota_get_all_response.py +18 -0
  57. gcore/types/cloud/quota_get_by_region_response.py +18 -0
  58. gcore/types/cloud/quotas/request_create_params.py +9 -0
  59. gcore/types/cloud/quotas/request_get_response.py +9 -0
  60. gcore/types/cloud/quotas/request_list_response.py +9 -0
  61. gcore/types/cloud/secret_list_params.py +24 -0
  62. gcore/types/cloud/task.py +0 -3
  63. gcore/types/cloud/task_list_params.py +8 -2
  64. gcore/types/waap/__init__.py +12 -0
  65. gcore/types/waap/domain_list_params.py +30 -0
  66. gcore/types/waap/domain_update_params.py +12 -0
  67. gcore/types/waap/domains/__init__.py +5 -0
  68. gcore/types/waap/domains/setting_update_params.py +41 -0
  69. gcore/types/waap/waap_api_urls.py +15 -0
  70. gcore/types/waap/waap_detailed_domain.py +37 -0
  71. gcore/types/waap/waap_domain_ddos_settings.py +31 -0
  72. gcore/types/waap/waap_domain_settings.py +15 -0
  73. gcore/types/waap/waap_domain_status.py +7 -0
  74. gcore/types/waap/waap_summary_domain.py +26 -0
  75. {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/METADATA +3 -3
  76. {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/RECORD +78 -60
  77. {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/WHEEL +0 -0
  78. {gcore-0.1.0a2.dist-info → gcore-0.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,271 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
8
+ from ...._utils import maybe_transform, async_maybe_transform
9
+ from ...._compat import cached_property
10
+ from ...._resource import SyncAPIResource, AsyncAPIResource
11
+ from ...._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ...._base_client import make_request_options
18
+ from ....types.waap.domains import setting_update_params
19
+ from ....types.waap.waap_domain_settings import WaapDomainSettings
20
+
21
+ __all__ = ["SettingsResource", "AsyncSettingsResource"]
22
+
23
+
24
+ class SettingsResource(SyncAPIResource):
25
+ @cached_property
26
+ def with_raw_response(self) -> SettingsResourceWithRawResponse:
27
+ """
28
+ This property can be used as a prefix for any HTTP method call to return
29
+ the raw response object instead of the parsed content.
30
+
31
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
32
+ """
33
+ return SettingsResourceWithRawResponse(self)
34
+
35
+ @cached_property
36
+ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
37
+ """
38
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39
+
40
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
41
+ """
42
+ return SettingsResourceWithStreamingResponse(self)
43
+
44
+ def update(
45
+ self,
46
+ domain_id: int,
47
+ *,
48
+ api: setting_update_params.API | NotGiven = NOT_GIVEN,
49
+ ddos: setting_update_params.DDOS | NotGiven = NOT_GIVEN,
50
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
+ # The extra values given here take precedence over values defined on the client or passed to this method.
52
+ extra_headers: Headers | None = None,
53
+ extra_query: Query | None = None,
54
+ extra_body: Body | None = None,
55
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
56
+ ) -> None:
57
+ """
58
+ Update settings for a specific domain
59
+
60
+ Args:
61
+ domain_id: The domain ID
62
+
63
+ api: Editable API settings of a domain
64
+
65
+ ddos: Editable DDoS settings for a domain.
66
+
67
+ extra_headers: Send extra headers
68
+
69
+ extra_query: Add additional query parameters to the request
70
+
71
+ extra_body: Add additional JSON properties to the request
72
+
73
+ timeout: Override the client-level default timeout for this request, in seconds
74
+ """
75
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
76
+ return self._patch(
77
+ f"/waap/v1/domains/{domain_id}/settings",
78
+ body=maybe_transform(
79
+ {
80
+ "api": api,
81
+ "ddos": ddos,
82
+ },
83
+ setting_update_params.SettingUpdateParams,
84
+ ),
85
+ options=make_request_options(
86
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
87
+ ),
88
+ cast_to=NoneType,
89
+ )
90
+
91
+ def get(
92
+ self,
93
+ domain_id: int,
94
+ *,
95
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
96
+ # The extra values given here take precedence over values defined on the client or passed to this method.
97
+ extra_headers: Headers | None = None,
98
+ extra_query: Query | None = None,
99
+ extra_body: Body | None = None,
100
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
101
+ ) -> WaapDomainSettings:
102
+ """
103
+ Retrieve settings for a specific domain
104
+
105
+ Args:
106
+ domain_id: The domain ID
107
+
108
+ extra_headers: Send extra headers
109
+
110
+ extra_query: Add additional query parameters to the request
111
+
112
+ extra_body: Add additional JSON properties to the request
113
+
114
+ timeout: Override the client-level default timeout for this request, in seconds
115
+ """
116
+ return self._get(
117
+ f"/waap/v1/domains/{domain_id}/settings",
118
+ options=make_request_options(
119
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
120
+ ),
121
+ cast_to=WaapDomainSettings,
122
+ )
123
+
124
+
125
+ class AsyncSettingsResource(AsyncAPIResource):
126
+ @cached_property
127
+ def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
128
+ """
129
+ This property can be used as a prefix for any HTTP method call to return
130
+ the raw response object instead of the parsed content.
131
+
132
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
133
+ """
134
+ return AsyncSettingsResourceWithRawResponse(self)
135
+
136
+ @cached_property
137
+ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
138
+ """
139
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
140
+
141
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
142
+ """
143
+ return AsyncSettingsResourceWithStreamingResponse(self)
144
+
145
+ async def update(
146
+ self,
147
+ domain_id: int,
148
+ *,
149
+ api: setting_update_params.API | NotGiven = NOT_GIVEN,
150
+ ddos: setting_update_params.DDOS | NotGiven = NOT_GIVEN,
151
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
152
+ # The extra values given here take precedence over values defined on the client or passed to this method.
153
+ extra_headers: Headers | None = None,
154
+ extra_query: Query | None = None,
155
+ extra_body: Body | None = None,
156
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
157
+ ) -> None:
158
+ """
159
+ Update settings for a specific domain
160
+
161
+ Args:
162
+ domain_id: The domain ID
163
+
164
+ api: Editable API settings of a domain
165
+
166
+ ddos: Editable DDoS settings for a domain.
167
+
168
+ extra_headers: Send extra headers
169
+
170
+ extra_query: Add additional query parameters to the request
171
+
172
+ extra_body: Add additional JSON properties to the request
173
+
174
+ timeout: Override the client-level default timeout for this request, in seconds
175
+ """
176
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
177
+ return await self._patch(
178
+ f"/waap/v1/domains/{domain_id}/settings",
179
+ body=await async_maybe_transform(
180
+ {
181
+ "api": api,
182
+ "ddos": ddos,
183
+ },
184
+ setting_update_params.SettingUpdateParams,
185
+ ),
186
+ options=make_request_options(
187
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
188
+ ),
189
+ cast_to=NoneType,
190
+ )
191
+
192
+ async def get(
193
+ self,
194
+ domain_id: int,
195
+ *,
196
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
197
+ # The extra values given here take precedence over values defined on the client or passed to this method.
198
+ extra_headers: Headers | None = None,
199
+ extra_query: Query | None = None,
200
+ extra_body: Body | None = None,
201
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
202
+ ) -> WaapDomainSettings:
203
+ """
204
+ Retrieve settings for a specific domain
205
+
206
+ Args:
207
+ domain_id: The domain ID
208
+
209
+ extra_headers: Send extra headers
210
+
211
+ extra_query: Add additional query parameters to the request
212
+
213
+ extra_body: Add additional JSON properties to the request
214
+
215
+ timeout: Override the client-level default timeout for this request, in seconds
216
+ """
217
+ return await self._get(
218
+ f"/waap/v1/domains/{domain_id}/settings",
219
+ options=make_request_options(
220
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
221
+ ),
222
+ cast_to=WaapDomainSettings,
223
+ )
224
+
225
+
226
+ class SettingsResourceWithRawResponse:
227
+ def __init__(self, settings: SettingsResource) -> None:
228
+ self._settings = settings
229
+
230
+ self.update = to_raw_response_wrapper(
231
+ settings.update,
232
+ )
233
+ self.get = to_raw_response_wrapper(
234
+ settings.get,
235
+ )
236
+
237
+
238
+ class AsyncSettingsResourceWithRawResponse:
239
+ def __init__(self, settings: AsyncSettingsResource) -> None:
240
+ self._settings = settings
241
+
242
+ self.update = async_to_raw_response_wrapper(
243
+ settings.update,
244
+ )
245
+ self.get = async_to_raw_response_wrapper(
246
+ settings.get,
247
+ )
248
+
249
+
250
+ class SettingsResourceWithStreamingResponse:
251
+ def __init__(self, settings: SettingsResource) -> None:
252
+ self._settings = settings
253
+
254
+ self.update = to_streamed_response_wrapper(
255
+ settings.update,
256
+ )
257
+ self.get = to_streamed_response_wrapper(
258
+ settings.get,
259
+ )
260
+
261
+
262
+ class AsyncSettingsResourceWithStreamingResponse:
263
+ def __init__(self, settings: AsyncSettingsResource) -> None:
264
+ self._settings = settings
265
+
266
+ self.update = async_to_streamed_response_wrapper(
267
+ settings.update,
268
+ )
269
+ self.get = async_to_streamed_response_wrapper(
270
+ settings.get,
271
+ )
@@ -0,0 +1,102 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from ..._compat import cached_property
6
+ from ..._resource import SyncAPIResource, AsyncAPIResource
7
+ from .domains.domains import (
8
+ DomainsResource,
9
+ AsyncDomainsResource,
10
+ DomainsResourceWithRawResponse,
11
+ AsyncDomainsResourceWithRawResponse,
12
+ DomainsResourceWithStreamingResponse,
13
+ AsyncDomainsResourceWithStreamingResponse,
14
+ )
15
+
16
+ __all__ = ["WaapResource", "AsyncWaapResource"]
17
+
18
+
19
+ class WaapResource(SyncAPIResource):
20
+ @cached_property
21
+ def domains(self) -> DomainsResource:
22
+ return DomainsResource(self._client)
23
+
24
+ @cached_property
25
+ def with_raw_response(self) -> WaapResourceWithRawResponse:
26
+ """
27
+ This property can be used as a prefix for any HTTP method call to return
28
+ the raw response object instead of the parsed content.
29
+
30
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
31
+ """
32
+ return WaapResourceWithRawResponse(self)
33
+
34
+ @cached_property
35
+ def with_streaming_response(self) -> WaapResourceWithStreamingResponse:
36
+ """
37
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
+
39
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
40
+ """
41
+ return WaapResourceWithStreamingResponse(self)
42
+
43
+
44
+ class AsyncWaapResource(AsyncAPIResource):
45
+ @cached_property
46
+ def domains(self) -> AsyncDomainsResource:
47
+ return AsyncDomainsResource(self._client)
48
+
49
+ @cached_property
50
+ def with_raw_response(self) -> AsyncWaapResourceWithRawResponse:
51
+ """
52
+ This property can be used as a prefix for any HTTP method call to return
53
+ the raw response object instead of the parsed content.
54
+
55
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
56
+ """
57
+ return AsyncWaapResourceWithRawResponse(self)
58
+
59
+ @cached_property
60
+ def with_streaming_response(self) -> AsyncWaapResourceWithStreamingResponse:
61
+ """
62
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63
+
64
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
65
+ """
66
+ return AsyncWaapResourceWithStreamingResponse(self)
67
+
68
+
69
+ class WaapResourceWithRawResponse:
70
+ def __init__(self, waap: WaapResource) -> None:
71
+ self._waap = waap
72
+
73
+ @cached_property
74
+ def domains(self) -> DomainsResourceWithRawResponse:
75
+ return DomainsResourceWithRawResponse(self._waap.domains)
76
+
77
+
78
+ class AsyncWaapResourceWithRawResponse:
79
+ def __init__(self, waap: AsyncWaapResource) -> None:
80
+ self._waap = waap
81
+
82
+ @cached_property
83
+ def domains(self) -> AsyncDomainsResourceWithRawResponse:
84
+ return AsyncDomainsResourceWithRawResponse(self._waap.domains)
85
+
86
+
87
+ class WaapResourceWithStreamingResponse:
88
+ def __init__(self, waap: WaapResource) -> None:
89
+ self._waap = waap
90
+
91
+ @cached_property
92
+ def domains(self) -> DomainsResourceWithStreamingResponse:
93
+ return DomainsResourceWithStreamingResponse(self._waap.domains)
94
+
95
+
96
+ class AsyncWaapResourceWithStreamingResponse:
97
+ def __init__(self, waap: AsyncWaapResource) -> None:
98
+ self._waap = waap
99
+
100
+ @cached_property
101
+ def domains(self) -> AsyncDomainsResourceWithStreamingResponse:
102
+ return AsyncDomainsResourceWithStreamingResponse(self._waap.domains)
@@ -67,6 +67,7 @@ from .instance_interface import InstanceInterface as InstanceInterface
67
67
  from .instance_isolation import InstanceIsolation as InstanceIsolation
68
68
  from .load_balancer_pool import LoadBalancerPool as LoadBalancerPool
69
69
  from .region_list_params import RegionListParams as RegionListParams
70
+ from .secret_list_params import SecretListParams as SecretListParams
70
71
  from .volume_list_params import VolumeListParams as VolumeListParams
71
72
  from .billing_reservation import BillingReservation as BillingReservation
72
73
  from .ddos_profile_status import DDOSProfileStatus as DDOSProfileStatus
@@ -45,6 +45,11 @@ class BillingReservationListParams(TypedDict, total=False):
45
45
  offset: int
46
46
  """Offset in reservation list"""
47
47
 
48
+ order_by: Literal[
49
+ "active_from.asc", "active_from.desc", "active_to.asc", "active_to.desc", "created_at.asc", "created_at.desc"
50
+ ]
51
+ """Order by field and direction."""
52
+
48
53
  region_id: int
49
54
  """Region for reservation"""
50
55
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Optional
6
5
  from typing_extensions import Required, TypedDict
7
6
 
8
7
  from .container_probe_create_param import ContainerProbeCreateParam
@@ -14,5 +13,5 @@ class ContainerProbeConfigCreateParam(TypedDict, total=False):
14
13
  enabled: Required[bool]
15
14
  """Whether the probe is enabled or not."""
16
15
 
17
- probe: Optional[ContainerProbeCreateParam]
16
+ probe: ContainerProbeCreateParam
18
17
  """Probe configuration (exec, http_get or tcp_socket)"""
@@ -107,5 +107,8 @@ class FileShare(BaseModel):
107
107
  the resource is not locked.
108
108
  """
109
109
 
110
+ type_name: Literal["standard", "vast"]
111
+ """File share type name"""
112
+
110
113
  volume_type: Literal["default_share_type", "vast_share_type"]
111
114
  """File share disk type"""
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing_extensions import TypedDict
5
+ from typing_extensions import Literal, TypedDict
6
6
 
7
7
  __all__ = ["FileShareListParams"]
8
8
 
@@ -17,8 +17,14 @@ class FileShareListParams(TypedDict, total=False):
17
17
  limit: int
18
18
  """Optional. Limit the number of returned items"""
19
19
 
20
+ name: str
21
+ """File share name. Uses partial match."""
22
+
20
23
  offset: int
21
24
  """Optional.
22
25
 
23
26
  Offset value is used to exclude the first set of records from the result
24
27
  """
28
+
29
+ type_name: Literal["standard", "vast"]
30
+ """File share type name"""
@@ -42,6 +42,13 @@ class GPUBaremetalClusterCreateParams(TypedDict, total=False):
42
42
  instances_count: int
43
43
  """Number of servers to create"""
44
44
 
45
+ password: str
46
+ """A password for a bare metal server.
47
+
48
+ This parameter is used to set a password for the "Admin" user on a Windows
49
+ instance, a default user or a new user on a Linux instance
50
+ """
51
+
45
52
  ssh_key_name: str
46
53
  """
47
54
  Specifies the name of the SSH keypair, created via the
@@ -58,6 +65,19 @@ class GPUBaremetalClusterCreateParams(TypedDict, total=False):
58
65
  values.
59
66
  """
60
67
 
68
+ user_data: str
69
+ """String in base64 format.
70
+
71
+ Must not be passed together with 'username' or 'password'. Examples of the
72
+ user_data: https://cloudinit.readthedocs.io/en/latest/topics/examples.html
73
+ """
74
+
75
+ username: str
76
+ """A name of a new user in the Linux instance.
77
+
78
+ It may be passed with a 'password' parameter
79
+ """
80
+
61
81
 
62
82
  class InterfaceCreateGPUClusterExternalInterfaceSerializer(TypedDict, total=False):
63
83
  type: Required[Literal["external"]]