From 59805b7786a26adf8f583137664b86cb0b32f6a1 Mon Sep 17 00:00:00 2001 From: API Engineering Date: Fri, 31 Jul 2026 17:17:06 +0000 Subject: [PATCH] [bot] Updated client based on openapi-87e82da/clientgen --- DO_OPENAPI_COMMIT_SHA.txt | 2 +- src/pydo/_client.py | 6 + src/pydo/aio/_client.py | 6 + src/pydo/aio/operations/__init__.py | 2 + src/pydo/aio/operations/_operations.py | 2579 ++++++++++-------------- src/pydo/operations/__init__.py | 2 + src/pydo/operations/_operations.py | 2281 ++++++++------------- 7 files changed, 1898 insertions(+), 2980 deletions(-) diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index 7ffb1d26..200c6288 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -7e5b46e +87e82da diff --git a/src/pydo/_client.py b/src/pydo/_client.py index b190e6ab..b6530040 100644 --- a/src/pydo/_client.py +++ b/src/pydo/_client.py @@ -44,6 +44,7 @@ MonitoringOperations, NfsOperations, OneClicksOperations, + OrganizationsOperations, PartnerAttachmentsOperations, ProjectsOperations, RegionsOperations, @@ -131,6 +132,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too :vartype monitoring: pydo.operations.MonitoringOperations :ivar nfs: NfsOperations operations :vartype nfs: pydo.operations.NfsOperations + :ivar organizations: OrganizationsOperations operations + :vartype organizations: pydo.operations.OrganizationsOperations :ivar partner_attachments: PartnerAttachmentsOperations operations :vartype partner_attachments: pydo.operations.PartnerAttachmentsOperations :ivar projects: ProjectsOperations operations @@ -306,6 +309,9 @@ def __init__( self.nfs = NfsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.organizations = OrganizationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.partner_attachments = PartnerAttachmentsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/src/pydo/aio/_client.py b/src/pydo/aio/_client.py index 6a8b62f4..74395f92 100644 --- a/src/pydo/aio/_client.py +++ b/src/pydo/aio/_client.py @@ -44,6 +44,7 @@ MonitoringOperations, NfsOperations, OneClicksOperations, + OrganizationsOperations, PartnerAttachmentsOperations, ProjectsOperations, RegionsOperations, @@ -131,6 +132,8 @@ class GeneratedClient: # pylint: disable=client-accepts-api-version-keyword,too :vartype monitoring: pydo.aio.operations.MonitoringOperations :ivar nfs: NfsOperations operations :vartype nfs: pydo.aio.operations.NfsOperations + :ivar organizations: OrganizationsOperations operations + :vartype organizations: pydo.aio.operations.OrganizationsOperations :ivar partner_attachments: PartnerAttachmentsOperations operations :vartype partner_attachments: pydo.aio.operations.PartnerAttachmentsOperations :ivar projects: ProjectsOperations operations @@ -306,6 +309,9 @@ def __init__( self.nfs = NfsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.organizations = OrganizationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.partner_attachments = PartnerAttachmentsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/src/pydo/aio/operations/__init__.py b/src/pydo/aio/operations/__init__.py index 2de68fec..e3577712 100644 --- a/src/pydo/aio/operations/__init__.py +++ b/src/pydo/aio/operations/__init__.py @@ -31,6 +31,7 @@ from ._operations import LoadBalancersOperations from ._operations import MonitoringOperations from ._operations import NfsOperations +from ._operations import OrganizationsOperations from ._operations import PartnerAttachmentsOperations from ._operations import ProjectsOperations from ._operations import RegionsOperations @@ -90,6 +91,7 @@ "LoadBalancersOperations", "MonitoringOperations", "NfsOperations", + "OrganizationsOperations", "PartnerAttachmentsOperations", "ProjectsOperations", "RegionsOperations", diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index 120e722d..7db7b0d7 100644 --- a/src/pydo/aio/operations/_operations.py +++ b/src/pydo/aio/operations/_operations.py @@ -528,6 +528,8 @@ build_nfs_list_snapshot_request, build_one_clicks_install_kubernetes_request, build_one_clicks_list_request, + build_organizations_create_team_request, + build_organizations_list_teams_request, build_partner_attachments_create_request, build_partner_attachments_create_service_key_request, build_partner_attachments_delete_request, @@ -602,20 +604,13 @@ build_reserved_ipv6_list_request, build_security_create_scan_request, build_security_create_scan_rule_request, - build_security_create_secret_request, build_security_create_suppression_request, - build_security_delete_secret_request, build_security_delete_suppression_request, build_security_get_latest_scan_request, build_security_get_scan_request, - build_security_get_secret_request, build_security_list_scan_finding_affected_resources_request, build_security_list_scans_request, - build_security_list_secret_versions_request, - build_security_list_secrets_request, build_security_list_settings_request, - build_security_post_restore_secret_request, - build_security_update_secret_request, build_security_update_settings_plan_request, build_sizes_list_request, build_snapshots_delete_request, @@ -13446,7 +13441,7 @@ async def create( }, "project_id": "str" # Optional. The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. - :code:`
`:code:`
`Requires ``project:update`` scope. + :code:`
`:code:`
`Requires ``project:assign_resource`` scope. } # response body for status code(s): 200 @@ -30169,7 +30164,7 @@ async def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "project_id": "str" # Optional. The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. - :code:`
`:code:`
`Requires ``project:update`` scope. + :code:`
`:code:`
`Requires ``project:assign_resource`` scope. } # response body for status code(s): 200 @@ -111450,8 +111445,10 @@ async def list_clusters( } ], "pg_allow_replication": bool # - Optional. For Postgres clusters, set to ``true`` for a user - with replication rights. This option is not currently + Optional. For PostgreSQL clusters, set to ``true`` to grant + the user replication privileges. When omitted on create or + update, the value defaults to ``false`` and replication + privileges are not granted. This option is not currently supported for other database engines. } } @@ -111727,7 +111724,7 @@ async def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.:code:`
`:code:`
`Requires - ``project:update`` scope. + ``project:assign_resource`` scope. "rules": [ { "type": "str", # The type of resource that the firewall rule @@ -111904,9 +111901,10 @@ async def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ], @@ -112208,9 +112206,11 @@ async def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -112581,9 +112581,11 @@ async def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -112775,7 +112777,7 @@ async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> J "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.:code:`
`:code:`
`Requires - ``project:update`` scope. + ``project:assign_resource`` scope. "rules": [ { "type": "str", # The type of resource that the firewall rule @@ -112952,9 +112954,10 @@ async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> J } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ], @@ -113256,9 +113259,11 @@ async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> J } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -113692,9 +113697,11 @@ async def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -115506,10 +115513,11 @@ async def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -115578,10 +115586,11 @@ async def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -115622,10 +115631,11 @@ async def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -118038,6 +118048,11 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: For MySQL clusters, additional options will be contained in the mysql_settings object. + For PostgreSQL clusters, additional options will be contained in the ``settings`` + object (for example, ``pg_allow_replication``\\ ). + + For Kafka clusters, additional options will be contained in the ``settings`` object. + For MongoDB clusters, additional information will be contained in the mongo_user_settings object. @@ -118128,9 +118143,10 @@ async def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ] @@ -118245,10 +118261,14 @@ async def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -118340,9 +118360,11 @@ async def add_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -118417,9 +118439,11 @@ async def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -118456,10 +118480,14 @@ async def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -118551,9 +118579,11 @@ async def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -118585,10 +118615,14 @@ async def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -118677,9 +118711,11 @@ async def add_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -118754,9 +118790,11 @@ async def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -118883,6 +118921,9 @@ async def get_user( For MySQL clusters, additional options will be contained in the ``mysql_settings`` object. + For PostgreSQL clusters, additional options will be contained in the ``settings`` + object (for example, ``pg_allow_replication``\\ ). + For Kafka clusters, additional options will be contained in the ``settings`` object. For MongoDB clusters, additional information will be contained in the mongo_user_settings @@ -118970,9 +119011,11 @@ async def get_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -119201,8 +119244,14 @@ async def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -119271,9 +119320,11 @@ async def update_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -119348,9 +119399,11 @@ async def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -119388,8 +119441,14 @@ async def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -119480,9 +119539,11 @@ async def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -119518,8 +119579,14 @@ async def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -119585,9 +119652,11 @@ async def update_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -119662,9 +119731,11 @@ async def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -119895,9 +119966,11 @@ async def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -120024,9 +120097,11 @@ async def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -120160,9 +120235,11 @@ async def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -133724,9 +133801,10 @@ class of Droplets created from this size. For example: Basic, General The unit of measure for the disk size. }, "type": "str" # Optional. The type - of disk. All Droplets contain a ``local`` disk. Additionally, - GPU Droplets can also have a ``scratch`` disk for - non-persistent data. Known values are: "local" and "scratch". + of disk. All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk + for non-persistent data. Known values are: "local", "remote", + and "scratch". } ], "gpu_info": { @@ -133771,9 +133849,10 @@ class of Droplets created from this size. For example: Basic, General of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -134397,9 +134476,10 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -134442,9 +134522,9 @@ async def get(self, droplet_id: int, **kwargs: Any) -> JSON: measure for the disk size. }, "type": "str" # Optional. The type of disk. All - Droplets contain a ``local`` disk. Additionally, GPU Droplets can - also have a ``scratch`` disk for non-persistent data. Known values - are: "local" and "scratch". + Droplets contain a ``local`` or ``remote`` disk. Additionally, GPU + Droplets can also have a ``scratch`` disk for non-persistent data. + Known values are: "local", "remote", and "scratch". } ], "gpu_info": { @@ -135970,9 +136050,10 @@ class of Droplets created from this size. For example: Basic, General The unit of measure for the disk size. }, "type": "str" # Optional. The type - of disk. All Droplets contain a ``local`` disk. Additionally, - GPU Droplets can also have a ``scratch`` disk for - non-persistent data. Known values are: "local" and "scratch". + of disk. All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk + for non-persistent data. Known values are: "local", "remote", + and "scratch". } ], "gpu_info": { @@ -136017,9 +136098,10 @@ class of Droplets created from this size. For example: Basic, General of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -150188,6 +150270,10 @@ async def list_clusters( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -150500,6 +150586,10 @@ async def create_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -150719,257 +150809,265 @@ async def create_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, - "rdma_shared_dev_plugin": { - "enabled": bool # Optional. Indicates whether the RDMA - shared device plugin is enabled. - }, - "registry_enabled": bool, # Optional. A read-only boolean value - indicating if a container registry is integrated with the cluster. - "routing_agent": { + "p2p_oci_registry_plugin": { "enabled": bool # Optional. Indicates whether the - routing-agent component is enabled. - }, - "service_subnet": "str", # Optional. The range of assignable IP - addresses for services running in the Kubernetes cluster in CIDR notation. - "sso": { - "client_id": "str", # Optional. The OIDC client ID - registered with the identity provider. Required when ``enabled`` is - ``true``. - "enabled": False, # Optional. Default value is False. - Indicates whether SSO authentication is enabled for the cluster. - "issuer_url": "str", # Optional. The OIDC issuer URL for the - identity provider. Required when ``enabled`` is ``true``. - "required": False # Optional. Default value is False. - Indicates whether any non-SSO forms of authentication are disallowed. Can - only be set to ``true`` when ``enabled`` is ``true``. - }, - "status": { - "message": "str", # Optional. An optional message providing - additional information about the current cluster state. - "state": "str" # Optional. A string indicating the current - status of the cluster. Known values are: "running", "provisioning", - "degraded", "error", "deleted", "upgrading", and "deleting". - }, - "surge_upgrade": False, # Optional. Default value is False. A - boolean value indicating whether surge upgrade is enabled/disabled for the - cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing - up new nodes before destroying the outdated nodes. - "tags": [ - "str" # Optional. An array of tags to apply to the - Kubernetes cluster. All clusters are automatically tagged ``k8s`` and - ``k8s:$K8S_CLUSTER_ID``. :code:`
`:code:`
`Requires ``tag:read`` - and ``tag:create`` scope, as well as ``tag:delete`` if existing tags are - getting removed. - ], - "updated_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was last updated. - "vpc_uuid": "str", # Optional. A string specifying the UUID of the - VPC to which the Kubernetes cluster is - assigned.:code:`
`:code:`
`Requires ``vpc:read`` scope. - "worker_subnet_uuid": "str" # Optional. The UUID of the VPC subnet - to attach worker nodes to. When omitted on create, the default subnet for the - VPC is used. This value cannot be changed after the cluster is created. - ``vpc_uuid`` must also be set. :code:`
`:code:`
`Requires ``vpc:read`` - scope. - } - } - """ - - @overload - async def create_cluster( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create a New Kubernetes Cluster. - - To create a new Kubernetes cluster, send a POST request to - ``/v2/kubernetes/clusters``. The request must contain at least one node pool - with at least one worker. - - The request may contain a maintenance window policy describing a time period - when disruptive maintenance tasks may be carried out. Omitting the policy - implies that a window will be chosen automatically. See - `here `_ - for details. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 201 - response == { - "kubernetes_cluster": { - "name": "str", # A human-readable name for a Kubernetes cluster. - Required. - "node_pools": [ - { - "auto_scale": bool, # Optional. A boolean value - indicating whether auto-scaling is enabled for this node pool. - "count": 0, # Optional. The number of Droplet - instances in the node pool. - "id": "str", # Optional. A unique ID that can be - used to identify and reference a specific node pool. - "labels": {}, # Optional. An object of key/value - mappings specifying labels to apply to all nodes in a pool. Labels - will automatically be applied to all existing nodes and any - subsequent nodes added to the pool. Note that when a label is - removed, it is not deleted from the nodes in the pool. - "max_nodes": 0, # Optional. The maximum number of - nodes that this node pool can be auto-scaled to. The value will be - ``0`` if ``auto_scale`` is set to ``false``. - "min_nodes": 0, # Optional. The minimum number of - nodes that this node pool can be auto-scaled to. The value will be - ``0`` if ``auto_scale`` is set to ``false``. - "name": "str", # Optional. A human-readable name for - the node pool. - "nodes": [ - { - "created_at": "2020-02-20 00:00:00", - # Optional. A time value given in ISO8601 combined date and - time format that represents when the node was created. - "droplet_id": "str", # Optional. The - ID of the Droplet used for the worker node. - "id": "str", # Optional. A unique ID - that can be used to identify and reference the node. - "name": "str", # Optional. An - automatically generated, human-readable name for the node. - "status": { - "state": "str" # Optional. A - string indicating the current status of the node. Known - values are: "provisioning", "running", "draining", and - "deleting". - }, - "updated_at": "2020-02-20 00:00:00" - # Optional. A time value given in ISO8601 combined date and - time format that represents when the node was last updated. - } - ], - "size": "str", # Optional. The slug identifier for - the type of Droplet used as workers in the node pool. - "tags": [ - "str" # Optional. An array containing the - tags applied to the node pool. All node pools are automatically - tagged ``k8s``"" , ``k8s-worker``"" , and - ``k8s:$K8S_CLUSTER_ID``. :code:`
`:code:`
`Requires - ``tag:read`` scope. - ], - "taints": [ - { - "effect": "str", # Optional. How the - node reacts to pods that it won't tolerate. Available effect - values are ``NoSchedule``"" , ``PreferNoSchedule``"" , and - ``NoExecute``. Known values are: "NoSchedule", - "PreferNoSchedule", and "NoExecute". - "key": "str", # Optional. An - arbitrary string. The ``key`` and ``value`` fields of the - ``taint`` object form a key-value pair. For example, if the - value of the ``key`` field is "special" and the value of the - ``value`` field is "gpu", the key value pair would be - ``special=gpu``. - "value": "str" # Optional. An - arbitrary string. The ``key`` and ``value`` fields of the - ``taint`` object form a key-value pair. For example, if the - value of the ``key`` field is "special" and the value of the - ``value`` field is "gpu", the key value pair would be - ``special=gpu``. - } - ] - } - ], - "region": "str", # The slug identifier for the region where the - Kubernetes cluster is located. Required. - "version": "str", # The slug identifier for the version of - Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the - latest version within it will be used (e.g. "1.14.6-do.1"); if set to - "latest", the latest published version will be used. See the - ``/v2/kubernetes/options`` endpoint to find all currently available versions. - Required. - "amd_gpu_device_metrics_exporter_plugin": { - "enabled": bool # Optional. Indicates whether the AMD Device - Metrics Exporter is enabled. - }, - "amd_gpu_device_plugin": { - "enabled": bool # Optional. Indicates whether the AMD GPU - Device Plugin is enabled. - }, - "auto_upgrade": False, # Optional. Default value is False. A boolean - value indicating whether the cluster will be automatically upgraded to new - patch releases during its maintenance window. - "cluster_autoscaler_configuration": { - "expanders": [ - "str" # Optional. Customizes expanders used by - cluster-autoscaler. The autoscaler will apply each expander from the - provided list to narrow down the selection of node types created to - scale up, until either a single node type is left, or the list of - expanders is exhausted. If this flag is unset, autoscaler will use - its default expander ``random``. Passing an empty list ("" *not* - ``null``"" ) will unset any previous expander customizations. - Available expanders: * ``random``"" : Randomly selects a node group - to scale. * `priority`: Selects the node group with the highest - priority as per [user-provided - configuration](https://docs.digitalocean.com/products/kubernetes/how-to/autoscale/#configuring-priority-expander) - * ``least_waste``"" : Selects the node group that will result in the - least amount of idle resources. - ], - "scale_down_unneeded_time": "str", # Optional. Used to - customize how long a node is unneeded before being scaled down. - "scale_down_utilization_threshold": 0.0 # Optional. Used to - customize when cluster autoscaler scales down non-empty nodes by setting - the node utilization threshold. - }, - "cluster_subnet": "str", # Optional. The range of IP addresses for - the overlay network of the Kubernetes cluster in CIDR notation. - "control_plane_firewall": { - "allowed_addresses": [ - "str" # Optional. An array of public addresses (IPv4 - or CIDR) allowed to access the control plane. - ], - "enabled": bool # Optional. Indicates whether the control - plane firewall is enabled. - }, - "coredns_autoscaler": { - "enabled": bool # Optional. Indicates whether the CoreDNS - Cluster Proportional Autoscaler add-on is enabled. - }, - "created_at": "2020-02-20 00:00:00", # Optional. A time value given - in ISO8601 combined date and time format that represents when the Kubernetes - cluster was created. - "endpoint": "str", # Optional. The base URL of the API server on the - Kubernetes master node. - "ha": bool, # Optional. A boolean value indicating whether the - control plane is run in a highly available configuration in the cluster. - Highly available control planes incur less downtime. The property cannot be - disabled. When omitted on create, the default is version-dependent; for DOKS - 1.36.0 and later, the default is true; for earlier versions, the default is - false. - "id": "str", # Optional. A unique ID that can be used to identify - and reference a Kubernetes cluster. - "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes - master node. This will not be set if high availability is configured on the - cluster (v1.21+). - "maintenance_policy": { - "day": "str", # Optional. The day of the maintenance window - policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to - indicate an arbitrary week day. Known values are: "any", "monday", - "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". - "duration": "str", # Optional. The duration of the - maintenance window policy in human-readable format. - "start_time": "str" # Optional. The start time in UTC of the - maintenance window policy in 24-hour clock format / HH:MM notation (e.g., - ``15:00``"" ). - }, - "nvidia_gpu_device_plugin": { - "enabled": bool # Optional. Indicates whether the Nvidia GPU - Device Plugin is enabled. + Peer-to-peer OCI registry component is enabled. + }, + "rdma_shared_dev_plugin": { + "enabled": bool # Optional. Indicates whether the RDMA + shared device plugin is enabled. + }, + "registry_enabled": bool, # Optional. A read-only boolean value + indicating if a container registry is integrated with the cluster. + "routing_agent": { + "enabled": bool # Optional. Indicates whether the + routing-agent component is enabled. + }, + "service_subnet": "str", # Optional. The range of assignable IP + addresses for services running in the Kubernetes cluster in CIDR notation. + "sso": { + "client_id": "str", # Optional. The OIDC client ID + registered with the identity provider. Required when ``enabled`` is + ``true``. + "enabled": False, # Optional. Default value is False. + Indicates whether SSO authentication is enabled for the cluster. + "issuer_url": "str", # Optional. The OIDC issuer URL for the + identity provider. Required when ``enabled`` is ``true``. + "required": False # Optional. Default value is False. + Indicates whether any non-SSO forms of authentication are disallowed. Can + only be set to ``true`` when ``enabled`` is ``true``. + }, + "status": { + "message": "str", # Optional. An optional message providing + additional information about the current cluster state. + "state": "str" # Optional. A string indicating the current + status of the cluster. Known values are: "running", "provisioning", + "degraded", "error", "deleted", "upgrading", and "deleting". + }, + "surge_upgrade": False, # Optional. Default value is False. A + boolean value indicating whether surge upgrade is enabled/disabled for the + cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing + up new nodes before destroying the outdated nodes. + "tags": [ + "str" # Optional. An array of tags to apply to the + Kubernetes cluster. All clusters are automatically tagged ``k8s`` and + ``k8s:$K8S_CLUSTER_ID``. :code:`
`:code:`
`Requires ``tag:read`` + and ``tag:create`` scope, as well as ``tag:delete`` if existing tags are + getting removed. + ], + "updated_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was last updated. + "vpc_uuid": "str", # Optional. A string specifying the UUID of the + VPC to which the Kubernetes cluster is + assigned.:code:`
`:code:`
`Requires ``vpc:read`` scope. + "worker_subnet_uuid": "str" # Optional. The UUID of the VPC subnet + to attach worker nodes to. When omitted on create, the default subnet for the + VPC is used. This value cannot be changed after the cluster is created. + ``vpc_uuid`` must also be set. :code:`
`:code:`
`Requires ``vpc:read`` + scope. + } + } + """ + + @overload + async def create_cluster( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a New Kubernetes Cluster. + + To create a new Kubernetes cluster, send a POST request to + ``/v2/kubernetes/clusters``. The request must contain at least one node pool + with at least one worker. + + The request may contain a maintenance window policy describing a time period + when disruptive maintenance tasks may be carried out. Omitting the policy + implies that a window will be chosen automatically. See + `here `_ + for details. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201 + response == { + "kubernetes_cluster": { + "name": "str", # A human-readable name for a Kubernetes cluster. + Required. + "node_pools": [ + { + "auto_scale": bool, # Optional. A boolean value + indicating whether auto-scaling is enabled for this node pool. + "count": 0, # Optional. The number of Droplet + instances in the node pool. + "id": "str", # Optional. A unique ID that can be + used to identify and reference a specific node pool. + "labels": {}, # Optional. An object of key/value + mappings specifying labels to apply to all nodes in a pool. Labels + will automatically be applied to all existing nodes and any + subsequent nodes added to the pool. Note that when a label is + removed, it is not deleted from the nodes in the pool. + "max_nodes": 0, # Optional. The maximum number of + nodes that this node pool can be auto-scaled to. The value will be + ``0`` if ``auto_scale`` is set to ``false``. + "min_nodes": 0, # Optional. The minimum number of + nodes that this node pool can be auto-scaled to. The value will be + ``0`` if ``auto_scale`` is set to ``false``. + "name": "str", # Optional. A human-readable name for + the node pool. + "nodes": [ + { + "created_at": "2020-02-20 00:00:00", + # Optional. A time value given in ISO8601 combined date and + time format that represents when the node was created. + "droplet_id": "str", # Optional. The + ID of the Droplet used for the worker node. + "id": "str", # Optional. A unique ID + that can be used to identify and reference the node. + "name": "str", # Optional. An + automatically generated, human-readable name for the node. + "status": { + "state": "str" # Optional. A + string indicating the current status of the node. Known + values are: "provisioning", "running", "draining", and + "deleting". + }, + "updated_at": "2020-02-20 00:00:00" + # Optional. A time value given in ISO8601 combined date and + time format that represents when the node was last updated. + } + ], + "size": "str", # Optional. The slug identifier for + the type of Droplet used as workers in the node pool. + "tags": [ + "str" # Optional. An array containing the + tags applied to the node pool. All node pools are automatically + tagged ``k8s``"" , ``k8s-worker``"" , and + ``k8s:$K8S_CLUSTER_ID``. :code:`
`:code:`
`Requires + ``tag:read`` scope. + ], + "taints": [ + { + "effect": "str", # Optional. How the + node reacts to pods that it won't tolerate. Available effect + values are ``NoSchedule``"" , ``PreferNoSchedule``"" , and + ``NoExecute``. Known values are: "NoSchedule", + "PreferNoSchedule", and "NoExecute". + "key": "str", # Optional. An + arbitrary string. The ``key`` and ``value`` fields of the + ``taint`` object form a key-value pair. For example, if the + value of the ``key`` field is "special" and the value of the + ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + "value": "str" # Optional. An + arbitrary string. The ``key`` and ``value`` fields of the + ``taint`` object form a key-value pair. For example, if the + value of the ``key`` field is "special" and the value of the + ``value`` field is "gpu", the key value pair would be + ``special=gpu``. + } + ] + } + ], + "region": "str", # The slug identifier for the region where the + Kubernetes cluster is located. Required. + "version": "str", # The slug identifier for the version of + Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the + latest version within it will be used (e.g. "1.14.6-do.1"); if set to + "latest", the latest published version will be used. See the + ``/v2/kubernetes/options`` endpoint to find all currently available versions. + Required. + "amd_gpu_device_metrics_exporter_plugin": { + "enabled": bool # Optional. Indicates whether the AMD Device + Metrics Exporter is enabled. + }, + "amd_gpu_device_plugin": { + "enabled": bool # Optional. Indicates whether the AMD GPU + Device Plugin is enabled. + }, + "auto_upgrade": False, # Optional. Default value is False. A boolean + value indicating whether the cluster will be automatically upgraded to new + patch releases during its maintenance window. + "cluster_autoscaler_configuration": { + "expanders": [ + "str" # Optional. Customizes expanders used by + cluster-autoscaler. The autoscaler will apply each expander from the + provided list to narrow down the selection of node types created to + scale up, until either a single node type is left, or the list of + expanders is exhausted. If this flag is unset, autoscaler will use + its default expander ``random``. Passing an empty list ("" *not* + ``null``"" ) will unset any previous expander customizations. + Available expanders: * ``random``"" : Randomly selects a node group + to scale. * `priority`: Selects the node group with the highest + priority as per [user-provided + configuration](https://docs.digitalocean.com/products/kubernetes/how-to/autoscale/#configuring-priority-expander) + * ``least_waste``"" : Selects the node group that will result in the + least amount of idle resources. + ], + "scale_down_unneeded_time": "str", # Optional. Used to + customize how long a node is unneeded before being scaled down. + "scale_down_utilization_threshold": 0.0 # Optional. Used to + customize when cluster autoscaler scales down non-empty nodes by setting + the node utilization threshold. + }, + "cluster_subnet": "str", # Optional. The range of IP addresses for + the overlay network of the Kubernetes cluster in CIDR notation. + "control_plane_firewall": { + "allowed_addresses": [ + "str" # Optional. An array of public addresses (IPv4 + or CIDR) allowed to access the control plane. + ], + "enabled": bool # Optional. Indicates whether the control + plane firewall is enabled. + }, + "coredns_autoscaler": { + "enabled": bool # Optional. Indicates whether the CoreDNS + Cluster Proportional Autoscaler add-on is enabled. + }, + "created_at": "2020-02-20 00:00:00", # Optional. A time value given + in ISO8601 combined date and time format that represents when the Kubernetes + cluster was created. + "endpoint": "str", # Optional. The base URL of the API server on the + Kubernetes master node. + "ha": bool, # Optional. A boolean value indicating whether the + control plane is run in a highly available configuration in the cluster. + Highly available control planes incur less downtime. The property cannot be + disabled. When omitted on create, the default is version-dependent; for DOKS + 1.36.0 and later, the default is true; for earlier versions, the default is + false. + "id": "str", # Optional. A unique ID that can be used to identify + and reference a Kubernetes cluster. + "ipv4": "str", # Optional. The public IPv4 address of the Kubernetes + master node. This will not be set if high availability is configured on the + cluster (v1.21+). + "maintenance_policy": { + "day": "str", # Optional. The day of the maintenance window + policy. May be one of ``monday`` through ``sunday``"" , or ``any`` to + indicate an arbitrary week day. Known values are: "any", "monday", + "tuesday", "wednesday", "thursday", "friday", "saturday", and "sunday". + "duration": "str", # Optional. The duration of the + maintenance window policy in human-readable format. + "start_time": "str" # Optional. The start time in UTC of the + maintenance window policy in 24-hour clock format / HH:MM notation (e.g., + ``15:00``"" ). + }, + "nvidia_gpu_device_plugin": { + "enabled": bool # Optional. Indicates whether the Nvidia GPU + Device Plugin is enabled. + }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA @@ -151209,6 +151307,10 @@ async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> J "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -151428,6 +151530,10 @@ async def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> J "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -151741,6 +151847,10 @@ async def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -151983,6 +152093,10 @@ async def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -152179,6 +152293,10 @@ async def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -152443,6 +152561,10 @@ async def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -152600,6 +152722,10 @@ async def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -152796,6 +152922,10 @@ async def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -174396,14 +174526,14 @@ async def delete_access_point(self, access_point_id: str, **kwargs: Any) -> JSON return cast(JSON, deserialized) # type: ignore -class PartnerAttachmentsOperations: +class OrganizationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~pydo.aio.GeneratedClient`'s - :attr:`partner_attachments` attribute. + :attr:`organizations` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -174415,18 +174545,25 @@ def __init__(self, *args, **kwargs) -> None: input_args.pop(0) if input_args else kwargs.pop("deserializer") ) - @distributed_trace_async - async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + @overload + async def create_team( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """List all partner attachments. + """Create a Team in an Organization. - To list all of the Partner Attachments on your account, send a ``GET`` request to - ``/v2/partner_network_connect/attachments``. + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. - :keyword per_page: Number of items returned per page. Default value is 20. - :paramtype per_page: int - :keyword page: Which 'page' of paginated results to return. Default value is 1. - :paramtype page: int + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -174434,52 +174571,333 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO Example: .. code-block:: python - # response body for status code(s): 200 + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The human-readable name for the team to create. Required. + "invitations": [ + { + "email": "str", # The email address of the user to invite. + Required. + "role": "str" # The role to assign to the invited user. The + ``owner`` role cannot be assigned via invitation. Required. Known values + are: "member", "biller", "billing viewer", "resource viewer", and + "modifier". + } + ] + } + + # response body for status code(s): 201 response == { - "meta": { - "total": 0 # Optional. Number of objects returned by the request. + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. }, - "links": { - "pages": {} + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + async def create_team( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Team in an Organization. + + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. + + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201 + response == { + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. }, - "partner_attachments": [ + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace_async + async def create_team(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a Team in an Organization. + + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. + + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The human-readable name for the team to create. Required. + "invitations": [ { - "bgp": { - "local_asn": 0, # Optional. ASN of the local router. - "local_router_ip": "str", # Optional. IP of the - DigitalOcean router. - "peer_asn": 0, # Optional. ASN of the peer router. - "peer_router_ip": "str" # Optional. IP of the peer - router. - }, - "children": [ - "str" # Optional. An array of associated partner - attachment UUIDs. - ], - "connection_bandwidth_in_mbps": 0, # Optional. The bandwidth - (in Mbps) of the connection. - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format. - "id": "str", # Optional. A unique ID that can be used to - identify and reference the partner attachment. - "naas_provider": "str", # Optional. The Network as a Service - (NaaS) provider for the partner attachment. - "name": "str", # Optional. The name of the partner - attachment. Must be unique and may only contain alphanumeric characters, - dashes, and periods. - "parent_uuid": "str", # Optional. Associated partner - attachment UUID. - "region": "str", # Optional. The region where the partner - attachment is located. - "state": "str", # Optional. The current operational state of - the attachment. - "vpc_ids": [ - "str" # Optional. An array of VPC network IDs. - ] + "email": "str", # The email address of the user to invite. + Required. + "role": "str" # The role to assign to the invited user. The + ``owner`` role cannot be assigned via invitation. Required. Known values + are: "member", "biller", "billing viewer", "resource viewer", and + "modifier". } ] } - # response body for status code(s): 404 + + # response body for status code(s): 201 + response == { + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. + }, + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_organizations_create_team_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [201, 400, 403, 412]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 201: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 412: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace_async + async def list_teams(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Teams in an Organization. + + To list all teams in an organization, send a GET request to + ``/v2/organizations/teams``. + + This endpoint must be called in an organization context. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "teams": [ + { + "company": "str", # Optional. The company name associated + with the team, if set. + "email": "str", # Optional. The email address associated + with the team. + "id": 0, # Optional. A unique identifier for the team. + "joined_organization_at": "2020-02-20 00:00:00", # Optional. + A time value given in ISO8601 combined date and time format that + represents when the team joined the organization. + "member_count": 0, # Optional. The number of members on the + team. + "name": "str", # Optional. The human-readable name for the + team. + "status": "str", # Optional. The team's membership status + within the organization. Known values are: "joined" and "pending". + "uuid": "str" # Optional. A unique universal identifier for + the team. + } + ] + } + # response body for status code(s): 403, 412 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -174509,9 +174927,7 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO cls: ClsType[JSON] = kwargs.pop("cls", None) - _request = build_partner_attachments_list_request( - per_page=per_page, - page=page, + _request = build_organizations_list_teams_request( headers=_headers, params=_params, ) @@ -174526,7 +174942,198 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200, 403, 412]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 412: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + +class PartnerAttachmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~pydo.aio.GeneratedClient`'s + :attr:`partner_attachments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) + + @distributed_trace_async + async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List all partner attachments. + + To list all of the Partner Attachments on your account, send a ``GET`` request to + ``/v2/partner_network_connect/attachments``. + + :keyword per_page: Number of items returned per page. Default value is 20. + :paramtype per_page: int + :keyword page: Which 'page' of paginated results to return. Default value is 1. + :paramtype page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} + }, + "partner_attachments": [ + { + "bgp": { + "local_asn": 0, # Optional. ASN of the local router. + "local_router_ip": "str", # Optional. IP of the + DigitalOcean router. + "peer_asn": 0, # Optional. ASN of the peer router. + "peer_router_ip": "str" # Optional. IP of the peer + router. + }, + "children": [ + "str" # Optional. An array of associated partner + attachment UUIDs. + ], + "connection_bandwidth_in_mbps": 0, # Optional. The bandwidth + (in Mbps) of the connection. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the partner attachment. + "naas_provider": "str", # Optional. The Network as a Service + (NaaS) provider for the partner attachment. + "name": "str", # Optional. The name of the partner + attachment. Must be unique and may only contain alphanumeric characters, + dashes, and periods. + "parent_uuid": "str", # Optional. Associated partner + attachment UUID. + "region": "str", # Optional. The region where the partner + attachment is located. + "state": "str", # Optional. The current operational state of + the attachment. + "vpc_ids": [ + "str" # Optional. An array of VPC network IDs. + ] + } + ] + } + # response body for status code(s): 404 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_partner_attachments_list_request( + per_page=per_page, + page=page, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 404]: if _stream: await response.read() # Load the body in memory and close the socket map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore @@ -178398,9 +179005,10 @@ async def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -178472,9 +179080,10 @@ async def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -178532,9 +179141,10 @@ async def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -178821,9 +179431,10 @@ async def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Required. :type body: JSON @@ -178888,9 +179499,10 @@ async def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Required. :type body: IO[bytes] @@ -178946,9 +179558,10 @@ async def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -191063,1097 +191676,6 @@ async def delete_suppression( return deserialized # type: ignore - @distributed_trace_async - async def list_secrets( - self, *, per_page: int = 20, page: int = 1, **kwargs: Any - ) -> JSON: - """List Secrets. - - To list secrets across all configured regions, send a GET request to ``/v2/security/secrets``. - - :keyword per_page: Number of items returned per page. Default value is 20. - :paramtype per_page: int - :keyword page: Which 'page' of paginated results to return. Default value is 1. - :paramtype page: int - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "links": { - "pages": { - "first": "str", # Optional. URL for the first page of - results. - "last": "str", # Optional. URL for the last page of results. - "next": "str", # Optional. URL for the next page of results. - "prev": "str" # Optional. URL for the previous page of - results. - } - }, - "meta": { - "page": 0, # Optional. The current page number. - "pages": 0, # Optional. The total number of pages. - "total": 0 # Optional. The total number of secrets across all - regions. - }, - "secrets": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. When the - secret was created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. - When deletion was requested for the secret. - "region": "str", # Optional. The region where the secret is - stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - secret was last updated. - "version": 0 # Optional. The current version of the secret. - } - ], - "unavailable_regions": [ - "str" # Optional. Regions that could not be queried while building - the list response. - ] - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_list_secrets_request( - per_page=per_page, - page=page, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @overload - async def create_secret( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "name": "str", # The name of the secret to create. Required. - "region": "str", # The region where the secret will be stored. Required. - "values": { - "str": "str" # Key-value pairs to store in the secret. Required. - } - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def create_secret( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def create_secret(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "name": "str", # The name of the secret to create. Required. - "region": "str", # The region where the secret will be stored. Required. - "values": { - "str": "str" # Key-value pairs to store in the secret. Required. - } - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body - - _request = build_security_create_secret_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 400]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 400: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def get_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Get Secret. - - To retrieve a secret and its values, send a GET request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "created_at": "2020-02-20 00:00:00", # Optional. When the secret was - created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. When deletion was - requested for the secret. - "region": "str", # Optional. The region where the secret is stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the secret was last - updated. - "values": { - "str": "str" # Optional. Key-value pairs stored in the secret. - }, - "version": 0 # Optional. The current version of the secret. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_get_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @overload - async def update_secret( - self, - secret: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "region": "str", # The region where the secret is stored. Required. - "values": { - "str": "str" # Updated key-value pairs for the secret. Required. - }, - "version": 0 # The current version of the secret to update. Required. - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - async def update_secret( - self, - secret: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace_async - async def update_secret( - self, secret: str, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "region": "str", # The region where the secret is stored. Required. - "values": { - "str": "str" # Updated key-value pairs for the secret. Required. - }, - "version": 0 # The current version of the secret to update. Required. - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body - - _request = build_security_update_secret_request( - secret=secret, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 400, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 400: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def delete_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> Optional[JSON]: - # pylint: disable=line-too-long - """Delete Secret. - - To request deletion of a secret, send a DELETE request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - - _request = build_security_delete_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - deserialized = None - response_headers = {} - if response.status_code == 204: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_secret_versions( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """List Secret Versions. - - To list all versions of a secret, send a GET request to - ``/v2/security/secrets/{secret}/versions``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "versions": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. When this - version was created. - "updated_at": "2020-02-20 00:00:00", # Optional. When this - version was last updated. - "version": 0 # Optional. The version number. - } - ] - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_list_secret_versions_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace_async - async def post_restore_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Restore Secret. - - To restore a deleted secret, send a POST request to ``/v2/security/secrets/{secret}/restore``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "created_at": "2020-02-20 00:00:00", # Optional. When the secret was - created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. When deletion was - requested for the secret. - "region": "str", # Optional. The region where the secret is stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the secret was last - updated. - "values": { - "str": "str" # Optional. Key-value pairs stored in the secret. - }, - "version": 0 # Optional. The current version of the secret. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_post_restore_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - await response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - class SizesOperations: """ @@ -192237,9 +191759,10 @@ async def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSO of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { diff --git a/src/pydo/operations/__init__.py b/src/pydo/operations/__init__.py index 2de68fec..e3577712 100644 --- a/src/pydo/operations/__init__.py +++ b/src/pydo/operations/__init__.py @@ -31,6 +31,7 @@ from ._operations import LoadBalancersOperations from ._operations import MonitoringOperations from ._operations import NfsOperations +from ._operations import OrganizationsOperations from ._operations import PartnerAttachmentsOperations from ._operations import ProjectsOperations from ._operations import RegionsOperations @@ -90,6 +91,7 @@ "LoadBalancersOperations", "MonitoringOperations", "NfsOperations", + "OrganizationsOperations", "PartnerAttachmentsOperations", "ProjectsOperations", "RegionsOperations", diff --git a/src/pydo/operations/_operations.py b/src/pydo/operations/_operations.py index d587a331..d77aab13 100644 --- a/src/pydo/operations/_operations.py +++ b/src/pydo/operations/_operations.py @@ -9037,6 +9037,41 @@ def build_nfs_delete_access_point_request( return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) +def build_organizations_create_team_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/organizations/team" + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header( + "content_type", content_type, "str" + ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_organizations_list_teams_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/v2/organizations/teams" + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs) + + def build_partner_attachments_list_request( *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> HttpRequest: @@ -11173,192 +11208,6 @@ def build_security_delete_suppression_request( # pylint: disable=name-too-long return HttpRequest(method="DELETE", url=_url, headers=_headers, **kwargs) -def build_security_list_secrets_request( - *, per_page: int = 20, page: int = 1, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets" - - # Construct parameters - if per_page is not None: - _params["per_page"] = _SERIALIZER.query( - "per_page", per_page, "int", maximum=200, minimum=1 - ) - if page is not None: - _params["page"] = _SERIALIZER.query("page", page, "int", minimum=1) - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest( - method="GET", url=_url, params=_params, headers=_headers, **kwargs - ) - - -def build_security_create_secret_request(**kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets" - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header( - "content_type", content_type, "str" - ) - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) - - -def build_security_get_secret_request( - secret: str, *, region: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets/{secret}" - path_format_arguments = { - "secret": _SERIALIZER.url("secret", secret, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if region is not None: - _params["region"] = _SERIALIZER.query("region", region, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest( - method="GET", url=_url, params=_params, headers=_headers, **kwargs - ) - - -def build_security_update_secret_request(secret: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets/{secret}" - path_format_arguments = { - "secret": _SERIALIZER.url("secret", secret, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header( - "content_type", content_type, "str" - ) - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs) - - -def build_security_delete_secret_request( - secret: str, *, region: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets/{secret}" - path_format_arguments = { - "secret": _SERIALIZER.url("secret", secret, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if region is not None: - _params["region"] = _SERIALIZER.query("region", region, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest( - method="DELETE", url=_url, params=_params, headers=_headers, **kwargs - ) - - -def build_security_list_secret_versions_request( # pylint: disable=name-too-long - secret: str, *, region: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets/{secret}/versions" - path_format_arguments = { - "secret": _SERIALIZER.url("secret", secret, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if region is not None: - _params["region"] = _SERIALIZER.query("region", region, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest( - method="GET", url=_url, params=_params, headers=_headers, **kwargs - ) - - -def build_security_post_restore_secret_request( # pylint: disable=name-too-long - secret: str, *, region: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = "/v2/security/secrets/{secret}/restore" - path_format_arguments = { - "secret": _SERIALIZER.url("secret", secret, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if region is not None: - _params["region"] = _SERIALIZER.query("region", region, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest( - method="POST", url=_url, params=_params, headers=_headers, **kwargs - ) - - def build_sizes_list_request( *, per_page: int = 20, page: int = 1, **kwargs: Any ) -> HttpRequest: @@ -29207,7 +29056,7 @@ def create( }, "project_id": "str" # Optional. The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. - :code:`
`:code:`
`Requires ``project:update`` scope. + :code:`
`:code:`
`Requires ``project:assign_resource`` scope. } # response body for status code(s): 200 @@ -45930,7 +45779,7 @@ def create(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: }, "project_id": "str" # Optional. The ID of the project the app should be assigned to. If omitted, it will be assigned to your default project. - :code:`
`:code:`
`Requires ``project:update`` scope. + :code:`
`:code:`
`Requires ``project:assign_resource`` scope. } # response body for status code(s): 200 @@ -127197,8 +127046,10 @@ def list_clusters(self, *, tag_name: Optional[str] = None, **kwargs: Any) -> JSO } ], "pg_allow_replication": bool # - Optional. For Postgres clusters, set to ``true`` for a user - with replication rights. This option is not currently + Optional. For PostgreSQL clusters, set to ``true`` to grant + the user replication privileges. When omitted on create or + update, the value defaults to ``false`` and replication + privileges are not granted. This option is not currently supported for other database engines. } } @@ -127474,7 +127325,7 @@ def create_cluster( "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.:code:`
`:code:`
`Requires - ``project:update`` scope. + ``project:assign_resource`` scope. "rules": [ { "type": "str", # The type of resource that the firewall rule @@ -127651,9 +127502,10 @@ def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ], @@ -127955,9 +127807,11 @@ def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -128328,9 +128182,11 @@ def create_cluster( } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -128522,7 +128378,7 @@ def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "project_id": "str", # Optional. The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.:code:`
`:code:`
`Requires - ``project:update`` scope. + ``project:assign_resource`` scope. "rules": [ { "type": "str", # The type of resource that the firewall rule @@ -128699,9 +128555,10 @@ def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ], @@ -129003,9 +128860,11 @@ def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -129439,9 +129298,11 @@ def get_cluster(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user + replication privileges. When omitted on create or update, the + value defaults to ``false`` and replication privileges are not + granted. This option is not currently supported for other + database engines. } } ], @@ -131249,10 +131110,11 @@ def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -131321,10 +131183,11 @@ def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -131365,10 +131228,11 @@ def update_firewall_rules( resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 - rules (or trusted sources). When possible, we recommend `placing your databases into a VPC - network `_ to limit access to them - instead of using a firewall. - A successful. + rules (or trusted sources). You cannot add IPv6 addresses as trusted sources. For additional + limits, see your database engine's limits page. When possible, we recommend `placing your + databases into a VPC network `_ to + limit access to them instead of using a firewall. + A successful request returns a 204 status code with no content. :param database_cluster_uuid: A unique identifier for a database cluster. Required. :type database_cluster_uuid: str @@ -133781,6 +133645,11 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: For MySQL clusters, additional options will be contained in the mysql_settings object. + For PostgreSQL clusters, additional options will be contained in the ``settings`` + object (for example, ``pg_allow_replication``\\ ). + + For Kafka clusters, additional options will be contained in the ``settings`` object. + For MongoDB clusters, additional information will be contained in the mongo_user_settings object. @@ -133871,9 +133740,10 @@ def list_users(self, database_cluster_uuid: str, **kwargs: Any) -> JSON: } ], "pg_allow_replication": bool # Optional. For - Postgres clusters, set to ``true`` for a user with replication - rights. This option is not currently supported for other database - engines. + PostgreSQL clusters, set to ``true`` to grant the user replication + privileges. When omitted on create or update, the value defaults to + ``false`` and replication privileges are not granted. This option is + not currently supported for other database engines. } } ] @@ -133988,10 +133858,14 @@ def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -134083,9 +133957,11 @@ def add_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -134160,9 +134036,11 @@ def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -134199,10 +134077,14 @@ def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -134294,9 +134176,11 @@ def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -134328,10 +134212,14 @@ def add_user( When adding a user to a MySQL cluster, additional options can be configured in the ``mysql_settings`` object. + When adding a user to a PostgreSQL cluster, additional options can be configured in + the ``settings`` object (for example, ``pg_allow_replication``\\ ). When + ``pg_allow_replication`` is omitted, it defaults to ``false``. + When adding a user to a Kafka cluster, additional options can be configured in the ``settings`` object. - When adding a user to a MongoDB cluster, additional options can be configured in + When adding a user to a MongoDB cluster, additional options can be configured in the ``settings.mongo_user_settings`` object. The response will be a JSON object with a key called ``user``. The value of this will be an @@ -134420,9 +134308,11 @@ def add_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -134497,9 +134387,11 @@ def add_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -134626,6 +134518,9 @@ def get_user( For MySQL clusters, additional options will be contained in the ``mysql_settings`` object. + For PostgreSQL clusters, additional options will be contained in the ``settings`` + object (for example, ``pg_allow_replication``\\ ). + For Kafka clusters, additional options will be contained in the ``settings`` object. For MongoDB clusters, additional information will be contained in the mongo_user_settings @@ -134713,9 +134608,11 @@ def get_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -134944,8 +134841,14 @@ def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -135014,9 +134917,11 @@ def update_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -135091,9 +134996,11 @@ def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -135131,8 +135038,14 @@ def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -135223,9 +135136,11 @@ def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -135261,8 +135176,14 @@ def update_user( the name of a user, you must recreate a new user. + For PostgreSQL clusters, you can update ``settings.pg_allow_replication`` to enable or + disable replication privileges for the user. When omitted, the value defaults to ``false``. + + For Kafka and OpenSearch clusters, additional options can be configured in the + ``settings`` object (for example, topic or index ACLs). + The response will be a JSON object with a key called ``user``. The value of this will be an - object that contains the name of the update database user, along with the ``settings`` object + object that contains the name of the updated database user, along with the ``settings`` object that has been updated. @@ -135328,9 +135249,11 @@ def update_user( values are: "deny", "admin", "read", "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres clusters, set - to ``true`` for a user with replication rights. This option is not currently - supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL clusters, + set to ``true`` to grant the user replication privileges. When omitted on + create or update, the value defaults to ``false`` and replication privileges + are not granted. This option is not currently supported for other database + engines. } } @@ -135405,9 +135328,11 @@ def update_user( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -135638,9 +135563,11 @@ def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -135767,9 +135694,11 @@ def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -135903,9 +135832,11 @@ def reset_auth( "readwrite", and "write". } ], - "pg_allow_replication": bool # Optional. For Postgres - clusters, set to ``true`` for a user with replication rights. This option - is not currently supported for other database engines. + "pg_allow_replication": bool # Optional. For PostgreSQL + clusters, set to ``true`` to grant the user replication privileges. When + omitted on create or update, the value defaults to ``false`` and + replication privileges are not granted. This option is not currently + supported for other database engines. } } } @@ -149457,9 +149388,10 @@ class of Droplets created from this size. For example: Basic, General The unit of measure for the disk size. }, "type": "str" # Optional. The type - of disk. All Droplets contain a ``local`` disk. Additionally, - GPU Droplets can also have a ``scratch`` disk for - non-persistent data. Known values are: "local" and "scratch". + of disk. All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk + for non-persistent data. Known values are: "local", "remote", + and "scratch". } ], "gpu_info": { @@ -149504,9 +149436,10 @@ class of Droplets created from this size. For example: Basic, General of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -150130,9 +150063,10 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -150175,9 +150109,9 @@ def get(self, droplet_id: int, **kwargs: Any) -> JSON: measure for the disk size. }, "type": "str" # Optional. The type of disk. All - Droplets contain a ``local`` disk. Additionally, GPU Droplets can - also have a ``scratch`` disk for non-persistent data. Known values - are: "local" and "scratch". + Droplets contain a ``local`` or ``remote`` disk. Additionally, GPU + Droplets can also have a ``scratch`` disk for non-persistent data. + Known values are: "local", "remote", and "scratch". } ], "gpu_info": { @@ -151703,9 +151637,10 @@ class of Droplets created from this size. For example: Basic, General The unit of measure for the disk size. }, "type": "str" # Optional. The type - of disk. All Droplets contain a ``local`` disk. Additionally, - GPU Droplets can also have a ``scratch`` disk for - non-persistent data. Known values are: "local" and "scratch". + of disk. All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk + for non-persistent data. Known values are: "local", "remote", + and "scratch". } ], "gpu_info": { @@ -151750,9 +151685,10 @@ class of Droplets created from this size. For example: Basic, General of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": { @@ -165915,6 +165851,10 @@ def list_clusters( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -166227,6 +166167,10 @@ def create_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -166446,6 +166390,10 @@ def create_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -166698,6 +166646,10 @@ def create_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -166936,6 +166888,10 @@ def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -167155,6 +167111,10 @@ def create_cluster(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -167468,6 +167428,10 @@ def get_cluster(self, cluster_id: str, **kwargs: Any) -> JSON: "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -167710,6 +167674,10 @@ def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -167906,6 +167874,10 @@ def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -168170,6 +168142,10 @@ def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -168327,6 +168303,10 @@ def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the Peer-to-peer OCI + registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -168523,6 +168503,10 @@ def update_cluster( "enabled": bool # Optional. Indicates whether the Nvidia GPU Device Plugin is enabled. }, + "p2p_oci_registry_plugin": { + "enabled": bool # Optional. Indicates whether the + Peer-to-peer OCI registry component is enabled. + }, "rdma_shared_dev_plugin": { "enabled": bool # Optional. Indicates whether the RDMA shared device plugin is enabled. @@ -190109,14 +190093,14 @@ def delete_access_point(self, access_point_id: str, **kwargs: Any) -> JSON: return cast(JSON, deserialized) # type: ignore -class PartnerAttachmentsOperations: +class OrganizationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~pydo.GeneratedClient`'s - :attr:`partner_attachments` attribute. + :attr:`organizations` attribute. """ def __init__(self, *args, **kwargs): @@ -190128,18 +190112,25 @@ def __init__(self, *args, **kwargs): input_args.pop(0) if input_args else kwargs.pop("deserializer") ) - @distributed_trace - def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + @overload + def create_team( + self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: # pylint: disable=line-too-long - """List all partner attachments. + """Create a Team in an Organization. - To list all of the Partner Attachments on your account, send a ``GET`` request to - ``/v2/partner_network_connect/attachments``. + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. - :keyword per_page: Number of items returned per page. Default value is 20. - :paramtype per_page: int - :keyword page: Which 'page' of paginated results to return. Default value is 1. - :paramtype page: int + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -190147,52 +190138,522 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: Example: .. code-block:: python - # response body for status code(s): 200 + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The human-readable name for the team to create. Required. + "invitations": [ + { + "email": "str", # The email address of the user to invite. + Required. + "role": "str" # The role to assign to the invited user. The + ``owner`` role cannot be assigned via invitation. Required. Known values + are: "member", "biller", "billing viewer", "resource viewer", and + "modifier". + } + ] + } + + # response body for status code(s): 201 response == { - "meta": { - "total": 0 # Optional. Number of objects returned by the request. + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. }, - "links": { - "pages": {} + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @overload + def create_team( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: + # pylint: disable=line-too-long + """Create a Team in an Organization. + + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. + + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201 + response == { + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. }, - "partner_attachments": [ + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + + @distributed_trace + def create_team(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """Create a Team in an Organization. + + To create a new team within an organization, send a POST request to + ``/v2/organizations/team``. + + This endpoint must be called in an organization context. Optionally include + ``invitations`` to invite users to the new team. The ``owner`` role cannot be + assigned via invitation. + + :param body: Is either a JSON type or a IO[bytes] type. Required. + :type body: JSON or IO[bytes] + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + body = { + "name": "str", # The human-readable name for the team to create. Required. + "invitations": [ { - "bgp": { - "local_asn": 0, # Optional. ASN of the local router. - "local_router_ip": "str", # Optional. IP of the - DigitalOcean router. - "peer_asn": 0, # Optional. ASN of the peer router. - "peer_router_ip": "str" # Optional. IP of the peer - router. - }, - "children": [ - "str" # Optional. An array of associated partner - attachment UUIDs. - ], - "connection_bandwidth_in_mbps": 0, # Optional. The bandwidth - (in Mbps) of the connection. - "created_at": "2020-02-20 00:00:00", # Optional. A time - value given in ISO8601 combined date and time format. - "id": "str", # Optional. A unique ID that can be used to - identify and reference the partner attachment. - "naas_provider": "str", # Optional. The Network as a Service - (NaaS) provider for the partner attachment. - "name": "str", # Optional. The name of the partner - attachment. Must be unique and may only contain alphanumeric characters, - dashes, and periods. - "parent_uuid": "str", # Optional. Associated partner - attachment UUID. - "region": "str", # Optional. The region where the partner - attachment is located. - "state": "str", # Optional. The current operational state of - the attachment. - "vpc_ids": [ - "str" # Optional. An array of VPC network IDs. - ] + "email": "str", # The email address of the user to invite. + Required. + "role": "str" # The role to assign to the invited user. The + ``owner`` role cannot be assigned via invitation. Required. Known values + are: "member", "biller", "billing viewer", "resource viewer", and + "modifier". } ] } - # response body for status code(s): 404 + + # response body for status code(s): 201 + response == { + "team": { + "name": "str", # The human-readable name for the newly created team. + Required. + "uuid": "str" # A unique universal identifier for the newly created + team. Required. + }, + "invitations": { + "str": { + "status": "str" # Optional. The invitation delivery status + for the email address. Known values are: "ok" and + "daily_invite_limit_reached". + } + } + } + # response body for status code(s): 400, 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop( + "content_type", _headers.pop("Content-Type", None) + ) + cls: ClsType[JSON] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = body + + _request = build_organizations_create_team_request( + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [201, 400, 403, 412]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 201: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 412: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + @distributed_trace + def list_teams(self, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List Teams in an Organization. + + To list all teams in an organization, send a GET request to + ``/v2/organizations/teams``. + + This endpoint must be called in an organization context. + + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "teams": [ + { + "company": "str", # Optional. The company name associated + with the team, if set. + "email": "str", # Optional. The email address associated + with the team. + "id": 0, # Optional. A unique identifier for the team. + "joined_organization_at": "2020-02-20 00:00:00", # Optional. + A time value given in ISO8601 combined date and time format that + represents when the team joined the organization. + "member_count": 0, # Optional. The number of members on the + team. + "name": "str", # Optional. The human-readable name for the + team. + "status": "str", # Optional. The team's membership status + within the organization. Known values are: "joined" and "pending". + "uuid": "str" # Optional. A unique universal identifier for + the team. + } + ] + } + # response body for status code(s): 403, 412 + response == { + "id": "str", # A short identifier corresponding to the HTTP status code + returned. For example, the ID for a response returning a 404 status code would + be "not_found.". Required. + "message": "str", # A message providing additional information about the + error, including details to help resolve it when possible. Required. + "request_id": "str" # Optional. Optionally, some endpoints may include a + request ID that should be provided when reporting bugs or opening support + tickets to help identify the issue. + } + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + 401: cast( + Type[HttpResponseError], + lambda response: ClientAuthenticationError(response=response), + ), + 429: HttpResponseError, + 500: HttpResponseError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[JSON] = kwargs.pop("cls", None) + + _request = build_organizations_list_teams_request( + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = ( + self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 403, 412]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + raise HttpResponseError(response=response) + + response_headers = {} + if response.status_code == 200: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 403: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if response.status_code == 412: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + + if cls: + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore + + return cast(JSON, deserialized) # type: ignore + + +class PartnerAttachmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~pydo.GeneratedClient`'s + :attr:`partner_attachments` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = ( + input_args.pop(0) if input_args else kwargs.pop("deserializer") + ) + + @distributed_trace + def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: + # pylint: disable=line-too-long + """List all partner attachments. + + To list all of the Partner Attachments on your account, send a ``GET`` request to + ``/v2/partner_network_connect/attachments``. + + :keyword per_page: Number of items returned per page. Default value is 20. + :paramtype per_page: int + :keyword page: Which 'page' of paginated results to return. Default value is 1. + :paramtype page: int + :return: JSON object + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "meta": { + "total": 0 # Optional. Number of objects returned by the request. + }, + "links": { + "pages": {} + }, + "partner_attachments": [ + { + "bgp": { + "local_asn": 0, # Optional. ASN of the local router. + "local_router_ip": "str", # Optional. IP of the + DigitalOcean router. + "peer_asn": 0, # Optional. ASN of the peer router. + "peer_router_ip": "str" # Optional. IP of the peer + router. + }, + "children": [ + "str" # Optional. An array of associated partner + attachment UUIDs. + ], + "connection_bandwidth_in_mbps": 0, # Optional. The bandwidth + (in Mbps) of the connection. + "created_at": "2020-02-20 00:00:00", # Optional. A time + value given in ISO8601 combined date and time format. + "id": "str", # Optional. A unique ID that can be used to + identify and reference the partner attachment. + "naas_provider": "str", # Optional. The Network as a Service + (NaaS) provider for the partner attachment. + "name": "str", # Optional. The name of the partner + attachment. Must be unique and may only contain alphanumeric characters, + dashes, and periods. + "parent_uuid": "str", # Optional. Associated partner + attachment UUID. + "region": "str", # Optional. The region where the partner + attachment is located. + "state": "str", # Optional. The current operational state of + the attachment. + "vpc_ids": [ + "str" # Optional. An array of VPC network IDs. + ] + } + ] + } + # response body for status code(s): 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -194111,9 +194572,10 @@ def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -194185,9 +194647,10 @@ def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -194245,9 +194708,10 @@ def assign_resources( To assign resources to a project, send a POST request to ``/v2/projects/$PROJECT_ID/resources``. - You must have both ``project:update`` and ``:read`` scopes to assign new resources. - For example, to assign a Droplet to a project, include both the ``project:update`` and - ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to a project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param project_id: A unique identifier for a project. Required. :type project_id: str @@ -194534,9 +194998,10 @@ def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Required. :type body: JSON @@ -194601,9 +195066,10 @@ def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Required. :type body: IO[bytes] @@ -194659,9 +195125,10 @@ def assign_resources_default( To assign resources to your default project, send a POST request to ``/v2/projects/default/resources``. - You must have both project:update and :code:``:read scopes to assign new resources. - For example, to assign a Droplet to the default project, include both the ``project:update`` - and ``droplet:read`` scopes. + You must have both ``project:assign_resource`` and ``:read`` scopes to assign new + resources. For example, to assign a Droplet to the default project, include both the + ``project:assign_resource`` and ``droplet:read`` scopes. The ``project:update`` scope also + grants ``project:assign_resource``. :param body: Is either a JSON type or a IO[bytes] type. Required. :type body: JSON or IO[bytes] @@ -206770,1095 +207237,6 @@ def delete_suppression( return deserialized # type: ignore - @distributed_trace - def list_secrets(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: - """List Secrets. - - To list secrets across all configured regions, send a GET request to ``/v2/security/secrets``. - - :keyword per_page: Number of items returned per page. Default value is 20. - :paramtype per_page: int - :keyword page: Which 'page' of paginated results to return. Default value is 1. - :paramtype page: int - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "links": { - "pages": { - "first": "str", # Optional. URL for the first page of - results. - "last": "str", # Optional. URL for the last page of results. - "next": "str", # Optional. URL for the next page of results. - "prev": "str" # Optional. URL for the previous page of - results. - } - }, - "meta": { - "page": 0, # Optional. The current page number. - "pages": 0, # Optional. The total number of pages. - "total": 0 # Optional. The total number of secrets across all - regions. - }, - "secrets": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. When the - secret was created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. - When deletion was requested for the secret. - "region": "str", # Optional. The region where the secret is - stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the - secret was last updated. - "version": 0 # Optional. The current version of the secret. - } - ], - "unavailable_regions": [ - "str" # Optional. Regions that could not be queried while building - the list response. - ] - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_list_secrets_request( - per_page=per_page, - page=page, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @overload - def create_secret( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "name": "str", # The name of the secret to create. Required. - "region": "str", # The region where the secret will be stored. Required. - "values": { - "str": "str" # Key-value pairs to store in the secret. Required. - } - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - def create_secret( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace - def create_secret(self, body: Union[JSON, IO[bytes]], **kwargs: Any) -> JSON: - # pylint: disable=line-too-long - """Create Secret. - - To create a secret, send a POST request to ``/v2/security/secrets``. - - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "name": "str", # The name of the secret to create. Required. - "region": "str", # The region where the secret will be stored. Required. - "values": { - "str": "str" # Key-value pairs to store in the secret. Required. - } - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body - - _request = build_security_create_secret_request( - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 400]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 400: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def get_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Get Secret. - - To retrieve a secret and its values, send a GET request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "created_at": "2020-02-20 00:00:00", # Optional. When the secret was - created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. When deletion was - requested for the secret. - "region": "str", # Optional. The region where the secret is stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the secret was last - updated. - "values": { - "str": "str" # Optional. Key-value pairs stored in the secret. - }, - "version": 0 # Optional. The current version of the secret. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_get_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @overload - def update_secret( - self, - secret: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "region": "str", # The region where the secret is stored. Required. - "values": { - "str": "str" # Updated key-value pairs for the secret. Required. - }, - "version": 0 # The current version of the secret to update. Required. - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @overload - def update_secret( - self, - secret: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any, - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - - @distributed_trace - def update_secret( - self, secret: str, body: Union[JSON, IO[bytes]], **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Update Secret. - - To update a secret, send a PUT request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :param body: Is either a JSON type or a IO[bytes] type. Required. - :type body: JSON or IO[bytes] - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # JSON input template you can fill out and use as your body input. - body = { - "region": "str", # The region where the secret is stored. Required. - "values": { - "str": "str" # Updated key-value pairs for the secret. Required. - }, - "version": 0 # The current version of the secret to update. Required. - } - - # response body for status code(s): 200 - response == { - "name": "str", # Optional. The name of the secret. - "region": "str", # Optional. The region where the secret is stored. - "version": 0 # Optional. The version of the secret after the operation. - } - # response body for status code(s): 400, 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop( - "content_type", _headers.pop("Content-Type", None) - ) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = body - - _request = build_security_update_secret_request( - secret=secret, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 400, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 400: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def delete_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> Optional[JSON]: - # pylint: disable=line-too-long - """Delete Secret. - - To request deletion of a secret, send a DELETE request to ``/v2/security/secrets/{secret}``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object or None - :rtype: JSON or None - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Optional[JSON]] = kwargs.pop("cls", None) - - _request = build_security_delete_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [204, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - deserialized = None - response_headers = {} - if response.status_code == 204: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_secret_versions( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """List Secret Versions. - - To list all versions of a secret, send a GET request to - ``/v2/security/secrets/{secret}/versions``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "versions": [ - { - "created_at": "2020-02-20 00:00:00", # Optional. When this - version was created. - "updated_at": "2020-02-20 00:00:00", # Optional. When this - version was last updated. - "version": 0 # Optional. The version number. - } - ] - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_list_secret_versions_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - - @distributed_trace - def post_restore_secret( - self, secret: str, *, region: Optional[str] = None, **kwargs: Any - ) -> JSON: - # pylint: disable=line-too-long - """Restore Secret. - - To restore a deleted secret, send a POST request to ``/v2/security/secrets/{secret}/restore``. - - :param secret: The name of the secret. Required. - :type secret: str - :keyword region: The slug identifier for the region where the resource is available. Known - values are: "ams1", "ams2", "ams3", "blr1", "fra1", "lon1", "nyc1", "nyc2", "nyc3", "sfo1", - "sfo2", "sfo3", "sgp1", "tor1", and "syd1". Default value is None. - :paramtype region: str - :return: JSON object - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - - Example: - .. code-block:: python - - # response body for status code(s): 200 - response == { - "created_at": "2020-02-20 00:00:00", # Optional. When the secret was - created. - "delete_requested_at": "2020-02-20 00:00:00", # Optional. When deletion was - requested for the secret. - "region": "str", # Optional. The region where the secret is stored. - "secret": "str", # Optional. The name of the secret. - "updated_at": "2020-02-20 00:00:00", # Optional. When the secret was last - updated. - "values": { - "str": "str" # Optional. Key-value pairs stored in the secret. - }, - "version": 0 # Optional. The current version of the secret. - } - # response body for status code(s): 404 - response == { - "id": "str", # A short identifier corresponding to the HTTP status code - returned. For example, the ID for a response returning a 404 status code would - be "not_found.". Required. - "message": "str", # A message providing additional information about the - error, including details to help resolve it when possible. Required. - "request_id": "str" # Optional. Optionally, some endpoints may include a - request ID that should be provided when reporting bugs or opening support - tickets to help identify the issue. - } - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - 401: cast( - Type[HttpResponseError], - lambda response: ClientAuthenticationError(response=response), - ), - 429: HttpResponseError, - 500: HttpResponseError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_security_post_restore_secret_request( - secret=secret, - region=region, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = ( - self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - if _stream: - response.read() # Load the body in memory and close the socket - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore - raise HttpResponseError(response=response) - - response_headers = {} - if response.status_code == 200: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if response.status_code == 404: - response_headers["ratelimit-limit"] = self._deserialize( - "int", response.headers.get("ratelimit-limit") - ) - response_headers["ratelimit-remaining"] = self._deserialize( - "int", response.headers.get("ratelimit-remaining") - ) - response_headers["ratelimit-reset"] = self._deserialize( - "int", response.headers.get("ratelimit-reset") - ) - - if response.content: - deserialized = response.json() - else: - deserialized = None - - if cls: - return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - - return cast(JSON, deserialized) # type: ignore - class SizesOperations: """ @@ -207942,9 +207320,10 @@ def list(self, *, per_page: int = 20, page: int = 1, **kwargs: Any) -> JSON: of measure for the disk size. }, "type": "str" # Optional. The type of disk. - All Droplets contain a ``local`` disk. Additionally, GPU Droplets - can also have a ``scratch`` disk for non-persistent data. Known - values are: "local" and "scratch". + All Droplets contain a ``local`` or ``remote`` disk. + Additionally, GPU Droplets can also have a ``scratch`` disk for + non-persistent data. Known values are: "local", "remote", and + "scratch". } ], "gpu_info": {