Skip to content

Commit f263699

Browse files
feat(api): aggregated API specs update
1 parent 124c704 commit f263699

29 files changed

Lines changed: 351 additions & 234 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 657
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-a107ecd97693fac42644652cc172ba826f45932f24eea884a4b17446cf6e0b00.yml
3-
openapi_spec_hash: 7090ae2ceff4174353a8aa2f860f5946
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-c30b070f2f0ce73f80dfb6c950d3e46672acaedef0a7f011e75065477779bdf6.yml
3+
openapi_spec_hash: 56a6b5ca8f97983419b03f5e33b36594
44
config_hash: ab6b5443d52ca04e4e0e12def131f8e6

src/gcore/resources/cloud/api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,15 @@ Methods:
646646

647647
### Images
648648

649+
Types:
650+
651+
```python
652+
from gcore.types.cloud.baremetal import ImageListResponse
653+
```
654+
649655
Methods:
650656

651-
- <code title="get /cloud/v1/bmimages/{project_id}/{region_id}">client.cloud.baremetal.images.<a href="./src/gcore/resources/cloud/baremetal/images.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/baremetal/image_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/image_list.py">ImageList</a></code>
657+
- <code title="get /cloud/v1/bmimages/{project_id}/{region_id}">client.cloud.baremetal.images.<a href="./src/gcore/resources/cloud/baremetal/images.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/baremetal/image_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/baremetal/image_list_response.py">ImageListResponse</a></code>
652658

653659
### Flavors
654660

src/gcore/resources/cloud/baremetal/images.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919
from ...._base_client import make_request_options
2020
from ....types.cloud.baremetal import image_list_params
21-
from ....types.cloud.image_list import ImageList
21+
from ....types.cloud.baremetal.image_list_response import ImageListResponse
2222

2323
__all__ = ["ImagesResource", "AsyncImagesResource"]
2424

@@ -59,21 +59,25 @@ def list(
5959
extra_query: Query | None = None,
6060
extra_body: Body | None = None,
6161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
62-
) -> ImageList:
62+
) -> ImageListResponse:
6363
"""Retrieve a list of available images for bare metal servers.
6464
6565
The list can be
6666
filtered by visibility, tags, and other parameters. Returned entities may or may
6767
not be owned by the project.
6868
6969
Args:
70-
include_prices: Show price
70+
project_id: Project ID
71+
72+
region_id: Region ID
73+
74+
include_prices: Show price.
7175
7276
private: Any value to show private images
7377
74-
tag_key: Filter by tag keys.
78+
tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
7579
76-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
80+
tag_key_value: Optional. Filter by tag key-value pairs.
7781
7882
visibility: Image visibility. Globally visible images are public
7983
@@ -107,7 +111,7 @@ def list(
107111
image_list_params.ImageListParams,
108112
),
109113
),
110-
cast_to=ImageList,
114+
cast_to=ImageListResponse,
111115
)
112116

113117

@@ -147,21 +151,25 @@ async def list(
147151
extra_query: Query | None = None,
148152
extra_body: Body | None = None,
149153
timeout: float | httpx.Timeout | None | NotGiven = not_given,
150-
) -> ImageList:
154+
) -> ImageListResponse:
151155
"""Retrieve a list of available images for bare metal servers.
152156
153157
The list can be
154158
filtered by visibility, tags, and other parameters. Returned entities may or may
155159
not be owned by the project.
156160
157161
Args:
158-
include_prices: Show price
162+
project_id: Project ID
163+
164+
region_id: Region ID
165+
166+
include_prices: Show price.
159167
160168
private: Any value to show private images
161169
162-
tag_key: Filter by tag keys.
170+
tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
163171
164-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
172+
tag_key_value: Optional. Filter by tag key-value pairs.
165173
166174
visibility: Image visibility. Globally visible images are public
167175
@@ -195,7 +203,7 @@ async def list(
195203
image_list_params.ImageListParams,
196204
),
197205
),
198-
cast_to=ImageList,
206+
cast_to=ImageListResponse,
199207
)
200208

201209

src/gcore/resources/cloud/instances/images.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,17 @@ def list(
163163
by the project or are public/shared with the client.
164164
165165
Args:
166-
include_prices: Show price
166+
project_id: Project ID
167+
168+
region_id: Region ID
169+
170+
include_prices: Show price.
167171
168172
private: Any value to show private images
169173
170-
tag_key: Filter by tag keys.
174+
tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
171175
172-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
176+
tag_key_value: Optional. Filter by tag key-value pairs.
173177
174178
visibility: Image visibility. Globally visible images are public
175179
@@ -316,6 +320,10 @@ def create_from_volume(
316320
an image from it.
317321
318322
Args:
323+
project_id: Project ID
324+
325+
region_id: Region ID
326+
319327
name: Image name
320328
321329
volume_id: Required if source is volume. Volume id
@@ -785,13 +793,17 @@ async def list(
785793
by the project or are public/shared with the client.
786794
787795
Args:
788-
include_prices: Show price
796+
project_id: Project ID
797+
798+
region_id: Region ID
799+
800+
include_prices: Show price.
789801
790802
private: Any value to show private images
791803
792-
tag_key: Filter by tag keys.
804+
tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
793805
794-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
806+
tag_key_value: Optional. Filter by tag key-value pairs.
795807
796808
visibility: Image visibility. Globally visible images are public
797809
@@ -938,6 +950,10 @@ async def create_from_volume(
938950
an image from it.
939951
940952
Args:
953+
project_id: Project ID
954+
955+
region_id: Region ID
956+
941957
name: Image name
942958
943959
volume_id: Required if source is volume. Volume id

src/gcore/types/cloud/baremetal/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .image_list_params import ImageListParams as ImageListParams
77
from .flavor_list_params import FlavorListParams as FlavorListParams
88
from .server_list_params import ServerListParams as ServerListParams
9+
from .image_list_response import ImageListResponse as ImageListResponse
910
from .server_create_params import ServerCreateParams as ServerCreateParams
1011
from .server_delete_params import ServerDeleteParams as ServerDeleteParams
1112
from .server_update_params import ServerUpdateParams as ServerUpdateParams

src/gcore/types/cloud/baremetal/image_list_params.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,22 @@
1111

1212
class ImageListParams(TypedDict, total=False):
1313
project_id: int
14+
"""Project ID"""
1415

1516
region_id: int
17+
"""Region ID"""
1618

1719
include_prices: bool
18-
"""Show price"""
20+
"""Show price."""
1921

2022
private: str
2123
"""Any value to show private images"""
2224

2325
tag_key: SequenceNotStr[str]
24-
"""Filter by tag keys."""
26+
"""Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2"""
2527

2628
tag_key_value: str
27-
"""Filter by tag key-value pairs. Must be a valid JSON string."""
29+
"""Optional. Filter by tag key-value pairs."""
2830

2931
visibility: Literal["private", "public", "shared"]
3032
"""Image visibility. Globally visible images are public"""
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from ..tag import Tag
8+
from ...._models import BaseModel
9+
10+
__all__ = ["ImageListResponse", "Result"]
11+
12+
13+
class Result(BaseModel):
14+
id: str
15+
"""Image ID"""
16+
17+
architecture: Literal["aarch64", "x86_64"]
18+
"""An image architecture type: aarch64, `x86_64`."""
19+
20+
created_at: datetime
21+
"""Datetime when the image was created"""
22+
23+
creator_task_id: Optional[str] = None
24+
"""Task that created this entity"""
25+
26+
currency_code: Optional[str] = None
27+
"""Currency code. Shown if the `include_prices` query parameter if set to true"""
28+
29+
description: Optional[str] = None
30+
"""Image description"""
31+
32+
disk_format: str
33+
"""Disk format"""
34+
35+
display_order: Optional[int] = None
36+
37+
gpu_driver: Optional[str] = None
38+
"""Name of the GPU driver vendor"""
39+
40+
gpu_driver_type: Optional[str] = None
41+
"""Type of the GPU driver"""
42+
43+
gpu_driver_version: Optional[str] = None
44+
"""Version of the installed GPU driver"""
45+
46+
hw_firmware_type: Optional[Literal["bios", "uefi"]] = None
47+
"""Specifies the type of firmware with which to boot the guest."""
48+
49+
hw_machine_type: Optional[Literal["pc", "q35"]] = None
50+
"""A virtual chipset type."""
51+
52+
is_baremetal: Optional[bool] = None
53+
"""For bare metal servers this value is always set to true"""
54+
55+
min_disk: int
56+
"""Minimal boot volume required"""
57+
58+
min_ram: int
59+
"""Minimal VM RAM required"""
60+
61+
name: str
62+
"""Image display name"""
63+
64+
os_distro: str
65+
"""OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc."""
66+
67+
os_type: Literal["linux", "windows"]
68+
"""The operating system installed on the image."""
69+
70+
os_version: str
71+
"""OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian"""
72+
73+
price_per_hour: Optional[float] = None
74+
"""Price per hour. Shown if the `include_prices` query parameter if set to true"""
75+
76+
price_per_month: Optional[float] = None
77+
"""Price per month. Shown if the `include_prices` query parameter if set to true"""
78+
79+
price_status: Optional[Literal["error", "hide", "show"]] = None
80+
"""Price status for the UI"""
81+
82+
project_id: int
83+
"""Project ID"""
84+
85+
region: str
86+
"""Region name"""
87+
88+
region_id: int
89+
"""Region ID"""
90+
91+
size: Optional[int] = None
92+
"""Image size in bytes"""
93+
94+
ssh_key: Optional[Literal["allow", "deny", "required"]] = None
95+
"""Whether the image supports SSH key or not"""
96+
97+
status: str
98+
"""Image status, i.e. active"""
99+
100+
tags: List[Tag]
101+
"""List of key-value tags associated with the resource.
102+
103+
A tag is a key-value pair that can be associated with a resource, enabling
104+
efficient filtering and grouping for better organization and management. Some
105+
tags are read-only and cannot be modified by the user. Tags are also integrated
106+
with cost reports, allowing cost data to be filtered based on tag keys or
107+
values.
108+
"""
109+
110+
task_id: Optional[str] = None
111+
"""The UUID of the active task that currently holds a lock on the resource.
112+
113+
This lock prevents concurrent modifications to ensure consistency. If `null`,
114+
the resource is not locked.
115+
"""
116+
117+
updated_at: datetime
118+
"""Datetime when the image was updated"""
119+
120+
visibility: str
121+
"""Image visibility. Globally visible images are public"""
122+
123+
124+
class ImageListResponse(BaseModel):
125+
count: int
126+
"""Number of objects"""
127+
128+
results: List[Result]
129+
"""Objects"""

src/gcore/types/cloud/baremetal/server_create_params.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,11 @@ class InterfaceCreateBareMetalReservedFixedIPInterfaceSerializer(TypedDict, tota
353353

354354

355355
class DDOSProfileField(TypedDict, total=False):
356-
base_field: Optional[int]
356+
base_field: Required[int]
357357
"""Unique identifier of the DDoS protection field being configured"""
358358

359359
field_value: object
360360

361-
value: Optional[str]
362-
"""Basic type value. Only one of 'value' or 'field_value' must be specified."""
363-
364361

365362
class DDOSProfile(TypedDict, total=False):
366363
"""Enable advanced DDoS protection for the server"""

src/gcore/types/cloud/billing_reservation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Commit(BaseModel):
4848
price_total: str
4949
"""Total price for the reservation period for the full reserved amount"""
5050

51-
subscription_id: int
51+
subscription_id: Optional[int] = None
5252
"""Billing subscription ID for commit"""
5353

5454

src/gcore/types/cloud/cost_report_aggregated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class ResultTotalEgressTrafficWithCostSerializer(BaseModel):
253253
err: Optional[str] = None
254254
"""Error message"""
255255

256-
instance_type: Literal["baremetal", "vm"]
256+
instance_type: Literal["baremetal", "router", "vm"]
257257
"""Type of the instance"""
258258

259259
region: int

0 commit comments

Comments
 (0)