Skip to content

Commit cec6475

Browse files
feat(api): aggregated API specs update
1 parent 3440fbc commit cec6475

File tree

8 files changed

+242
-176
lines changed

8 files changed

+242
-176
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: 228
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-b76145629dcc7d96b116490429fbcb6fb4a9c12a3d0a738078a681973c14081d.yml
3-
openapi_spec_hash: 92240813810f5bc1b57c044484ca978e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-516ce876afb897cc3b1c0018510f6e5fb3d35fd8a5323ba374e7f115a7e825af.yml
3+
openapi_spec_hash: 3738369958f249df6dcff1d73f71b8d9
44
config_hash: 4ce0219e37d7ed52a8e999f415c64cd6

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

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def create(
9191
Create network
9292
9393
Args:
94+
project_id: Project ID
95+
96+
region_id: Region ID
97+
9498
name: Network name
9599
96100
create_router: Defaults to True
@@ -150,6 +154,12 @@ def update(
150154
Change network name
151155
152156
Args:
157+
project_id: Project ID
158+
159+
region_id: Region ID
160+
161+
network_id: Network ID
162+
153163
name: Name.
154164
155165
extra_headers: Send extra headers
@@ -182,7 +192,7 @@ def list(
182192
region_id: int | None = None,
183193
limit: int | NotGiven = NOT_GIVEN,
184194
offset: int | NotGiven = NOT_GIVEN,
185-
order_by: str | NotGiven = NOT_GIVEN,
195+
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
186196
tag_key: List[str] | NotGiven = NOT_GIVEN,
187197
tag_key_value: str | NotGiven = NOT_GIVEN,
188198
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -196,17 +206,23 @@ def list(
196206
List networks
197207
198208
Args:
199-
limit: Limit the number of returned limit request entities.
209+
project_id: Project ID
210+
211+
region_id: Region ID
212+
213+
limit: Optional. Limit the number of returned items
200214
201-
offset: Offset value is used to exclude the first set of records from the result.
215+
offset: Optional. Offset value is used to exclude the first set of records from the
216+
result
202217
203-
order_by: Order networks by fields and directions (name.asc). Default is `created_at.asc`.
218+
order_by: Ordering networks list result by `name`, `created_at` fields of the network and
219+
directions (`created_at.desc`).
204220
205-
tag_key: Filter by tag keys.
221+
tag_key: Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
206222
207-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
208-
--data-urlencode "tag_key_value={"key": "value"}" --url
209-
"http://localhost:1111/v1/networks/1/1"
223+
tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
224+
"tag_key_value={"key": "value"}" --url
225+
"https://example.com/cloud/v1/resource/1/1"
210226
211227
extra_headers: Send extra headers
212228
@@ -259,6 +275,12 @@ def delete(
259275
Delete network
260276
261277
Args:
278+
project_id: Project ID
279+
280+
region_id: Region ID
281+
282+
network_id: Network ID
283+
262284
extra_headers: Send extra headers
263285
264286
extra_query: Add additional query parameters to the request
@@ -298,6 +320,12 @@ def get(
298320
Get network
299321
300322
Args:
323+
project_id: Project ID
324+
325+
region_id: Region ID
326+
327+
network_id: Network ID
328+
301329
extra_headers: Send extra headers
302330
303331
extra_query: Add additional query parameters to the request
@@ -369,6 +397,10 @@ async def create(
369397
Create network
370398
371399
Args:
400+
project_id: Project ID
401+
402+
region_id: Region ID
403+
372404
name: Network name
373405
374406
create_router: Defaults to True
@@ -428,6 +460,12 @@ async def update(
428460
Change network name
429461
430462
Args:
463+
project_id: Project ID
464+
465+
region_id: Region ID
466+
467+
network_id: Network ID
468+
431469
name: Name.
432470
433471
extra_headers: Send extra headers
@@ -460,7 +498,7 @@ def list(
460498
region_id: int | None = None,
461499
limit: int | NotGiven = NOT_GIVEN,
462500
offset: int | NotGiven = NOT_GIVEN,
463-
order_by: str | NotGiven = NOT_GIVEN,
501+
order_by: Literal["created_at.asc", "created_at.desc", "name.asc", "name.desc"] | NotGiven = NOT_GIVEN,
464502
tag_key: List[str] | NotGiven = NOT_GIVEN,
465503
tag_key_value: str | NotGiven = NOT_GIVEN,
466504
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -474,17 +512,23 @@ def list(
474512
List networks
475513
476514
Args:
477-
limit: Limit the number of returned limit request entities.
515+
project_id: Project ID
516+
517+
region_id: Region ID
518+
519+
limit: Optional. Limit the number of returned items
478520
479-
offset: Offset value is used to exclude the first set of records from the result.
521+
offset: Optional. Offset value is used to exclude the first set of records from the
522+
result
480523
481-
order_by: Order networks by fields and directions (name.asc). Default is `created_at.asc`.
524+
order_by: Ordering networks list result by `name`, `created_at` fields of the network and
525+
directions (`created_at.desc`).
482526
483-
tag_key: Filter by tag keys.
527+
tag_key: Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
484528
485-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
486-
--data-urlencode "tag_key_value={"key": "value"}" --url
487-
"http://localhost:1111/v1/networks/1/1"
529+
tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
530+
"tag_key_value={"key": "value"}" --url
531+
"https://example.com/cloud/v1/resource/1/1"
488532
489533
extra_headers: Send extra headers
490534
@@ -537,6 +581,12 @@ async def delete(
537581
Delete network
538582
539583
Args:
584+
project_id: Project ID
585+
586+
region_id: Region ID
587+
588+
network_id: Network ID
589+
540590
extra_headers: Send extra headers
541591
542592
extra_query: Add additional query parameters to the request
@@ -576,6 +626,12 @@ async def get(
576626
Get network
577627
578628
Args:
629+
project_id: Project ID
630+
631+
region_id: Region ID
632+
633+
network_id: Network ID
634+
579635
extra_headers: Send extra headers
580636
581637
extra_query: Add additional query parameters to the request

src/gcore/types/cloud/network.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@ class Network(BaseModel):
1616
created_at: datetime
1717
"""Datetime when the network was created"""
1818

19+
creator_task_id: Optional[str] = None
20+
"""Task that created this entity"""
21+
22+
default: Optional[bool] = None
23+
"""True if network has is_default attribute"""
24+
1925
external: bool
2026
"""True if the network `router:external` attribute"""
2127

28+
mtu: int
29+
"""MTU (maximum transmission unit). Default value is 1450"""
30+
2231
name: str
2332
"""Network name"""
2433

@@ -28,12 +37,18 @@ class Network(BaseModel):
2837
ports.
2938
"""
3039

40+
project_id: Optional[int] = None
41+
"""Project ID"""
42+
3143
region: str
3244
"""Region name"""
3345

3446
region_id: int
3547
"""Region ID"""
3648

49+
segmentation_id: Optional[int] = None
50+
"""Id of network segment"""
51+
3752
shared: bool
3853
"""True when the network is shared with your project by external owner"""
3954

@@ -50,30 +65,15 @@ class Network(BaseModel):
5065
values.
5166
"""
5267

53-
type: str
54-
"""Network type (vlan, vxlan)"""
55-
56-
updated_at: datetime
57-
"""Datetime when the network was last updated"""
58-
59-
creator_task_id: Optional[str] = None
60-
"""Task that created this entity"""
61-
62-
default: Optional[bool] = None
63-
"""True if network has is_default attribute"""
64-
65-
mtu: Optional[int] = None
66-
"""MTU (maximum transmission unit). Default value is 1450"""
67-
68-
project_id: Optional[int] = None
69-
"""Project ID"""
70-
71-
segmentation_id: Optional[int] = None
72-
"""Id of network segment"""
73-
7468
task_id: Optional[str] = None
7569
"""The UUID of the active task that currently holds a lock on the resource.
7670
7771
This lock prevents concurrent modifications to ensure consistency. If `null`,
7872
the resource is not locked.
7973
"""
74+
75+
type: str
76+
"""Network type (vlan, vxlan)"""
77+
78+
updated_at: datetime
79+
"""Datetime when the network was last updated"""

src/gcore/types/cloud/network_create_params.py

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

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

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

1719
name: Required[str]
1820
"""Network name"""

src/gcore/types/cloud/network_details.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ class NetworkDetails(BaseModel):
1717
created_at: datetime
1818
"""Datetime when the network was created"""
1919

20+
creator_task_id: Optional[str] = None
21+
"""Task that created this entity"""
22+
23+
default: Optional[bool] = None
24+
"""True if network has is_default attribute"""
25+
2026
external: bool
2127
"""True if the network `router:external` attribute"""
2228

29+
mtu: int
30+
"""MTU (maximum transmission unit). Default value is 1450"""
31+
2332
name: str
2433
"""Network name"""
2534

@@ -29,15 +38,24 @@ class NetworkDetails(BaseModel):
2938
ports.
3039
"""
3140

41+
project_id: Optional[int] = None
42+
"""Project ID"""
43+
3244
region: str
3345
"""Region name"""
3446

3547
region_id: int
3648
"""Region ID"""
3749

50+
segmentation_id: Optional[int] = None
51+
"""Id of network segment"""
52+
3853
shared: bool
3954
"""True when the network is shared with your project by external owner"""
4055

56+
subnets: List[Subnet]
57+
"""List of subnets associated with the network"""
58+
4159
tags: List[Tag]
4260
"""List of key-value tags associated with the resource.
4361
@@ -48,32 +66,15 @@ class NetworkDetails(BaseModel):
4866
values.
4967
"""
5068

51-
type: str
52-
"""Network type (vlan, vxlan)"""
53-
54-
updated_at: datetime
55-
"""Datetime when the network was last updated"""
56-
57-
creator_task_id: Optional[str] = None
58-
"""Task that created this entity"""
59-
60-
default: Optional[bool] = None
61-
"""True if network has is_default attribute"""
62-
63-
mtu: Optional[int] = None
64-
"""MTU (maximum transmission unit). Default value is 1450"""
65-
66-
project_id: Optional[int] = None
67-
"""Project ID"""
68-
69-
segmentation_id: Optional[int] = None
70-
"""Id of network segment"""
71-
72-
subnets: Optional[List[Subnet]] = None
73-
7469
task_id: Optional[str] = None
7570
"""The UUID of the active task that currently holds a lock on the resource.
7671
7772
This lock prevents concurrent modifications to ensure consistency. If `null`,
7873
the resource is not locked.
7974
"""
75+
76+
type: str
77+
"""Network type (vlan, vxlan)"""
78+
79+
updated_at: datetime
80+
"""Datetime when the network was last updated"""

0 commit comments

Comments
 (0)