gcore 0.3.0__py3-none-any.whl → 0.4.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.
- gcore/__init__.py +2 -1
- gcore/_base_client.py +22 -0
- gcore/_client.py +9 -0
- gcore/_version.py +1 -1
- gcore/pagination.py +61 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/baremetal/flavors.py +11 -137
- gcore/resources/cloud/baremetal/images.py +10 -12
- gcore/resources/cloud/baremetal/servers.py +31 -28
- gcore/resources/cloud/billing_reservations.py +2 -2
- gcore/resources/cloud/file_shares/file_shares.py +7 -8
- gcore/resources/cloud/floating_ips.py +7 -12
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +31 -20
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +9 -10
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -2
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +8 -4
- gcore/resources/cloud/inference/deployments/deployments.py +10 -2
- gcore/resources/cloud/inference/registry_credentials.py +2 -2
- gcore/resources/cloud/inference/secrets.py +8 -8
- gcore/resources/cloud/instances/flavors.py +9 -233
- gcore/resources/cloud/instances/images.py +47 -37
- gcore/resources/cloud/instances/instances.py +47 -32
- gcore/resources/cloud/instances/interfaces.py +2 -2
- gcore/resources/cloud/ip_ranges.py +34 -2
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +10 -2
- gcore/resources/cloud/load_balancers/listeners.py +17 -8
- gcore/resources/cloud/load_balancers/load_balancers.py +73 -21
- gcore/resources/cloud/load_balancers/metrics.py +2 -2
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +2 -2
- gcore/resources/cloud/load_balancers/pools/members.py +6 -2
- gcore/resources/cloud/networks/networks.py +81 -17
- gcore/resources/cloud/networks/routers.py +18 -18
- gcore/resources/cloud/networks/subnets.py +51 -11
- gcore/resources/cloud/projects.py +38 -24
- gcore/resources/cloud/quotas/quotas.py +6 -6
- gcore/resources/cloud/quotas/requests.py +8 -8
- gcore/resources/cloud/registries/artifacts.py +4 -4
- gcore/resources/cloud/registries/registries.py +14 -16
- gcore/resources/cloud/registries/repositories.py +4 -4
- gcore/resources/cloud/registries/tags.py +2 -2
- gcore/resources/cloud/registries/users.py +21 -22
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +20 -20
- gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -10
- gcore/resources/cloud/security_groups/rules.py +6 -6
- gcore/resources/cloud/security_groups/security_groups.py +70 -31
- gcore/resources/cloud/tasks.py +4 -4
- gcore/resources/cloud/users/role_assignments.py +12 -14
- gcore/resources/cloud/volumes.py +139 -49
- gcore/resources/iam/__init__.py +47 -0
- gcore/resources/iam/api_tokens.py +521 -0
- gcore/resources/iam/iam.py +199 -0
- gcore/resources/iam/users.py +642 -0
- gcore/resources/waap/__init__.py +0 -14
- gcore/resources/waap/waap.py +0 -32
- gcore/types/cloud/baremetal/__init__.py +0 -1
- gcore/types/cloud/baremetal/image_list_params.py +1 -5
- gcore/types/cloud/baremetal/server_create_params.py +4 -8
- gcore/types/cloud/baremetal/server_list_params.py +1 -5
- gcore/types/cloud/ddos_profile.py +9 -3
- gcore/types/cloud/file_share_create_params.py +3 -5
- gcore/types/cloud/floating_ip_create_params.py +2 -4
- gcore/types/cloud/floating_ip_list_params.py +1 -5
- gcore/types/cloud/gpu_baremetal_cluster_create_params.py +2 -3
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +2 -4
- gcore/types/cloud/health_monitor.py +6 -1
- gcore/types/cloud/instance_create_params.py +7 -8
- gcore/types/cloud/instance_list_params.py +1 -5
- gcore/types/cloud/instances/__init__.py +0 -2
- gcore/types/cloud/instances/image_create_from_volume_params.py +2 -4
- gcore/types/cloud/instances/image_list_params.py +1 -5
- gcore/types/cloud/instances/image_upload_params.py +2 -4
- gcore/types/cloud/load_balancer_create_params.py +8 -4
- gcore/types/cloud/load_balancer_list_params.py +1 -5
- gcore/types/cloud/load_balancer_update_params.py +24 -0
- gcore/types/cloud/load_balancers/pool_create_params.py +6 -1
- gcore/types/cloud/load_balancers/pool_update_params.py +6 -1
- gcore/types/cloud/load_balancers/pools/member_add_params.py +6 -1
- gcore/types/cloud/member.py +6 -1
- gcore/types/cloud/network_create_params.py +2 -3
- gcore/types/cloud/network_list_params.py +4 -5
- gcore/types/cloud/network_update_params.py +28 -2
- gcore/types/cloud/networks/router_list_params.py +2 -2
- gcore/types/cloud/networks/subnet_create_params.py +2 -3
- gcore/types/cloud/networks/subnet_list_params.py +1 -5
- gcore/types/cloud/networks/subnet_update_params.py +25 -0
- gcore/types/cloud/registries/__init__.py +1 -0
- gcore/types/cloud/registries/user_refresh_secret_response.py +31 -0
- gcore/types/cloud/reserved_fixed_ip_list_params.py +2 -2
- gcore/types/cloud/security_group_list_params.py +3 -7
- gcore/types/cloud/security_group_update_params.py +25 -0
- gcore/types/cloud/tag_update_map_param.py +2 -2
- gcore/types/cloud/volume_list_params.py +1 -5
- gcore/types/cloud/volume_update_params.py +29 -3
- gcore/types/iam/__init__.py +17 -0
- gcore/types/iam/account_overview.py +488 -0
- gcore/types/iam/api_token.py +78 -0
- gcore/types/iam/api_token_create.py +15 -0
- gcore/types/iam/api_token_create_params.py +42 -0
- gcore/types/iam/api_token_list.py +81 -0
- gcore/types/iam/api_token_list_params.py +41 -0
- gcore/types/iam/user.py +86 -0
- gcore/types/iam/user_detailed.py +104 -0
- gcore/types/iam/user_invite.py +15 -0
- gcore/types/iam/user_invite_params.py +37 -0
- gcore/types/iam/user_list_params.py +15 -0
- gcore/types/iam/user_update.py +104 -0
- gcore/types/iam/user_update_params.py +52 -0
- gcore/types/waap/__init__.py +0 -1
- gcore/types/waap/domains/custom_rule_create_params.py +7 -3
- gcore/types/waap/domains/custom_rule_update_params.py +7 -3
- gcore/types/waap/waap_custom_rule.py +7 -3
- {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/METADATA +40 -3
- {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/RECORD +115 -101
- gcore/resources/waap/clients.py +0 -135
- gcore/types/cloud/baremetal/flavor_list_suitable_params.py +0 -22
- gcore/types/cloud/instances/flavor_list_for_resize_params.py +0 -16
- gcore/types/cloud/instances/flavor_list_suitable_params.py +0 -59
- gcore/types/waap/client_me_response.py +0 -34
- {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/WHEEL +0 -0
- {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -63,7 +63,7 @@ class VipResource(SyncAPIResource):
|
|
|
63
63
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
64
64
|
) -> CandidatePortList:
|
|
65
65
|
"""
|
|
66
|
-
List instance ports that are available for connecting to VIP
|
|
66
|
+
List all instance ports that are available for connecting to a VIP.
|
|
67
67
|
|
|
68
68
|
Args:
|
|
69
69
|
extra_headers: Send extra headers
|
|
@@ -102,7 +102,7 @@ class VipResource(SyncAPIResource):
|
|
|
102
102
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
103
103
|
) -> ConnectedPortList:
|
|
104
104
|
"""
|
|
105
|
-
List instance ports that share VIP
|
|
105
|
+
List all instance ports that share a VIP.
|
|
106
106
|
|
|
107
107
|
Args:
|
|
108
108
|
extra_headers: Send extra headers
|
|
@@ -142,7 +142,7 @@ class VipResource(SyncAPIResource):
|
|
|
142
142
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
143
143
|
) -> ConnectedPortList:
|
|
144
144
|
"""
|
|
145
|
-
Replace ports that share VIP
|
|
145
|
+
Replace the list of instance ports that share a VIP.
|
|
146
146
|
|
|
147
147
|
Args:
|
|
148
148
|
port_ids: List of port IDs that will share one VIP
|
|
@@ -187,7 +187,7 @@ class VipResource(SyncAPIResource):
|
|
|
187
187
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
188
188
|
) -> ReservedFixedIP:
|
|
189
189
|
"""
|
|
190
|
-
|
|
190
|
+
Update the VIP status of a reserved fixed IP.
|
|
191
191
|
|
|
192
192
|
Args:
|
|
193
193
|
is_vip: If reserved fixed IP should be a VIP
|
|
@@ -230,7 +230,7 @@ class VipResource(SyncAPIResource):
|
|
|
230
230
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
231
231
|
) -> ConnectedPortList:
|
|
232
232
|
"""
|
|
233
|
-
Add ports
|
|
233
|
+
Add instance ports to share a VIP.
|
|
234
234
|
|
|
235
235
|
Args:
|
|
236
236
|
port_ids: List of port IDs that will share one VIP
|
|
@@ -295,7 +295,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
295
295
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
296
296
|
) -> CandidatePortList:
|
|
297
297
|
"""
|
|
298
|
-
List instance ports that are available for connecting to VIP
|
|
298
|
+
List all instance ports that are available for connecting to a VIP.
|
|
299
299
|
|
|
300
300
|
Args:
|
|
301
301
|
extra_headers: Send extra headers
|
|
@@ -334,7 +334,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
334
334
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
335
335
|
) -> ConnectedPortList:
|
|
336
336
|
"""
|
|
337
|
-
List instance ports that share VIP
|
|
337
|
+
List all instance ports that share a VIP.
|
|
338
338
|
|
|
339
339
|
Args:
|
|
340
340
|
extra_headers: Send extra headers
|
|
@@ -374,7 +374,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
374
374
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
375
375
|
) -> ConnectedPortList:
|
|
376
376
|
"""
|
|
377
|
-
Replace ports that share VIP
|
|
377
|
+
Replace the list of instance ports that share a VIP.
|
|
378
378
|
|
|
379
379
|
Args:
|
|
380
380
|
port_ids: List of port IDs that will share one VIP
|
|
@@ -419,7 +419,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
419
419
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
420
420
|
) -> ReservedFixedIP:
|
|
421
421
|
"""
|
|
422
|
-
|
|
422
|
+
Update the VIP status of a reserved fixed IP.
|
|
423
423
|
|
|
424
424
|
Args:
|
|
425
425
|
is_vip: If reserved fixed IP should be a VIP
|
|
@@ -462,7 +462,7 @@ class AsyncVipResource(AsyncAPIResource):
|
|
|
462
462
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
463
463
|
) -> ConnectedPortList:
|
|
464
464
|
"""
|
|
465
|
-
Add ports
|
|
465
|
+
Add instance ports to share a VIP.
|
|
466
466
|
|
|
467
467
|
Args:
|
|
468
468
|
port_ids: List of port IDs that will share one VIP
|
|
@@ -92,7 +92,7 @@ class RulesResource(SyncAPIResource):
|
|
|
92
92
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
93
93
|
) -> SecurityGroupRule:
|
|
94
94
|
"""
|
|
95
|
-
Add new rule to security group
|
|
95
|
+
Add a new rule to an existing security group.
|
|
96
96
|
|
|
97
97
|
Args:
|
|
98
98
|
description: Rule description
|
|
@@ -160,7 +160,7 @@ class RulesResource(SyncAPIResource):
|
|
|
160
160
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
161
161
|
) -> None:
|
|
162
162
|
"""
|
|
163
|
-
Delete security group
|
|
163
|
+
Delete a specific rule from a security group.
|
|
164
164
|
|
|
165
165
|
Args:
|
|
166
166
|
extra_headers: Send extra headers
|
|
@@ -235,7 +235,7 @@ class RulesResource(SyncAPIResource):
|
|
|
235
235
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
236
236
|
) -> SecurityGroupRule:
|
|
237
237
|
"""
|
|
238
|
-
|
|
238
|
+
Update the configuration of an existing security group rule.
|
|
239
239
|
|
|
240
240
|
Args:
|
|
241
241
|
direction: Ingress or egress, which is the direction in which the security group rule is
|
|
@@ -363,7 +363,7 @@ class AsyncRulesResource(AsyncAPIResource):
|
|
|
363
363
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
364
364
|
) -> SecurityGroupRule:
|
|
365
365
|
"""
|
|
366
|
-
Add new rule to security group
|
|
366
|
+
Add a new rule to an existing security group.
|
|
367
367
|
|
|
368
368
|
Args:
|
|
369
369
|
description: Rule description
|
|
@@ -431,7 +431,7 @@ class AsyncRulesResource(AsyncAPIResource):
|
|
|
431
431
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
432
432
|
) -> None:
|
|
433
433
|
"""
|
|
434
|
-
Delete security group
|
|
434
|
+
Delete a specific rule from a security group.
|
|
435
435
|
|
|
436
436
|
Args:
|
|
437
437
|
extra_headers: Send extra headers
|
|
@@ -506,7 +506,7 @@ class AsyncRulesResource(AsyncAPIResource):
|
|
|
506
506
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
507
507
|
) -> SecurityGroupRule:
|
|
508
508
|
"""
|
|
509
|
-
|
|
509
|
+
Update the configuration of an existing security group rule.
|
|
510
510
|
|
|
511
511
|
Args:
|
|
512
512
|
direction: Ingress or egress, which is the direction in which the security group rule is
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List, Iterable
|
|
5
|
+
from typing import List, Iterable, Optional
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
@@ -33,6 +33,7 @@ from ....types.cloud import (
|
|
|
33
33
|
)
|
|
34
34
|
from ...._base_client import AsyncPaginator, make_request_options
|
|
35
35
|
from ....types.cloud.security_group import SecurityGroup
|
|
36
|
+
from ....types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
36
37
|
|
|
37
38
|
__all__ = ["SecurityGroupsResource", "AsyncSecurityGroupsResource"]
|
|
38
39
|
|
|
@@ -76,7 +77,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
76
77
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
77
78
|
) -> SecurityGroup:
|
|
78
79
|
"""
|
|
79
|
-
Create security group
|
|
80
|
+
Create a new security group with the specified configuration.
|
|
80
81
|
|
|
81
82
|
Args:
|
|
82
83
|
security_group: Security group
|
|
@@ -118,6 +119,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
118
119
|
region_id: int | None = None,
|
|
119
120
|
changed_rules: Iterable[security_group_update_params.ChangedRule] | NotGiven = NOT_GIVEN,
|
|
120
121
|
name: str | NotGiven = NOT_GIVEN,
|
|
122
|
+
tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
|
|
121
123
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
122
124
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
123
125
|
extra_headers: Headers | None = None,
|
|
@@ -126,13 +128,33 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
126
128
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
127
129
|
) -> SecurityGroup:
|
|
128
130
|
"""
|
|
129
|
-
|
|
131
|
+
Update the configuration of an existing security group.
|
|
130
132
|
|
|
131
133
|
Args:
|
|
132
134
|
changed_rules: List of rules to create or delete
|
|
133
135
|
|
|
134
136
|
name: Name
|
|
135
137
|
|
|
138
|
+
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
139
|
+
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
140
|
+
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
141
|
+
cannot be modified. **Examples:**
|
|
142
|
+
|
|
143
|
+
- **Add/update tags:**
|
|
144
|
+
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
145
|
+
updates existing ones.
|
|
146
|
+
- **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
|
|
147
|
+
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
148
|
+
tags are preserved).
|
|
149
|
+
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
150
|
+
specified tags.
|
|
151
|
+
- **Mixed operations:**
|
|
152
|
+
`{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
|
|
153
|
+
adds/updates 'environment' and '`cost_center`' while removing
|
|
154
|
+
'`deprecated_tag`', preserving other existing tags.
|
|
155
|
+
- **Replace all:** first delete existing tags with null values, then add new
|
|
156
|
+
ones in the same request.
|
|
157
|
+
|
|
136
158
|
extra_headers: Send extra headers
|
|
137
159
|
|
|
138
160
|
extra_query: Add additional query parameters to the request
|
|
@@ -153,6 +175,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
153
175
|
{
|
|
154
176
|
"changed_rules": changed_rules,
|
|
155
177
|
"name": name,
|
|
178
|
+
"tags": tags,
|
|
156
179
|
},
|
|
157
180
|
security_group_update_params.SecurityGroupUpdateParams,
|
|
158
181
|
),
|
|
@@ -179,18 +202,16 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
179
202
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
180
203
|
) -> SyncOffsetPage[SecurityGroup]:
|
|
181
204
|
"""
|
|
182
|
-
|
|
205
|
+
List all security groups in the specified project and region.
|
|
183
206
|
|
|
184
207
|
Args:
|
|
185
|
-
limit: Limit the number of returned
|
|
208
|
+
limit: Limit the number of returned security groups
|
|
186
209
|
|
|
187
|
-
offset: Offset value is used to exclude the first set of records from the result
|
|
210
|
+
offset: Offset value is used to exclude the first set of records from the result
|
|
188
211
|
|
|
189
212
|
tag_key: Filter by tag keys.
|
|
190
213
|
|
|
191
|
-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
|
|
192
|
-
--data-urlencode "`tag_key_value`={"key": "value"}" --url
|
|
193
|
-
"http://localhost:1111/v1/securitygroups/1/1"
|
|
214
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
|
|
194
215
|
|
|
195
216
|
extra_headers: Send extra headers
|
|
196
217
|
|
|
@@ -239,7 +260,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
239
260
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
240
261
|
) -> None:
|
|
241
262
|
"""
|
|
242
|
-
Delete security group
|
|
263
|
+
Delete a specific security group and all its associated rules.
|
|
243
264
|
|
|
244
265
|
Args:
|
|
245
266
|
extra_headers: Send extra headers
|
|
@@ -278,9 +299,9 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
278
299
|
extra_query: Query | None = None,
|
|
279
300
|
extra_body: Body | None = None,
|
|
280
301
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
281
|
-
) ->
|
|
302
|
+
) -> SecurityGroup:
|
|
282
303
|
"""
|
|
283
|
-
Create a deep copy of security group
|
|
304
|
+
Create a deep copy of an existing security group.
|
|
284
305
|
|
|
285
306
|
Args:
|
|
286
307
|
name: Name.
|
|
@@ -299,14 +320,13 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
299
320
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
300
321
|
if not group_id:
|
|
301
322
|
raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
|
|
302
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
303
323
|
return self._post(
|
|
304
324
|
f"/cloud/v1/securitygroups/{project_id}/{region_id}/{group_id}/copy",
|
|
305
325
|
body=maybe_transform({"name": name}, security_group_copy_params.SecurityGroupCopyParams),
|
|
306
326
|
options=make_request_options(
|
|
307
327
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
308
328
|
),
|
|
309
|
-
cast_to=
|
|
329
|
+
cast_to=SecurityGroup,
|
|
310
330
|
)
|
|
311
331
|
|
|
312
332
|
def get(
|
|
@@ -323,7 +343,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
323
343
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
324
344
|
) -> SecurityGroup:
|
|
325
345
|
"""
|
|
326
|
-
Get security group
|
|
346
|
+
Get detailed information about a specific security group.
|
|
327
347
|
|
|
328
348
|
Args:
|
|
329
349
|
extra_headers: Send extra headers
|
|
@@ -362,7 +382,7 @@ class SecurityGroupsResource(SyncAPIResource):
|
|
|
362
382
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
363
383
|
) -> SecurityGroup:
|
|
364
384
|
"""
|
|
365
|
-
Revert security group
|
|
385
|
+
Revert a security group to its previous state.
|
|
366
386
|
|
|
367
387
|
Args:
|
|
368
388
|
extra_headers: Send extra headers
|
|
@@ -427,7 +447,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
427
447
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
428
448
|
) -> SecurityGroup:
|
|
429
449
|
"""
|
|
430
|
-
Create security group
|
|
450
|
+
Create a new security group with the specified configuration.
|
|
431
451
|
|
|
432
452
|
Args:
|
|
433
453
|
security_group: Security group
|
|
@@ -469,6 +489,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
469
489
|
region_id: int | None = None,
|
|
470
490
|
changed_rules: Iterable[security_group_update_params.ChangedRule] | NotGiven = NOT_GIVEN,
|
|
471
491
|
name: str | NotGiven = NOT_GIVEN,
|
|
492
|
+
tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
|
|
472
493
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
473
494
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
474
495
|
extra_headers: Headers | None = None,
|
|
@@ -477,13 +498,33 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
477
498
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
478
499
|
) -> SecurityGroup:
|
|
479
500
|
"""
|
|
480
|
-
|
|
501
|
+
Update the configuration of an existing security group.
|
|
481
502
|
|
|
482
503
|
Args:
|
|
483
504
|
changed_rules: List of rules to create or delete
|
|
484
505
|
|
|
485
506
|
name: Name
|
|
486
507
|
|
|
508
|
+
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
509
|
+
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
510
|
+
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
511
|
+
cannot be modified. **Examples:**
|
|
512
|
+
|
|
513
|
+
- **Add/update tags:**
|
|
514
|
+
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
515
|
+
updates existing ones.
|
|
516
|
+
- **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
|
|
517
|
+
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
518
|
+
tags are preserved).
|
|
519
|
+
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
520
|
+
specified tags.
|
|
521
|
+
- **Mixed operations:**
|
|
522
|
+
`{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
|
|
523
|
+
adds/updates 'environment' and '`cost_center`' while removing
|
|
524
|
+
'`deprecated_tag`', preserving other existing tags.
|
|
525
|
+
- **Replace all:** first delete existing tags with null values, then add new
|
|
526
|
+
ones in the same request.
|
|
527
|
+
|
|
487
528
|
extra_headers: Send extra headers
|
|
488
529
|
|
|
489
530
|
extra_query: Add additional query parameters to the request
|
|
@@ -504,6 +545,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
504
545
|
{
|
|
505
546
|
"changed_rules": changed_rules,
|
|
506
547
|
"name": name,
|
|
548
|
+
"tags": tags,
|
|
507
549
|
},
|
|
508
550
|
security_group_update_params.SecurityGroupUpdateParams,
|
|
509
551
|
),
|
|
@@ -530,18 +572,16 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
530
572
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
531
573
|
) -> AsyncPaginator[SecurityGroup, AsyncOffsetPage[SecurityGroup]]:
|
|
532
574
|
"""
|
|
533
|
-
|
|
575
|
+
List all security groups in the specified project and region.
|
|
534
576
|
|
|
535
577
|
Args:
|
|
536
|
-
limit: Limit the number of returned
|
|
578
|
+
limit: Limit the number of returned security groups
|
|
537
579
|
|
|
538
|
-
offset: Offset value is used to exclude the first set of records from the result
|
|
580
|
+
offset: Offset value is used to exclude the first set of records from the result
|
|
539
581
|
|
|
540
582
|
tag_key: Filter by tag keys.
|
|
541
583
|
|
|
542
|
-
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
|
|
543
|
-
--data-urlencode "`tag_key_value`={"key": "value"}" --url
|
|
544
|
-
"http://localhost:1111/v1/securitygroups/1/1"
|
|
584
|
+
tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
|
|
545
585
|
|
|
546
586
|
extra_headers: Send extra headers
|
|
547
587
|
|
|
@@ -590,7 +630,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
590
630
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
591
631
|
) -> None:
|
|
592
632
|
"""
|
|
593
|
-
Delete security group
|
|
633
|
+
Delete a specific security group and all its associated rules.
|
|
594
634
|
|
|
595
635
|
Args:
|
|
596
636
|
extra_headers: Send extra headers
|
|
@@ -629,9 +669,9 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
629
669
|
extra_query: Query | None = None,
|
|
630
670
|
extra_body: Body | None = None,
|
|
631
671
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
632
|
-
) ->
|
|
672
|
+
) -> SecurityGroup:
|
|
633
673
|
"""
|
|
634
|
-
Create a deep copy of security group
|
|
674
|
+
Create a deep copy of an existing security group.
|
|
635
675
|
|
|
636
676
|
Args:
|
|
637
677
|
name: Name.
|
|
@@ -650,14 +690,13 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
650
690
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
651
691
|
if not group_id:
|
|
652
692
|
raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}")
|
|
653
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
654
693
|
return await self._post(
|
|
655
694
|
f"/cloud/v1/securitygroups/{project_id}/{region_id}/{group_id}/copy",
|
|
656
695
|
body=await async_maybe_transform({"name": name}, security_group_copy_params.SecurityGroupCopyParams),
|
|
657
696
|
options=make_request_options(
|
|
658
697
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
659
698
|
),
|
|
660
|
-
cast_to=
|
|
699
|
+
cast_to=SecurityGroup,
|
|
661
700
|
)
|
|
662
701
|
|
|
663
702
|
async def get(
|
|
@@ -674,7 +713,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
674
713
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
675
714
|
) -> SecurityGroup:
|
|
676
715
|
"""
|
|
677
|
-
Get security group
|
|
716
|
+
Get detailed information about a specific security group.
|
|
678
717
|
|
|
679
718
|
Args:
|
|
680
719
|
extra_headers: Send extra headers
|
|
@@ -713,7 +752,7 @@ class AsyncSecurityGroupsResource(AsyncAPIResource):
|
|
|
713
752
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
714
753
|
) -> SecurityGroup:
|
|
715
754
|
"""
|
|
716
|
-
Revert security group
|
|
755
|
+
Revert a security group to its previous state.
|
|
717
756
|
|
|
718
757
|
Args:
|
|
719
758
|
extra_headers: Send extra headers
|
gcore/resources/cloud/tasks.py
CHANGED
|
@@ -233,7 +233,7 @@ class TasksResource(SyncAPIResource):
|
|
|
233
233
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
234
234
|
) -> None:
|
|
235
235
|
"""
|
|
236
|
-
Acknowledge all
|
|
236
|
+
Acknowledge all tasks
|
|
237
237
|
|
|
238
238
|
Args:
|
|
239
239
|
project_id: Project ID
|
|
@@ -279,7 +279,7 @@ class TasksResource(SyncAPIResource):
|
|
|
279
279
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
280
280
|
) -> Task:
|
|
281
281
|
"""
|
|
282
|
-
Acknowledge one task
|
|
282
|
+
Acknowledge one task
|
|
283
283
|
|
|
284
284
|
Args:
|
|
285
285
|
task_id: Task ID
|
|
@@ -541,7 +541,7 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
|
541
541
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
542
542
|
) -> None:
|
|
543
543
|
"""
|
|
544
|
-
Acknowledge all
|
|
544
|
+
Acknowledge all tasks
|
|
545
545
|
|
|
546
546
|
Args:
|
|
547
547
|
project_id: Project ID
|
|
@@ -587,7 +587,7 @@ class AsyncTasksResource(AsyncAPIResource):
|
|
|
587
587
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
588
588
|
) -> Task:
|
|
589
589
|
"""
|
|
590
|
-
Acknowledge one task
|
|
590
|
+
Acknowledge one task
|
|
591
591
|
|
|
592
592
|
Args:
|
|
593
593
|
task_id: Task ID
|
|
@@ -64,7 +64,7 @@ class RoleAssignmentsResource(SyncAPIResource):
|
|
|
64
64
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
65
65
|
) -> RoleAssignment:
|
|
66
66
|
"""
|
|
67
|
-
Assign role to existing user
|
|
67
|
+
Assign a role to an existing user in the specified scope.
|
|
68
68
|
|
|
69
69
|
Args:
|
|
70
70
|
role: User role
|
|
@@ -116,7 +116,7 @@ class RoleAssignmentsResource(SyncAPIResource):
|
|
|
116
116
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
117
117
|
) -> RoleAssignmentUpdateDelete:
|
|
118
118
|
"""
|
|
119
|
-
Modify role assignment
|
|
119
|
+
Modify an existing role assignment for a user.
|
|
120
120
|
|
|
121
121
|
Args:
|
|
122
122
|
assignment_id: Assignment ID
|
|
@@ -168,12 +168,11 @@ class RoleAssignmentsResource(SyncAPIResource):
|
|
|
168
168
|
extra_body: Body | None = None,
|
|
169
169
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
170
170
|
) -> SyncOffsetPage[RoleAssignment]:
|
|
171
|
-
"""
|
|
171
|
+
"""
|
|
172
|
+
List all role assignments in the specified scope.
|
|
172
173
|
|
|
173
174
|
Args:
|
|
174
|
-
limit: Limit the number of returned items.
|
|
175
|
-
|
|
176
|
-
Falls back to default of 1000 if not
|
|
175
|
+
limit: Limit the number of returned items. Falls back to default of 1000 if not
|
|
177
176
|
specified. Limited by max limit value of 1000
|
|
178
177
|
|
|
179
178
|
offset: Offset value is used to exclude the first set of records from the result
|
|
@@ -223,7 +222,7 @@ class RoleAssignmentsResource(SyncAPIResource):
|
|
|
223
222
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
224
223
|
) -> RoleAssignmentUpdateDelete:
|
|
225
224
|
"""
|
|
226
|
-
Delete role assignment
|
|
225
|
+
Delete an existing role assignment.
|
|
227
226
|
|
|
228
227
|
Args:
|
|
229
228
|
assignment_id: Assignment ID
|
|
@@ -280,7 +279,7 @@ class AsyncRoleAssignmentsResource(AsyncAPIResource):
|
|
|
280
279
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
281
280
|
) -> RoleAssignment:
|
|
282
281
|
"""
|
|
283
|
-
Assign role to existing user
|
|
282
|
+
Assign a role to an existing user in the specified scope.
|
|
284
283
|
|
|
285
284
|
Args:
|
|
286
285
|
role: User role
|
|
@@ -332,7 +331,7 @@ class AsyncRoleAssignmentsResource(AsyncAPIResource):
|
|
|
332
331
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
333
332
|
) -> RoleAssignmentUpdateDelete:
|
|
334
333
|
"""
|
|
335
|
-
Modify role assignment
|
|
334
|
+
Modify an existing role assignment for a user.
|
|
336
335
|
|
|
337
336
|
Args:
|
|
338
337
|
assignment_id: Assignment ID
|
|
@@ -384,12 +383,11 @@ class AsyncRoleAssignmentsResource(AsyncAPIResource):
|
|
|
384
383
|
extra_body: Body | None = None,
|
|
385
384
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
386
385
|
) -> AsyncPaginator[RoleAssignment, AsyncOffsetPage[RoleAssignment]]:
|
|
387
|
-
"""
|
|
386
|
+
"""
|
|
387
|
+
List all role assignments in the specified scope.
|
|
388
388
|
|
|
389
389
|
Args:
|
|
390
|
-
limit: Limit the number of returned items.
|
|
391
|
-
|
|
392
|
-
Falls back to default of 1000 if not
|
|
390
|
+
limit: Limit the number of returned items. Falls back to default of 1000 if not
|
|
393
391
|
specified. Limited by max limit value of 1000
|
|
394
392
|
|
|
395
393
|
offset: Offset value is used to exclude the first set of records from the result
|
|
@@ -439,7 +437,7 @@ class AsyncRoleAssignmentsResource(AsyncAPIResource):
|
|
|
439
437
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
440
438
|
) -> RoleAssignmentUpdateDelete:
|
|
441
439
|
"""
|
|
442
|
-
Delete role assignment
|
|
440
|
+
Delete an existing role assignment.
|
|
443
441
|
|
|
444
442
|
Args:
|
|
445
443
|
assignment_id: Assignment ID
|