gcore 0.3.0__py3-none-any.whl → 0.5.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 +31 -2
- gcore/_client.py +18 -0
- gcore/_constants.py +2 -2
- gcore/_models.py +8 -5
- gcore/_version.py +1 -1
- gcore/pagination.py +252 -1
- gcore/resources/__init__.py +28 -0
- gcore/resources/cloud/baremetal/flavors.py +11 -137
- gcore/resources/cloud/baremetal/images.py +10 -12
- gcore/resources/cloud/baremetal/servers.py +33 -30
- 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 +33 -22
- 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 +76 -35
- gcore/resources/cloud/inference/deployments/logs.py +7 -7
- gcore/resources/cloud/inference/inference.py +5 -5
- gcore/resources/cloud/inference/models.py +16 -15
- gcore/resources/cloud/inference/registry_credentials.py +18 -18
- gcore/resources/cloud/inference/secrets.py +12 -13
- gcore/resources/cloud/instances/flavors.py +9 -233
- gcore/resources/cloud/instances/images.py +47 -37
- gcore/resources/cloud/instances/instances.py +49 -34
- 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/secrets.py +14 -224
- gcore/resources/cloud/security_groups/rules.py +6 -6
- gcore/resources/cloud/security_groups/security_groups.py +70 -31
- gcore/resources/cloud/tasks.py +34 -32
- gcore/resources/cloud/users/role_assignments.py +12 -14
- gcore/resources/cloud/volumes.py +139 -49
- gcore/resources/fastedge/__init__.py +103 -0
- gcore/resources/fastedge/apps/__init__.py +33 -0
- gcore/resources/fastedge/apps/apps.py +932 -0
- gcore/resources/fastedge/apps/logs.py +248 -0
- gcore/resources/fastedge/binaries.py +286 -0
- gcore/resources/fastedge/fastedge.py +327 -0
- gcore/resources/fastedge/kv_stores.py +523 -0
- gcore/resources/fastedge/secrets.py +687 -0
- gcore/resources/fastedge/statistics.py +347 -0
- gcore/resources/fastedge/templates.py +652 -0
- 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/__init__.py +2 -28
- 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 +5 -9
- 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 +3 -4
- gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +2 -4
- gcore/types/cloud/health_monitor.py +6 -1
- gcore/types/cloud/inference/__init__.py +12 -8
- gcore/types/cloud/inference/deployment_create_params.py +224 -7
- gcore/types/cloud/inference/deployment_update_params.py +24 -3
- gcore/types/cloud/inference/deployments/__init__.py +1 -0
- gcore/types/cloud/inference/{inference_log.py → deployments/inference_deployment_log.py} +3 -3
- gcore/types/cloud/inference/inference_deployment.py +266 -0
- gcore/types/cloud/inference/{inference_apikey_secret.py → inference_deployment_api_key.py} +2 -2
- gcore/types/cloud/inference/{mlcatalog_model_card.py → inference_model.py} +2 -2
- gcore/types/cloud/inference/{inference_registry_credential.py → inference_registry_credentials.py} +2 -2
- gcore/types/cloud/inference/{inference_registry_credential_full.py → inference_registry_credentials_create.py} +2 -2
- gcore/types/cloud/inference/inference_secret.py +10 -3
- gcore/types/cloud/inference/model_list_params.py +2 -4
- gcore/types/cloud/{container_probe.py → inference/probe.py} +9 -9
- gcore/types/cloud/{container_probe_config.py → inference/probe_config.py} +5 -5
- gcore/types/cloud/{container_probe_exec.py → inference/probe_exec.py} +3 -3
- gcore/types/cloud/{container_probe_http_get.py → inference/probe_http_get.py} +3 -3
- gcore/types/cloud/{container_probe_tcp_socket.py → inference/probe_tcp_socket.py} +3 -3
- gcore/types/cloud/inference/secret_create_params.py +10 -4
- gcore/types/cloud/inference/secret_replace_params.py +10 -4
- gcore/types/cloud/{region_capacity.py → inference_region_capacity.py} +10 -3
- gcore/types/cloud/{region_capacity_list.py → inference_region_capacity_list.py} +4 -4
- gcore/types/cloud/instance_create_params.py +8 -9
- 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/task_list_params.py +15 -14
- gcore/types/cloud/volume_list_params.py +1 -5
- gcore/types/cloud/volume_update_params.py +29 -3
- gcore/types/fastedge/__init__.py +48 -0
- gcore/types/fastedge/app.py +81 -0
- gcore/types/fastedge/app_create_params.py +56 -0
- gcore/types/fastedge/app_list_params.py +50 -0
- gcore/types/fastedge/app_param.py +56 -0
- gcore/types/fastedge/app_replace_params.py +17 -0
- gcore/types/fastedge/app_short.py +60 -0
- gcore/types/fastedge/app_update_params.py +56 -0
- gcore/types/fastedge/apps/__init__.py +6 -0
- gcore/types/fastedge/apps/log.py +28 -0
- gcore/types/fastedge/apps/log_list_params.py +37 -0
- gcore/types/fastedge/binary.py +40 -0
- gcore/types/fastedge/binary_list_response.py +12 -0
- gcore/types/fastedge/binary_short.py +32 -0
- gcore/types/fastedge/call_status.py +24 -0
- gcore/types/fastedge/client.py +57 -0
- gcore/types/fastedge/duration_stats.py +30 -0
- gcore/types/fastedge/kv_store.py +33 -0
- gcore/types/fastedge/kv_store_create_params.py +23 -0
- gcore/types/fastedge/kv_store_get_response.py +10 -0
- gcore/types/fastedge/kv_store_list_params.py +12 -0
- gcore/types/fastedge/kv_store_list_response.py +15 -0
- gcore/types/fastedge/kv_store_replace_params.py +23 -0
- gcore/types/fastedge/kv_store_short.py +19 -0
- gcore/types/fastedge/kv_store_stats.py +26 -0
- gcore/types/fastedge/secret.py +29 -0
- gcore/types/fastedge/secret_create_params.py +27 -0
- gcore/types/fastedge/secret_create_response.py +12 -0
- gcore/types/fastedge/secret_delete_params.py +12 -0
- gcore/types/fastedge/secret_list_params.py +15 -0
- gcore/types/{cloud → fastedge}/secret_list_response.py +2 -6
- gcore/types/fastedge/secret_replace_params.py +27 -0
- gcore/types/fastedge/secret_short.py +21 -0
- gcore/types/fastedge/secret_update_params.py +27 -0
- gcore/types/fastedge/statistic_get_call_series_params.py +28 -0
- gcore/types/fastedge/statistic_get_call_series_response.py +12 -0
- gcore/types/fastedge/statistic_get_duration_series_params.py +28 -0
- gcore/types/fastedge/statistic_get_duration_series_response.py +12 -0
- gcore/types/fastedge/template.py +31 -0
- gcore/types/fastedge/template_create_params.py +30 -0
- gcore/types/fastedge/template_delete_params.py +12 -0
- gcore/types/fastedge/template_list_params.py +25 -0
- gcore/types/fastedge/template_parameter.py +22 -0
- gcore/types/fastedge/template_parameter_param.py +21 -0
- gcore/types/fastedge/template_replace_params.py +30 -0
- gcore/types/fastedge/template_short.py +27 -0
- 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.5.0.dist-info}/METADATA +44 -5
- {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/RECORD +200 -151
- gcore/resources/waap/clients.py +0 -135
- gcore/types/cloud/aws_iam_data.py +0 -13
- gcore/types/cloud/aws_iam_data_param.py +0 -15
- gcore/types/cloud/baremetal/flavor_list_suitable_params.py +0 -22
- gcore/types/cloud/capacity.py +0 -13
- gcore/types/cloud/container_probe_config_create_param.py +0 -17
- gcore/types/cloud/container_probe_create_param.py +0 -38
- gcore/types/cloud/container_probe_exec_create_param.py +0 -13
- gcore/types/cloud/container_probe_http_get_create_param.py +0 -25
- gcore/types/cloud/container_probe_tcp_socket_create_param.py +0 -12
- gcore/types/cloud/container_scale.py +0 -25
- gcore/types/cloud/container_scale_trigger_rate.py +0 -13
- gcore/types/cloud/container_scale_trigger_sqs.py +0 -33
- gcore/types/cloud/container_scale_trigger_threshold.py +0 -10
- gcore/types/cloud/container_scale_triggers.py +0 -36
- gcore/types/cloud/deploy_status.py +0 -13
- gcore/types/cloud/inference/container.py +0 -26
- gcore/types/cloud/inference/inference.py +0 -95
- gcore/types/cloud/inference/mlcatalog_order_by_choices.py +0 -7
- gcore/types/cloud/inference_probes.py +0 -19
- gcore/types/cloud/ingress_opts_out.py +0 -16
- gcore/types/cloud/ingress_opts_param.py +0 -18
- 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/cloud/secret_create_params.py +0 -66
- gcore/types/waap/client_me_response.py +0 -34
- {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/WHEEL +0 -0
- {gcore-0.3.0.dist-info → gcore-0.5.0.dist-info}/licenses/LICENSE +0 -0
gcore/resources/cloud/secrets.py
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
from typing import Union, Optional
|
|
5
|
+
from typing import Union
|
|
7
6
|
from datetime import datetime
|
|
8
|
-
from typing_extensions import Literal
|
|
9
7
|
|
|
10
8
|
import httpx
|
|
11
9
|
|
|
@@ -19,11 +17,11 @@ from ..._response import (
|
|
|
19
17
|
async_to_raw_response_wrapper,
|
|
20
18
|
async_to_streamed_response_wrapper,
|
|
21
19
|
)
|
|
22
|
-
from ...
|
|
23
|
-
from ...
|
|
20
|
+
from ...pagination import SyncOffsetPage, AsyncOffsetPage
|
|
21
|
+
from ...types.cloud import secret_list_params, secret_upload_tls_certificate_params
|
|
22
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
24
23
|
from ...types.cloud.secret import Secret
|
|
25
24
|
from ...types.cloud.task_id_list import TaskIDList
|
|
26
|
-
from ...types.cloud.secret_list_response import SecretListResponse
|
|
27
25
|
|
|
28
26
|
__all__ = ["SecretsResource", "AsyncSecretsResource"]
|
|
29
27
|
|
|
@@ -48,101 +46,6 @@ class SecretsResource(SyncAPIResource):
|
|
|
48
46
|
"""
|
|
49
47
|
return SecretsResourceWithStreamingResponse(self)
|
|
50
48
|
|
|
51
|
-
@typing_extensions.deprecated("deprecated")
|
|
52
|
-
def create(
|
|
53
|
-
self,
|
|
54
|
-
*,
|
|
55
|
-
project_id: int | None = None,
|
|
56
|
-
region_id: int | None = None,
|
|
57
|
-
name: str,
|
|
58
|
-
payload: str,
|
|
59
|
-
payload_content_encoding: Literal["base64"],
|
|
60
|
-
payload_content_type: str,
|
|
61
|
-
secret_type: Literal["certificate", "opaque", "passphrase", "private", "public", "symmetric"],
|
|
62
|
-
algorithm: Optional[str] | NotGiven = NOT_GIVEN,
|
|
63
|
-
bit_length: Optional[int] | NotGiven = NOT_GIVEN,
|
|
64
|
-
expiration: Optional[str] | NotGiven = NOT_GIVEN,
|
|
65
|
-
mode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
66
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
67
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
68
|
-
extra_headers: Headers | None = None,
|
|
69
|
-
extra_query: Query | None = None,
|
|
70
|
-
extra_body: Body | None = None,
|
|
71
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
72
|
-
) -> TaskIDList:
|
|
73
|
-
"""
|
|
74
|
-
Create secret
|
|
75
|
-
|
|
76
|
-
Args:
|
|
77
|
-
project_id: Project ID
|
|
78
|
-
|
|
79
|
-
region_id: Region ID
|
|
80
|
-
|
|
81
|
-
name: Secret name
|
|
82
|
-
|
|
83
|
-
payload: Secret payload. For HTTPS-terminated load balancing, provide base64 encoded
|
|
84
|
-
conents of a PKCS12 file. The PKCS12 file is the combined TLS certificate, key,
|
|
85
|
-
and intermediate certificate chain obtained from an external certificate
|
|
86
|
-
authority. The file can be created via openssl, e.g.'openssl pkcs12 -export
|
|
87
|
-
-inkey server.key -in server.crt -certfile ca-chain.crt -passout pass: -out
|
|
88
|
-
server.p12'The key and certificate should be PEM-encoded, and the intermediate
|
|
89
|
-
certificate chain should be multiple PEM-encoded certs concatenated together
|
|
90
|
-
|
|
91
|
-
payload_content_encoding: The encoding used for the payload to be able to include it in the JSON request.
|
|
92
|
-
Currently only base64 is supported
|
|
93
|
-
|
|
94
|
-
payload_content_type: The media type for the content of the payload
|
|
95
|
-
|
|
96
|
-
secret_type: Secret type. symmetric - Used for storing byte arrays such as keys suitable for
|
|
97
|
-
symmetric encryption; public - Used for storing the public key of an asymmetric
|
|
98
|
-
keypair; private - Used for storing the private key of an asymmetric keypair;
|
|
99
|
-
passphrase - Used for storing plain text passphrases; certificate - Used for
|
|
100
|
-
storing cryptographic certificates such as X.509 certificates; opaque - Used for
|
|
101
|
-
backwards compatibility with previous versions of the API
|
|
102
|
-
|
|
103
|
-
algorithm: Metadata provided by a user or system for informational purposes.
|
|
104
|
-
|
|
105
|
-
bit_length: Metadata provided by a user or system for informational purposes. Value must be
|
|
106
|
-
greater than zero.
|
|
107
|
-
|
|
108
|
-
expiration: Datetime when the secret will expire.
|
|
109
|
-
|
|
110
|
-
mode: Metadata provided by a user or system for informational purposes.
|
|
111
|
-
|
|
112
|
-
extra_headers: Send extra headers
|
|
113
|
-
|
|
114
|
-
extra_query: Add additional query parameters to the request
|
|
115
|
-
|
|
116
|
-
extra_body: Add additional JSON properties to the request
|
|
117
|
-
|
|
118
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
119
|
-
"""
|
|
120
|
-
if project_id is None:
|
|
121
|
-
project_id = self._client._get_cloud_project_id_path_param()
|
|
122
|
-
if region_id is None:
|
|
123
|
-
region_id = self._client._get_cloud_region_id_path_param()
|
|
124
|
-
return self._post(
|
|
125
|
-
f"/cloud/v1/secrets/{project_id}/{region_id}",
|
|
126
|
-
body=maybe_transform(
|
|
127
|
-
{
|
|
128
|
-
"name": name,
|
|
129
|
-
"payload": payload,
|
|
130
|
-
"payload_content_encoding": payload_content_encoding,
|
|
131
|
-
"payload_content_type": payload_content_type,
|
|
132
|
-
"secret_type": secret_type,
|
|
133
|
-
"algorithm": algorithm,
|
|
134
|
-
"bit_length": bit_length,
|
|
135
|
-
"expiration": expiration,
|
|
136
|
-
"mode": mode,
|
|
137
|
-
},
|
|
138
|
-
secret_create_params.SecretCreateParams,
|
|
139
|
-
),
|
|
140
|
-
options=make_request_options(
|
|
141
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
142
|
-
),
|
|
143
|
-
cast_to=TaskIDList,
|
|
144
|
-
)
|
|
145
|
-
|
|
146
49
|
def list(
|
|
147
50
|
self,
|
|
148
51
|
*,
|
|
@@ -156,7 +59,7 @@ class SecretsResource(SyncAPIResource):
|
|
|
156
59
|
extra_query: Query | None = None,
|
|
157
60
|
extra_body: Body | None = None,
|
|
158
61
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
159
|
-
) ->
|
|
62
|
+
) -> SyncOffsetPage[Secret]:
|
|
160
63
|
"""
|
|
161
64
|
List secrets
|
|
162
65
|
|
|
@@ -182,8 +85,9 @@ class SecretsResource(SyncAPIResource):
|
|
|
182
85
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
183
86
|
if region_id is None:
|
|
184
87
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
185
|
-
return self.
|
|
88
|
+
return self._get_api_list(
|
|
186
89
|
f"/cloud/v1/secrets/{project_id}/{region_id}",
|
|
90
|
+
page=SyncOffsetPage[Secret],
|
|
187
91
|
options=make_request_options(
|
|
188
92
|
extra_headers=extra_headers,
|
|
189
93
|
extra_query=extra_query,
|
|
@@ -197,7 +101,7 @@ class SecretsResource(SyncAPIResource):
|
|
|
197
101
|
secret_list_params.SecretListParams,
|
|
198
102
|
),
|
|
199
103
|
),
|
|
200
|
-
|
|
104
|
+
model=Secret,
|
|
201
105
|
)
|
|
202
106
|
|
|
203
107
|
def delete(
|
|
@@ -409,102 +313,7 @@ class AsyncSecretsResource(AsyncAPIResource):
|
|
|
409
313
|
"""
|
|
410
314
|
return AsyncSecretsResourceWithStreamingResponse(self)
|
|
411
315
|
|
|
412
|
-
|
|
413
|
-
async def create(
|
|
414
|
-
self,
|
|
415
|
-
*,
|
|
416
|
-
project_id: int | None = None,
|
|
417
|
-
region_id: int | None = None,
|
|
418
|
-
name: str,
|
|
419
|
-
payload: str,
|
|
420
|
-
payload_content_encoding: Literal["base64"],
|
|
421
|
-
payload_content_type: str,
|
|
422
|
-
secret_type: Literal["certificate", "opaque", "passphrase", "private", "public", "symmetric"],
|
|
423
|
-
algorithm: Optional[str] | NotGiven = NOT_GIVEN,
|
|
424
|
-
bit_length: Optional[int] | NotGiven = NOT_GIVEN,
|
|
425
|
-
expiration: Optional[str] | NotGiven = NOT_GIVEN,
|
|
426
|
-
mode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
427
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
428
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
429
|
-
extra_headers: Headers | None = None,
|
|
430
|
-
extra_query: Query | None = None,
|
|
431
|
-
extra_body: Body | None = None,
|
|
432
|
-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
433
|
-
) -> TaskIDList:
|
|
434
|
-
"""
|
|
435
|
-
Create secret
|
|
436
|
-
|
|
437
|
-
Args:
|
|
438
|
-
project_id: Project ID
|
|
439
|
-
|
|
440
|
-
region_id: Region ID
|
|
441
|
-
|
|
442
|
-
name: Secret name
|
|
443
|
-
|
|
444
|
-
payload: Secret payload. For HTTPS-terminated load balancing, provide base64 encoded
|
|
445
|
-
conents of a PKCS12 file. The PKCS12 file is the combined TLS certificate, key,
|
|
446
|
-
and intermediate certificate chain obtained from an external certificate
|
|
447
|
-
authority. The file can be created via openssl, e.g.'openssl pkcs12 -export
|
|
448
|
-
-inkey server.key -in server.crt -certfile ca-chain.crt -passout pass: -out
|
|
449
|
-
server.p12'The key and certificate should be PEM-encoded, and the intermediate
|
|
450
|
-
certificate chain should be multiple PEM-encoded certs concatenated together
|
|
451
|
-
|
|
452
|
-
payload_content_encoding: The encoding used for the payload to be able to include it in the JSON request.
|
|
453
|
-
Currently only base64 is supported
|
|
454
|
-
|
|
455
|
-
payload_content_type: The media type for the content of the payload
|
|
456
|
-
|
|
457
|
-
secret_type: Secret type. symmetric - Used for storing byte arrays such as keys suitable for
|
|
458
|
-
symmetric encryption; public - Used for storing the public key of an asymmetric
|
|
459
|
-
keypair; private - Used for storing the private key of an asymmetric keypair;
|
|
460
|
-
passphrase - Used for storing plain text passphrases; certificate - Used for
|
|
461
|
-
storing cryptographic certificates such as X.509 certificates; opaque - Used for
|
|
462
|
-
backwards compatibility with previous versions of the API
|
|
463
|
-
|
|
464
|
-
algorithm: Metadata provided by a user or system for informational purposes.
|
|
465
|
-
|
|
466
|
-
bit_length: Metadata provided by a user or system for informational purposes. Value must be
|
|
467
|
-
greater than zero.
|
|
468
|
-
|
|
469
|
-
expiration: Datetime when the secret will expire.
|
|
470
|
-
|
|
471
|
-
mode: Metadata provided by a user or system for informational purposes.
|
|
472
|
-
|
|
473
|
-
extra_headers: Send extra headers
|
|
474
|
-
|
|
475
|
-
extra_query: Add additional query parameters to the request
|
|
476
|
-
|
|
477
|
-
extra_body: Add additional JSON properties to the request
|
|
478
|
-
|
|
479
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
480
|
-
"""
|
|
481
|
-
if project_id is None:
|
|
482
|
-
project_id = self._client._get_cloud_project_id_path_param()
|
|
483
|
-
if region_id is None:
|
|
484
|
-
region_id = self._client._get_cloud_region_id_path_param()
|
|
485
|
-
return await self._post(
|
|
486
|
-
f"/cloud/v1/secrets/{project_id}/{region_id}",
|
|
487
|
-
body=await async_maybe_transform(
|
|
488
|
-
{
|
|
489
|
-
"name": name,
|
|
490
|
-
"payload": payload,
|
|
491
|
-
"payload_content_encoding": payload_content_encoding,
|
|
492
|
-
"payload_content_type": payload_content_type,
|
|
493
|
-
"secret_type": secret_type,
|
|
494
|
-
"algorithm": algorithm,
|
|
495
|
-
"bit_length": bit_length,
|
|
496
|
-
"expiration": expiration,
|
|
497
|
-
"mode": mode,
|
|
498
|
-
},
|
|
499
|
-
secret_create_params.SecretCreateParams,
|
|
500
|
-
),
|
|
501
|
-
options=make_request_options(
|
|
502
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
503
|
-
),
|
|
504
|
-
cast_to=TaskIDList,
|
|
505
|
-
)
|
|
506
|
-
|
|
507
|
-
async def list(
|
|
316
|
+
def list(
|
|
508
317
|
self,
|
|
509
318
|
*,
|
|
510
319
|
project_id: int | None = None,
|
|
@@ -517,7 +326,7 @@ class AsyncSecretsResource(AsyncAPIResource):
|
|
|
517
326
|
extra_query: Query | None = None,
|
|
518
327
|
extra_body: Body | None = None,
|
|
519
328
|
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
520
|
-
) ->
|
|
329
|
+
) -> AsyncPaginator[Secret, AsyncOffsetPage[Secret]]:
|
|
521
330
|
"""
|
|
522
331
|
List secrets
|
|
523
332
|
|
|
@@ -543,14 +352,15 @@ class AsyncSecretsResource(AsyncAPIResource):
|
|
|
543
352
|
project_id = self._client._get_cloud_project_id_path_param()
|
|
544
353
|
if region_id is None:
|
|
545
354
|
region_id = self._client._get_cloud_region_id_path_param()
|
|
546
|
-
return
|
|
355
|
+
return self._get_api_list(
|
|
547
356
|
f"/cloud/v1/secrets/{project_id}/{region_id}",
|
|
357
|
+
page=AsyncOffsetPage[Secret],
|
|
548
358
|
options=make_request_options(
|
|
549
359
|
extra_headers=extra_headers,
|
|
550
360
|
extra_query=extra_query,
|
|
551
361
|
extra_body=extra_body,
|
|
552
362
|
timeout=timeout,
|
|
553
|
-
query=
|
|
363
|
+
query=maybe_transform(
|
|
554
364
|
{
|
|
555
365
|
"limit": limit,
|
|
556
366
|
"offset": offset,
|
|
@@ -558,7 +368,7 @@ class AsyncSecretsResource(AsyncAPIResource):
|
|
|
558
368
|
secret_list_params.SecretListParams,
|
|
559
369
|
),
|
|
560
370
|
),
|
|
561
|
-
|
|
371
|
+
model=Secret,
|
|
562
372
|
)
|
|
563
373
|
|
|
564
374
|
async def delete(
|
|
@@ -754,11 +564,6 @@ class SecretsResourceWithRawResponse:
|
|
|
754
564
|
def __init__(self, secrets: SecretsResource) -> None:
|
|
755
565
|
self._secrets = secrets
|
|
756
566
|
|
|
757
|
-
self.create = ( # pyright: ignore[reportDeprecated]
|
|
758
|
-
to_raw_response_wrapper(
|
|
759
|
-
secrets.create # pyright: ignore[reportDeprecated],
|
|
760
|
-
)
|
|
761
|
-
)
|
|
762
567
|
self.list = to_raw_response_wrapper(
|
|
763
568
|
secrets.list,
|
|
764
569
|
)
|
|
@@ -777,11 +582,6 @@ class AsyncSecretsResourceWithRawResponse:
|
|
|
777
582
|
def __init__(self, secrets: AsyncSecretsResource) -> None:
|
|
778
583
|
self._secrets = secrets
|
|
779
584
|
|
|
780
|
-
self.create = ( # pyright: ignore[reportDeprecated]
|
|
781
|
-
async_to_raw_response_wrapper(
|
|
782
|
-
secrets.create # pyright: ignore[reportDeprecated],
|
|
783
|
-
)
|
|
784
|
-
)
|
|
785
585
|
self.list = async_to_raw_response_wrapper(
|
|
786
586
|
secrets.list,
|
|
787
587
|
)
|
|
@@ -800,11 +600,6 @@ class SecretsResourceWithStreamingResponse:
|
|
|
800
600
|
def __init__(self, secrets: SecretsResource) -> None:
|
|
801
601
|
self._secrets = secrets
|
|
802
602
|
|
|
803
|
-
self.create = ( # pyright: ignore[reportDeprecated]
|
|
804
|
-
to_streamed_response_wrapper(
|
|
805
|
-
secrets.create # pyright: ignore[reportDeprecated],
|
|
806
|
-
)
|
|
807
|
-
)
|
|
808
603
|
self.list = to_streamed_response_wrapper(
|
|
809
604
|
secrets.list,
|
|
810
605
|
)
|
|
@@ -823,11 +618,6 @@ class AsyncSecretsResourceWithStreamingResponse:
|
|
|
823
618
|
def __init__(self, secrets: AsyncSecretsResource) -> None:
|
|
824
619
|
self._secrets = secrets
|
|
825
620
|
|
|
826
|
-
self.create = ( # pyright: ignore[reportDeprecated]
|
|
827
|
-
async_to_streamed_response_wrapper(
|
|
828
|
-
secrets.create # pyright: ignore[reportDeprecated],
|
|
829
|
-
)
|
|
830
|
-
)
|
|
831
621
|
self.list = async_to_streamed_response_wrapper(
|
|
832
622
|
secrets.list,
|
|
833
623
|
)
|
|
@@ -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
|