Skip to content

Commit f3aefda

Browse files
feat(api): aggregated API specs update
1 parent 067e9ff commit f3aefda

26 files changed

+266
-239
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 447
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-21dade7f2034ff31578d98a7d0e769aa271906ace022862be072adc14176a108.yml
3-
openapi_spec_hash: a6b097bcb1ea27498a93ef4d26a35f90
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-8adebc369a231e1ce31d1d812970d147bc22fdbd5373aeea53722091e03cc889.yml
3+
openapi_spec_hash: 08ee188ad64ee8fb77128276b5f81467
44
config_hash: 0eef23ac91befdd529503f40af5ea9b1

api.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,19 +528,16 @@ Methods:
528528
Types:
529529

530530
```python
531-
from gcore.types.cloud.inference import (
532-
InferenceRegistryCredentials,
533-
InferenceRegistryCredentialsCreate,
534-
)
531+
from gcore.types.cloud.inference import InferenceRegistryCredentials
535532
```
536533

537534
Methods:
538535

539-
- <code title="post /cloud/v3/inference/{project_id}/registry_credentials">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">create</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/inference/registry_credential_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials_create.py">InferenceRegistryCredentialsCreate</a></code>
536+
- <code title="post /cloud/v3/inference/{project_id}/registry_credentials">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">create</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/inference/registry_credential_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials.py">InferenceRegistryCredentials</a></code>
540537
- <code title="get /cloud/v3/inference/{project_id}/registry_credentials">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">list</a>(\*, project_id, \*\*<a href="src/gcore/types/cloud/inference/registry_credential_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials.py">SyncOffsetPage[InferenceRegistryCredentials]</a></code>
541538
- <code title="delete /cloud/v3/inference/{project_id}/registry_credentials/{credential_name}">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">delete</a>(credential_name, \*, project_id) -> None</code>
542539
- <code title="get /cloud/v3/inference/{project_id}/registry_credentials/{credential_name}">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">get</a>(credential_name, \*, project_id) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials.py">InferenceRegistryCredentials</a></code>
543-
- <code title="put /cloud/v3/inference/{project_id}/registry_credentials/{credential_name}">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">replace</a>(credential_name, \*, project_id, \*\*<a href="src/gcore/types/cloud/inference/registry_credential_replace_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials_create.py">InferenceRegistryCredentialsCreate</a></code>
540+
- <code title="put /cloud/v3/inference/{project_id}/registry_credentials/{credential_name}">client.cloud.inference.registry_credentials.<a href="./src/gcore/resources/cloud/inference/registry_credentials.py">replace</a>(credential_name, \*, project_id, \*\*<a href="src/gcore/types/cloud/inference/registry_credential_replace_params.py">params</a>) -> <a href="./src/gcore/types/cloud/inference/inference_registry_credentials.py">InferenceRegistryCredentials</a></code>
544541

545542
### Secrets
546543

src/gcore/resources/cloud/cost_reports.py

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ def get_aggregated(
171171
def get_aggregated_monthly(
172172
self,
173173
*,
174-
time_from: Union[str, datetime],
175-
time_to: Union[str, datetime],
176174
regions: Iterable[int] | NotGiven = NOT_GIVEN,
177175
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
178176
rounding: bool | NotGiven = NOT_GIVEN,
179177
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
180178
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
179+
time_from: Union[str, datetime] | NotGiven = NOT_GIVEN,
180+
time_to: Union[str, datetime] | NotGiven = NOT_GIVEN,
181181
types: List[
182182
Literal[
183183
"ai_cluster",
@@ -208,6 +208,7 @@ def get_aggregated_monthly(
208208
]
209209
]
210210
| NotGiven = NOT_GIVEN,
211+
year_month: str | NotGiven = NOT_GIVEN,
211212
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
212213
# The extra values given here take precedence over values defined on the client or passed to this method.
213214
extra_headers: Headers | None = None,
@@ -227,10 +228,6 @@ def get_aggregated_monthly(
227228
hours until the servers are back online and the missing data is filled in.
228229
229230
Args:
230-
time_from: Beginning of the period: YYYY-mm
231-
232-
time_to: End of the period: YYYY-mm
233-
234231
regions: List of region IDs.
235232
236233
response_format: Format of the response (`csv_totals` or json).
@@ -241,8 +238,14 @@ def get_aggregated_monthly(
241238
242239
tags: Filter by tags
243240
241+
time_from: Deprecated. Use `year_month` instead. Beginning of the period: YYYY-mm
242+
243+
time_to: Deprecated. Use `year_month` instead. End of the period: YYYY-mm
244+
244245
types: List of resource types to be filtered in the report.
245246
247+
year_month: Year and month in the format YYYY-MM
248+
246249
extra_headers: Send extra headers
247250
248251
extra_query: Add additional query parameters to the request
@@ -255,14 +258,15 @@ def get_aggregated_monthly(
255258
"/cloud/v1/reservation_cost_report/totals",
256259
body=maybe_transform(
257260
{
258-
"time_from": time_from,
259-
"time_to": time_to,
260261
"regions": regions,
261262
"response_format": response_format,
262263
"rounding": rounding,
263264
"schema_filter": schema_filter,
264265
"tags": tags,
266+
"time_from": time_from,
267+
"time_to": time_to,
265268
"types": types,
269+
"year_month": year_month,
266270
},
267271
cost_report_get_aggregated_monthly_params.CostReportGetAggregatedMonthlyParams,
268272
),
@@ -543,13 +547,13 @@ async def get_aggregated(
543547
async def get_aggregated_monthly(
544548
self,
545549
*,
546-
time_from: Union[str, datetime],
547-
time_to: Union[str, datetime],
548550
regions: Iterable[int] | NotGiven = NOT_GIVEN,
549551
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
550552
rounding: bool | NotGiven = NOT_GIVEN,
551553
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
552554
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
555+
time_from: Union[str, datetime] | NotGiven = NOT_GIVEN,
556+
time_to: Union[str, datetime] | NotGiven = NOT_GIVEN,
553557
types: List[
554558
Literal[
555559
"ai_cluster",
@@ -580,6 +584,7 @@ async def get_aggregated_monthly(
580584
]
581585
]
582586
| NotGiven = NOT_GIVEN,
587+
year_month: str | NotGiven = NOT_GIVEN,
583588
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
584589
# The extra values given here take precedence over values defined on the client or passed to this method.
585590
extra_headers: Headers | None = None,
@@ -599,10 +604,6 @@ async def get_aggregated_monthly(
599604
hours until the servers are back online and the missing data is filled in.
600605
601606
Args:
602-
time_from: Beginning of the period: YYYY-mm
603-
604-
time_to: End of the period: YYYY-mm
605-
606607
regions: List of region IDs.
607608
608609
response_format: Format of the response (`csv_totals` or json).
@@ -613,8 +614,14 @@ async def get_aggregated_monthly(
613614
614615
tags: Filter by tags
615616
617+
time_from: Deprecated. Use `year_month` instead. Beginning of the period: YYYY-mm
618+
619+
time_to: Deprecated. Use `year_month` instead. End of the period: YYYY-mm
620+
616621
types: List of resource types to be filtered in the report.
617622
623+
year_month: Year and month in the format YYYY-MM
624+
618625
extra_headers: Send extra headers
619626
620627
extra_query: Add additional query parameters to the request
@@ -627,14 +634,15 @@ async def get_aggregated_monthly(
627634
"/cloud/v1/reservation_cost_report/totals",
628635
body=await async_maybe_transform(
629636
{
630-
"time_from": time_from,
631-
"time_to": time_to,
632637
"regions": regions,
633638
"response_format": response_format,
634639
"rounding": rounding,
635640
"schema_filter": schema_filter,
636641
"tags": tags,
642+
"time_from": time_from,
643+
"time_to": time_to,
637644
"types": types,
645+
"year_month": year_month,
638646
},
639647
cost_report_get_aggregated_monthly_params.CostReportGetAggregatedMonthlyParams,
640648
),

src/gcore/resources/cloud/file_shares/file_shares.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def create(
7676
size: int,
7777
access: Iterable[file_share_create_params.CreateStandardFileShareSerializerAccess] | NotGiven = NOT_GIVEN,
7878
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
79+
type_name: Literal["standard"] | NotGiven = NOT_GIVEN,
7980
volume_type: Literal["default_share_type"] | NotGiven = NOT_GIVEN,
8081
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8182
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -108,7 +109,9 @@ def create(
108109
modified by the user. Tags are also integrated with cost reports, allowing cost
109110
data to be filtered based on tag keys or values.
110111
111-
volume_type: File share volume type
112+
type_name: Standard file share type
113+
114+
volume_type: Deprecated. Use `type_name` instead.
112115
113116
extra_headers: Send extra headers
114117
@@ -129,9 +132,10 @@ def create(
129132
name: str,
130133
protocol: Literal["NFS"],
131134
size: int,
132-
volume_type: Literal["vast_share_type"],
133135
share_settings: file_share_create_params.CreateVastFileShareSerializerShareSettings | NotGiven = NOT_GIVEN,
134136
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
137+
type_name: Literal["vast"] | NotGiven = NOT_GIVEN,
138+
volume_type: Literal["vast_share_type"] | NotGiven = NOT_GIVEN,
135139
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136140
# The extra values given here take precedence over values defined on the client or passed to this method.
137141
extra_headers: Headers | None = None,
@@ -153,8 +157,6 @@ def create(
153157
154158
size: File share size
155159
156-
volume_type: File share volume type
157-
158160
share_settings: Configuration settings for the share
159161
160162
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
@@ -163,6 +165,10 @@ def create(
163165
modified by the user. Tags are also integrated with cost reports, allowing cost
164166
data to be filtered based on tag keys or values.
165167
168+
type_name: Vast file share type
169+
170+
volume_type: Deprecated. Use `type_name` instead.
171+
166172
extra_headers: Send extra headers
167173
168174
extra_query: Add additional query parameters to the request
@@ -173,7 +179,7 @@ def create(
173179
"""
174180
...
175181

176-
@required_args(["name", "network", "protocol", "size"], ["name", "protocol", "size", "volume_type"])
182+
@required_args(["name", "network", "protocol", "size"], ["name", "protocol", "size"])
177183
def create(
178184
self,
179185
*,
@@ -185,6 +191,7 @@ def create(
185191
size: int,
186192
access: Iterable[file_share_create_params.CreateStandardFileShareSerializerAccess] | NotGiven = NOT_GIVEN,
187193
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
194+
type_name: Literal["standard"] | Literal["vast"] | NotGiven = NOT_GIVEN,
188195
volume_type: Literal["default_share_type"] | Literal["vast_share_type"] | NotGiven = NOT_GIVEN,
189196
share_settings: file_share_create_params.CreateVastFileShareSerializerShareSettings | NotGiven = NOT_GIVEN,
190197
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -208,6 +215,7 @@ def create(
208215
"size": size,
209216
"access": access,
210217
"tags": tags,
218+
"type_name": type_name,
211219
"volume_type": volume_type,
212220
"share_settings": share_settings,
213221
},
@@ -537,6 +545,7 @@ async def create(
537545
size: int,
538546
access: Iterable[file_share_create_params.CreateStandardFileShareSerializerAccess] | NotGiven = NOT_GIVEN,
539547
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
548+
type_name: Literal["standard"] | NotGiven = NOT_GIVEN,
540549
volume_type: Literal["default_share_type"] | NotGiven = NOT_GIVEN,
541550
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
542551
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -569,7 +578,9 @@ async def create(
569578
modified by the user. Tags are also integrated with cost reports, allowing cost
570579
data to be filtered based on tag keys or values.
571580
572-
volume_type: File share volume type
581+
type_name: Standard file share type
582+
583+
volume_type: Deprecated. Use `type_name` instead.
573584
574585
extra_headers: Send extra headers
575586
@@ -590,9 +601,10 @@ async def create(
590601
name: str,
591602
protocol: Literal["NFS"],
592603
size: int,
593-
volume_type: Literal["vast_share_type"],
594604
share_settings: file_share_create_params.CreateVastFileShareSerializerShareSettings | NotGiven = NOT_GIVEN,
595605
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
606+
type_name: Literal["vast"] | NotGiven = NOT_GIVEN,
607+
volume_type: Literal["vast_share_type"] | NotGiven = NOT_GIVEN,
596608
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
597609
# The extra values given here take precedence over values defined on the client or passed to this method.
598610
extra_headers: Headers | None = None,
@@ -614,8 +626,6 @@ async def create(
614626
615627
size: File share size
616628
617-
volume_type: File share volume type
618-
619629
share_settings: Configuration settings for the share
620630
621631
tags: Key-value tags to associate with the resource. A tag is a key-value pair that
@@ -624,6 +634,10 @@ async def create(
624634
modified by the user. Tags are also integrated with cost reports, allowing cost
625635
data to be filtered based on tag keys or values.
626636
637+
type_name: Vast file share type
638+
639+
volume_type: Deprecated. Use `type_name` instead.
640+
627641
extra_headers: Send extra headers
628642
629643
extra_query: Add additional query parameters to the request
@@ -634,7 +648,7 @@ async def create(
634648
"""
635649
...
636650

637-
@required_args(["name", "network", "protocol", "size"], ["name", "protocol", "size", "volume_type"])
651+
@required_args(["name", "network", "protocol", "size"], ["name", "protocol", "size"])
638652
async def create(
639653
self,
640654
*,
@@ -646,6 +660,7 @@ async def create(
646660
size: int,
647661
access: Iterable[file_share_create_params.CreateStandardFileShareSerializerAccess] | NotGiven = NOT_GIVEN,
648662
tags: Dict[str, str] | NotGiven = NOT_GIVEN,
663+
type_name: Literal["standard"] | Literal["vast"] | NotGiven = NOT_GIVEN,
649664
volume_type: Literal["default_share_type"] | Literal["vast_share_type"] | NotGiven = NOT_GIVEN,
650665
share_settings: file_share_create_params.CreateVastFileShareSerializerShareSettings | NotGiven = NOT_GIVEN,
651666
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -669,6 +684,7 @@ async def create(
669684
"size": size,
670685
"access": access,
671686
"tags": tags,
687+
"type_name": type_name,
672688
"volume_type": volume_type,
673689
"share_settings": share_settings,
674690
},

src/gcore/resources/cloud/inference/registry_credentials.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
registry_credential_replace_params,
2323
)
2424
from ....types.cloud.inference.inference_registry_credentials import InferenceRegistryCredentials
25-
from ....types.cloud.inference.inference_registry_credentials_create import InferenceRegistryCredentialsCreate
2625

2726
__all__ = ["RegistryCredentialsResource", "AsyncRegistryCredentialsResource"]
2827

@@ -61,7 +60,7 @@ def create(
6160
extra_query: Query | None = None,
6261
extra_body: Body | None = None,
6362
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64-
) -> InferenceRegistryCredentialsCreate:
63+
) -> InferenceRegistryCredentials:
6564
"""
6665
Create inference registry credential
6766
@@ -100,7 +99,7 @@ def create(
10099
options=make_request_options(
101100
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
102101
),
103-
cast_to=InferenceRegistryCredentialsCreate,
102+
cast_to=InferenceRegistryCredentials,
104103
)
105104

106105
def list(
@@ -251,7 +250,7 @@ def replace(
251250
extra_query: Query | None = None,
252251
extra_body: Body | None = None,
253252
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
254-
) -> InferenceRegistryCredentialsCreate:
253+
) -> InferenceRegistryCredentials:
255254
"""
256255
Replace inference registry credential
257256
@@ -291,7 +290,7 @@ def replace(
291290
options=make_request_options(
292291
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
293292
),
294-
cast_to=InferenceRegistryCredentialsCreate,
293+
cast_to=InferenceRegistryCredentials,
295294
)
296295

297296

@@ -329,7 +328,7 @@ async def create(
329328
extra_query: Query | None = None,
330329
extra_body: Body | None = None,
331330
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
332-
) -> InferenceRegistryCredentialsCreate:
331+
) -> InferenceRegistryCredentials:
333332
"""
334333
Create inference registry credential
335334
@@ -368,7 +367,7 @@ async def create(
368367
options=make_request_options(
369368
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
370369
),
371-
cast_to=InferenceRegistryCredentialsCreate,
370+
cast_to=InferenceRegistryCredentials,
372371
)
373372

374373
def list(
@@ -519,7 +518,7 @@ async def replace(
519518
extra_query: Query | None = None,
520519
extra_body: Body | None = None,
521520
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
522-
) -> InferenceRegistryCredentialsCreate:
521+
) -> InferenceRegistryCredentials:
523522
"""
524523
Replace inference registry credential
525524
@@ -559,7 +558,7 @@ async def replace(
559558
options=make_request_options(
560559
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
561560
),
562-
cast_to=InferenceRegistryCredentialsCreate,
561+
cast_to=InferenceRegistryCredentials,
563562
)
564563

565564

0 commit comments

Comments
 (0)