Skip to content

Commit d86ee7e

Browse files
feat(api): aggregated API specs update
1 parent 5b1a006 commit d86ee7e

9 files changed

Lines changed: 91 additions & 42 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 658
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-e128a0c1518f62ae83e9fd3aa7d1d013b55757b67e5337dc52cbd2b4a6d5f345.yml
3-
openapi_spec_hash: db61fc5104185717f132c4601b33fffa
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-c0227d112d00ea1367115bffc78528aae50c3bef4b763b67f291c20da36e759c.yml
3+
openapi_spec_hash: 728075186aa56e84ef78f6df633242e7
44
config_hash: 1eeaf5413c25f32913ceebe18d37cc3e

src/gcore/resources/cloud/networks/routers.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ def create(
7676
Create a new router with the specified configuration.
7777
7878
Args:
79+
project_id: Project ID
80+
81+
region_id: Region ID
82+
7983
name: name of router
8084
8185
external_gateway_info: External gateway configuration. Use type 'default' to let the platform
@@ -188,6 +192,7 @@ def list(
188192
project_id: int | None = None,
189193
region_id: int | None = None,
190194
limit: int | Omit = omit,
195+
name: str | Omit = omit,
191196
offset: int | Omit = omit,
192197
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
193198
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -200,9 +205,15 @@ def list(
200205
List all routers in the specified project and region.
201206
202207
Args:
203-
limit: Limit the number of returned routers
208+
project_id: Project ID
209+
210+
region_id: Region ID
211+
212+
limit: Limit of items on a single page
213+
214+
name: Optional. Filter routers by name
204215
205-
offset: Offset value is used to exclude the first set of records from the result
216+
offset: Offset in results list
206217
207218
extra_headers: Send extra headers
208219
@@ -227,6 +238,7 @@ def list(
227238
query=maybe_transform(
228239
{
229240
"limit": limit,
241+
"name": name,
230242
"offset": offset,
231243
},
232244
router_list_params.RouterListParams,
@@ -480,6 +492,10 @@ async def create(
480492
Create a new router with the specified configuration.
481493
482494
Args:
495+
project_id: Project ID
496+
497+
region_id: Region ID
498+
483499
name: name of router
484500
485501
external_gateway_info: External gateway configuration. Use type 'default' to let the platform
@@ -592,6 +608,7 @@ def list(
592608
project_id: int | None = None,
593609
region_id: int | None = None,
594610
limit: int | Omit = omit,
611+
name: str | Omit = omit,
595612
offset: int | Omit = omit,
596613
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
597614
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -604,9 +621,15 @@ def list(
604621
List all routers in the specified project and region.
605622
606623
Args:
607-
limit: Limit the number of returned routers
624+
project_id: Project ID
625+
626+
region_id: Region ID
627+
628+
limit: Limit of items on a single page
629+
630+
name: Optional. Filter routers by name
608631
609-
offset: Offset value is used to exclude the first set of records from the result
632+
offset: Offset in results list
610633
611634
extra_headers: Send extra headers
612635
@@ -631,6 +654,7 @@ def list(
631654
query=maybe_transform(
632655
{
633656
"limit": limit,
657+
"name": name,
634658
"offset": offset,
635659
},
636660
router_list_params.RouterListParams,

src/gcore/types/cloud/gpu_baremetal/clusters/gpu_baremetal_cluster_server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class GPUBaremetalClusterServer(BaseModel):
2828
flavor: str
2929
"""Unique flavor identifier"""
3030

31+
has_pending_changes: bool
32+
"""True if there are pending (not yet applied) server settings changes"""
33+
3134
image_id: Optional[str] = None
3235
"""Server's image UUID"""
3336

src/gcore/types/cloud/gpu_baremetal/gpu_baremetal_cluster.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ class GPUBaremetalCluster(BaseModel):
131131
flavor: str
132132
"""Cluster flavor name"""
133133

134+
has_pending_changes: bool
135+
"""
136+
True if any server in the cluster has pending (not yet applied) settings changes
137+
"""
138+
134139
image_id: str
135140
"""Image ID"""
136141

src/gcore/types/cloud/gpu_virtual/clusters/gpu_virtual_cluster_server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class GPUVirtualClusterServer(BaseModel):
2828
flavor: str
2929
"""Unique flavor identifier"""
3030

31+
has_pending_changes: bool
32+
"""True if there are pending (not yet applied) server settings changes"""
33+
3134
image_id: Optional[str] = None
3235
"""Server's image UUID"""
3336

src/gcore/types/cloud/gpu_virtual/gpu_virtual_cluster.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ class GPUVirtualCluster(BaseModel):
165165
flavor: str
166166
"""Cluster flavor name"""
167167

168+
has_pending_changes: bool
169+
"""
170+
True if any server in the cluster has pending (not yet applied) settings changes
171+
"""
172+
168173
name: str
169174
"""Cluster name"""
170175

src/gcore/types/cloud/networks/router_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818
class RouterCreateParams(TypedDict, total=False):
1919
project_id: int
20+
"""Project ID"""
2021

2122
region_id: int
23+
"""Region ID"""
2224

2325
name: Required[str]
2426
"""name of router"""

src/gcore/types/cloud/networks/router_list_params.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99

1010
class RouterListParams(TypedDict, total=False):
1111
project_id: int
12+
"""Project ID"""
1213

1314
region_id: int
15+
"""Region ID"""
1416

1517
limit: int
16-
"""Limit the number of returned routers"""
18+
"""Limit of items on a single page"""
19+
20+
name: str
21+
"""Optional. Filter routers by name"""
1722

1823
offset: int
19-
"""Offset value is used to exclude the first set of records from the result"""
24+
"""Offset in results list"""

tests/api_resources/cloud/networks/test_routers.py

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ class TestRouters:
2626
@parametrize
2727
def test_method_create(self, client: Gcore) -> None:
2828
router = client.cloud.networks.routers.create(
29-
project_id=0,
30-
region_id=0,
29+
project_id=1,
30+
region_id=1,
3131
name="my_wonderful_router",
3232
)
3333
assert_matches_type(TaskIDList, router, path=["response"])
3434

3535
@parametrize
3636
def test_method_create_with_all_params(self, client: Gcore) -> None:
3737
router = client.cloud.networks.routers.create(
38-
project_id=0,
39-
region_id=0,
38+
project_id=1,
39+
region_id=1,
4040
name="my_wonderful_router",
4141
external_gateway_info={
4242
"enable_snat": True,
@@ -60,8 +60,8 @@ def test_method_create_with_all_params(self, client: Gcore) -> None:
6060
@parametrize
6161
def test_raw_response_create(self, client: Gcore) -> None:
6262
response = client.cloud.networks.routers.with_raw_response.create(
63-
project_id=0,
64-
region_id=0,
63+
project_id=1,
64+
region_id=1,
6565
name="my_wonderful_router",
6666
)
6767

@@ -73,8 +73,8 @@ def test_raw_response_create(self, client: Gcore) -> None:
7373
@parametrize
7474
def test_streaming_response_create(self, client: Gcore) -> None:
7575
with client.cloud.networks.routers.with_streaming_response.create(
76-
project_id=0,
77-
region_id=0,
76+
project_id=1,
77+
region_id=1,
7878
name="my_wonderful_router",
7979
) as response:
8080
assert not response.is_closed
@@ -162,26 +162,27 @@ def test_path_params_update(self, client: Gcore) -> None:
162162
@parametrize
163163
def test_method_list(self, client: Gcore) -> None:
164164
router = client.cloud.networks.routers.list(
165-
project_id=0,
166-
region_id=0,
165+
project_id=1,
166+
region_id=1,
167167
)
168168
assert_matches_type(SyncOffsetPage[Router], router, path=["response"])
169169

170170
@parametrize
171171
def test_method_list_with_all_params(self, client: Gcore) -> None:
172172
router = client.cloud.networks.routers.list(
173-
project_id=0,
174-
region_id=0,
175-
limit=0,
173+
project_id=1,
174+
region_id=1,
175+
limit=10,
176+
name="router-name",
176177
offset=0,
177178
)
178179
assert_matches_type(SyncOffsetPage[Router], router, path=["response"])
179180

180181
@parametrize
181182
def test_raw_response_list(self, client: Gcore) -> None:
182183
response = client.cloud.networks.routers.with_raw_response.list(
183-
project_id=0,
184-
region_id=0,
184+
project_id=1,
185+
region_id=1,
185186
)
186187

187188
assert response.is_closed is True
@@ -192,8 +193,8 @@ def test_raw_response_list(self, client: Gcore) -> None:
192193
@parametrize
193194
def test_streaming_response_list(self, client: Gcore) -> None:
194195
with client.cloud.networks.routers.with_streaming_response.list(
195-
project_id=0,
196-
region_id=0,
196+
project_id=1,
197+
region_id=1,
197198
) as response:
198199
assert not response.is_closed
199200
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -415,17 +416,17 @@ class TestAsyncRouters:
415416
@parametrize
416417
async def test_method_create(self, async_client: AsyncGcore) -> None:
417418
router = await async_client.cloud.networks.routers.create(
418-
project_id=0,
419-
region_id=0,
419+
project_id=1,
420+
region_id=1,
420421
name="my_wonderful_router",
421422
)
422423
assert_matches_type(TaskIDList, router, path=["response"])
423424

424425
@parametrize
425426
async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None:
426427
router = await async_client.cloud.networks.routers.create(
427-
project_id=0,
428-
region_id=0,
428+
project_id=1,
429+
region_id=1,
429430
name="my_wonderful_router",
430431
external_gateway_info={
431432
"enable_snat": True,
@@ -449,8 +450,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) ->
449450
@parametrize
450451
async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
451452
response = await async_client.cloud.networks.routers.with_raw_response.create(
452-
project_id=0,
453-
region_id=0,
453+
project_id=1,
454+
region_id=1,
454455
name="my_wonderful_router",
455456
)
456457

@@ -462,8 +463,8 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None:
462463
@parametrize
463464
async def test_streaming_response_create(self, async_client: AsyncGcore) -> None:
464465
async with async_client.cloud.networks.routers.with_streaming_response.create(
465-
project_id=0,
466-
region_id=0,
466+
project_id=1,
467+
region_id=1,
467468
name="my_wonderful_router",
468469
) as response:
469470
assert not response.is_closed
@@ -551,26 +552,27 @@ async def test_path_params_update(self, async_client: AsyncGcore) -> None:
551552
@parametrize
552553
async def test_method_list(self, async_client: AsyncGcore) -> None:
553554
router = await async_client.cloud.networks.routers.list(
554-
project_id=0,
555-
region_id=0,
555+
project_id=1,
556+
region_id=1,
556557
)
557558
assert_matches_type(AsyncOffsetPage[Router], router, path=["response"])
558559

559560
@parametrize
560561
async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None:
561562
router = await async_client.cloud.networks.routers.list(
562-
project_id=0,
563-
region_id=0,
564-
limit=0,
563+
project_id=1,
564+
region_id=1,
565+
limit=10,
566+
name="router-name",
565567
offset=0,
566568
)
567569
assert_matches_type(AsyncOffsetPage[Router], router, path=["response"])
568570

569571
@parametrize
570572
async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
571573
response = await async_client.cloud.networks.routers.with_raw_response.list(
572-
project_id=0,
573-
region_id=0,
574+
project_id=1,
575+
region_id=1,
574576
)
575577

576578
assert response.is_closed is True
@@ -581,8 +583,8 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None:
581583
@parametrize
582584
async def test_streaming_response_list(self, async_client: AsyncGcore) -> None:
583585
async with async_client.cloud.networks.routers.with_streaming_response.list(
584-
project_id=0,
585-
region_id=0,
586+
project_id=1,
587+
region_id=1,
586588
) as response:
587589
assert not response.is_closed
588590
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)