diff --git a/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md b/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md index b622328e29c7..c9415bcbc6d8 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md +++ b/sdk/horizondb/azure-mgmt-horizondb/CHANGELOG.md @@ -1,7 +1,48 @@ # Release History +## 1.0.0b2 (2026-08-20) + +### Features Added + + - Client `HorizonDBMgmtClient` added operation group `horizon_db_administrators` + - Model `HorizonDbCluster` added property `identity` + - Model `HorizonDbClusterForPatchUpdate` added property `identity` + - Model `HorizonDbClusterProperties` added property `auth_config` + - Model `HorizonDbClusterProperties` added property `compute_model` + - Model `HorizonDbClusterProperties` added property `mirroring` + - Model `HorizonDbClusterPropertiesForPatchUpdate` added property `auth_config` + - Model `HorizonDbClusterPropertiesForPatchUpdate` added property `compute_model` + - Model `HorizonDbClusterPropertiesForPatchUpdate` added property `mirroring` + - Enum `State` added member `SUCCEEDED` + - Enum `State` added member `UPGRADING` + - Added enum `AuthenticationState` + - Added model `HorizonDbAdministrator` + - Added model `HorizonDbAdministratorAdd` + - Added model `HorizonDbAdministratorProperties` + - Added model `HorizonDbAdministratorPropertiesForAdd` + - Added model `HorizonDbClusterAuthConfig` + - Added model `HorizonDbClusterMirroring` + - Added model `HorizonDbComputeModel` + - Added enum `HorizonDbComputeModelType` + - Added model `ManagedServiceIdentity` + - Added enum `ManagedServiceIdentityType` + - Added enum `PrincipalTypes` + - Added model `UserAssignedIdentity` + - Operation group `HorizonDbClustersOperations` added method `begin_restart` + - Operation group `HorizonDbClustersOperations` added method `begin_start` + - Operation group `HorizonDbClustersOperations` added method `begin_stop` + - Added operation group `HorizonDbAdministratorsOperations` + +### Breaking Changes + + - Deleted or renamed model `OptionalPropertiesUpdateableProperties` + - Deleted or renamed model `PrivateEndpointConnection` + - Deleted or renamed model `PrivateEndpointConnectionUpdate` + - Method `HorizonDbPrivateEndpointConnectionsOperations.begin_delete` inserted a `positional_or_keyword` parameter `cluster_name` + - Renamed method `HorizonDbPrivateEndpointConnectionsOperations.begin_update` to `update_status` + ## 1.0.0b1 (2026-04-22) ### Other Changes - - Initial version \ No newline at end of file + - Initial version diff --git a/sdk/horizondb/azure-mgmt-horizondb/README.md b/sdk/horizondb/azure-mgmt-horizondb/README.md index 9df6863da576..6460b713253c 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/README.md +++ b/sdk/horizondb/azure-mgmt-horizondb/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Horizondb Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/horizondb/azure-mgmt-horizondb/_metadata.json b/sdk/horizondb/azure-mgmt-horizondb/_metadata.json index d09568431b3c..a3dab37ec4cc 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/_metadata.json +++ b/sdk/horizondb/azure-mgmt-horizondb/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2026-01-20-preview", + "apiVersion": "2026-05-01-preview", "apiVersions": { - "Microsoft.HorizonDb": "2026-01-20-preview" + "Microsoft.HorizonDb": "2026-05-01-preview" }, - "commit": "6ac841ec30b3333ba3efcf11edef182a4a0f6393", + "commit": "f868cf045de6223d605ed9b7bf2a9ce2947c808f", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb", - "emitterVersion": "0.61.2" + "emitterVersion": "0.63.5", + "httpClientPythonVersion": "^0.36.0" } \ No newline at end of file diff --git a/sdk/horizondb/azure-mgmt-horizondb/api.md b/sdk/horizondb/azure-mgmt-horizondb/api.md new file mode 100644 index 000000000000..dc547cdd3eaf --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/api.md @@ -0,0 +1,2581 @@ +```py +namespace azure.mgmt.horizondb + + class azure.mgmt.horizondb.HorizonDBMgmtClient: implements ContextManager + horizon_db_administrators: HorizonDbAdministratorsOperations + horizon_db_clusters: HorizonDbClustersOperations + horizon_db_firewall_rules: HorizonDbFirewallRulesOperations + horizon_db_parameter_groups: HorizonDbParameterGroupsOperations + horizon_db_pools: HorizonDbPoolsOperations + horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations + horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations + horizon_db_replicas: HorizonDbReplicasOperations + operations: Operations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.horizondb.aio + + class azure.mgmt.horizondb.aio.HorizonDBMgmtClient: implements AsyncContextManager + horizon_db_administrators: HorizonDbAdministratorsOperations + horizon_db_clusters: HorizonDbClustersOperations + horizon_db_firewall_rules: HorizonDbFirewallRulesOperations + horizon_db_parameter_groups: HorizonDbParameterGroupsOperations + horizon_db_pools: HorizonDbPoolsOperations + horizon_db_private_endpoint_connections: HorizonDbPrivateEndpointConnectionsOperations + horizon_db_private_link_resources: HorizonDbPrivateLinkResourcesOperations + horizon_db_replicas: HorizonDbReplicasOperations + operations: Operations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.horizondb.aio.operations + + class azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbAdministrator]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbAdministrator]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbAdministrator]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id']}, api_versions_list=['2026-05-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id', 'accept']}, api_versions_list=['2026-05-01-preview']) + async def get( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> HorizonDbAdministrator: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbAdministrator]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: HorizonDbCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: HorizonDbCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + async def begin_restart( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + async def begin_start( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + async def begin_stop( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: HorizonDbClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: HorizonDbClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbCluster]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> HorizonDbCluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbCluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[HorizonDbCluster]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbFirewallRulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: HorizonDbFirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: HorizonDbFirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbFirewallRule]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> HorizonDbFirewallRule: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbFirewallRule]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: HorizonDbParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: HorizonDbParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbParameterGroup]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> HorizonDbParameterGroup: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbParameterGroup]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[HorizonDbParameterGroup]: ... + + @distributed_trace + def list_connections( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbParameterGroupConnectionProperties]: ... + + @distributed_trace + def list_versions( + self, + resource_group_name: str, + parameter_group_name: str, + *, + version: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbParameterGroup]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> HorizonDbPool: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbPool]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PrivateEndpointConnectionResource]: ... + + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbPrivateLinkResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + group_name: str, + **kwargs: Any + ) -> HorizonDbPrivateLinkResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbPrivateLinkResource]: ... + + + class azure.mgmt.horizondb.aio.operations.HorizonDbReplicasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: HorizonDbReplica, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: HorizonDbReplica, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[HorizonDbReplica]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + **kwargs: Any + ) -> HorizonDbReplica: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> AsyncItemPaged[HorizonDbReplica]: ... + + + class azure.mgmt.horizondb.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + +namespace azure.mgmt.horizondb.models + + class azure.mgmt.horizondb.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.horizondb.models.AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.CreateModeCluster(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "Create" + POINT_IN_TIME_RESTORE = "PointInTimeRestore" + UPDATE = "Update" + + + class azure.mgmt.horizondb.models.CreateModePool(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATE = "Create" + UPDATE = "Update" + + + class azure.mgmt.horizondb.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.horizondb.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.horizondb.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.horizondb.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbAdministrator(ProxyResource): + id: str + name: str + properties: Optional[HorizonDbAdministratorProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbAdministratorProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbAdministratorAdd(_Model): + properties: HorizonDbAdministratorPropertiesForAdd + + @overload + def __init__( + self, + *, + properties: HorizonDbAdministratorPropertiesForAdd + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbAdministratorProperties(_Model): + object_id: Optional[str] + principal_name: str + principal_type: Union[str, PrincipalTypes] + provisioning_state: Optional[Union[str, ProvisioningState]] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, PrincipalTypes], + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd(_Model): + principal_name: str + principal_type: Union[str, PrincipalTypes] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, PrincipalTypes], + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbCluster(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[HorizonDbClusterProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[HorizonDbClusterProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig(_Model): + entra_id_auth: Optional[Union[str, AuthenticationState]] + password_auth: Optional[Union[str, AuthenticationState]] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + entra_id_auth: Optional[Union[str, AuthenticationState]] = ..., + password_auth: Optional[Union[str, AuthenticationState]] = ..., + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[HorizonDbClusterPropertiesForPatchUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[HorizonDbClusterPropertiesForPatchUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterMirroring(_Model): + database_names: Optional[list[str]] + user_assigned_identity_id: Optional[str] + + @overload + def __init__( + self, + *, + database_names: Optional[list[str]] = ..., + user_assigned_identity_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties(_Model): + apply_immediately: Optional[bool] + id: Optional[str] + sync_status: Optional[str] + + @overload + def __init__( + self, + *, + apply_immediately: Optional[bool] = ..., + id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterProperties(_Model): + administrator_login: str + administrator_login_password: Optional[str] + auth_config: Optional[HorizonDbClusterAuthConfig] + compute_model: Optional[HorizonDbComputeModel] + create_mode: Optional[Union[str, CreateModeCluster]] + fully_qualified_domain_name: Optional[str] + mirroring: Optional[HorizonDbClusterMirroring] + network: Optional[Network] + parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] + point_in_time_utc: Optional[datetime] + pool_name: Optional[str] + processor_type: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + readonly_endpoint: Optional[str] + replica_count: Optional[int] + source_cluster_resource_id: Optional[str] + state: Optional[Union[str, State]] + v_cores: Optional[int] + version: Optional[str] + zone_placement_policy: Optional[Union[str, ZonePlacementPolicy]] + + @overload + def __init__( + self, + *, + administrator_login: str, + administrator_login_password: Optional[str] = ..., + auth_config: Optional[HorizonDbClusterAuthConfig] = ..., + compute_model: Optional[HorizonDbComputeModel] = ..., + create_mode: Optional[Union[str, CreateModeCluster]] = ..., + mirroring: Optional[HorizonDbClusterMirroring] = ..., + network: Optional[Network] = ..., + parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] = ..., + point_in_time_utc: Optional[datetime] = ..., + pool_name: Optional[str] = ..., + processor_type: Optional[str] = ..., + replica_count: Optional[int] = ..., + source_cluster_resource_id: Optional[str] = ..., + v_cores: Optional[int] = ..., + version: Optional[str] = ..., + zone_placement_policy: Optional[Union[str, ZonePlacementPolicy]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate(_Model): + administrator_login_password: Optional[str] + auth_config: Optional[HorizonDbClusterAuthConfig] + compute_model: Optional[HorizonDbComputeModel] + mirroring: Optional[HorizonDbClusterMirroring] + parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] + v_cores: Optional[int] + + @overload + def __init__( + self, + *, + administrator_login_password: Optional[str] = ..., + auth_config: Optional[HorizonDbClusterAuthConfig] = ..., + compute_model: Optional[HorizonDbComputeModel] = ..., + mirroring: Optional[HorizonDbClusterMirroring] = ..., + parameter_group: Optional[HorizonDbClusterParameterGroupConnectionProperties] = ..., + v_cores: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbComputeModel(_Model): + maxv_cores: Optional[float] + minv_cores: Optional[float] + type: Optional[Union[str, HorizonDbComputeModelType]] + v_cores: Optional[int] + + @overload + def __init__( + self, + *, + maxv_cores: Optional[float] = ..., + minv_cores: Optional[float] = ..., + type: Optional[Union[str, HorizonDbComputeModelType]] = ..., + v_cores: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PROVISIONED = "Provisioned" + SERVERLESS = "Serverless" + + + class azure.mgmt.horizondb.models.HorizonDbFirewallRule(ProxyResource): + id: str + name: str + properties: Optional[HorizonDbFirewallRuleProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbFirewallRuleProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbFirewallRuleProperties(_Model): + description: Optional[str] + end_ip_address: str + provisioning_state: Optional[Union[str, ProvisioningState]] + start_ip_address: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + end_ip_address: str, + start_ip_address: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbParameterGroup(TrackedResource): + id: str + location: str + name: str + properties: Optional[HorizonDbParameterGroupProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[HorizonDbParameterGroupProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties(_Model): + id: Optional[str] + name: Optional[str] + type: Optional[str] + + + class azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate(_Model): + properties: Optional[HorizonDbParameterGroupPropertiesForPatchUpdate] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbParameterGroupPropertiesForPatchUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbParameterGroupProperties(_Model): + apply_immediately: Optional[bool] + description: Optional[str] + parameters: Optional[list[ParameterProperties]] + pg_version: Optional[int] + provisioning_state: Optional[Union[str, ProvisioningState]] + version: Optional[int] + + @overload + def __init__( + self, + *, + apply_immediately: Optional[bool] = ..., + description: Optional[str] = ..., + parameters: Optional[list[ParameterProperties]] = ..., + pg_version: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate(_Model): + apply_immediately: Optional[bool] + description: Optional[str] + parameters: Optional[list[ParameterProperties]] + + @overload + def __init__( + self, + *, + apply_immediately: Optional[bool] = ..., + description: Optional[str] = ..., + parameters: Optional[list[ParameterProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbPool(ProxyResource): + id: str + name: str + properties: Optional[HorizonDbPoolProperties] + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbPoolProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbPoolProperties(_Model): + create_mode: Optional[Union[str, CreateModePool]] + location: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + replica_count: Optional[int] + state: Optional[Union[str, State]] + version: Optional[str] + + @overload + def __init__( + self, + *, + location: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource(ProxyResource): + id: str + name: str + properties: Optional[PrivateLinkResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateLinkResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbReplica(ProxyResource): + id: str + name: str + properties: Optional[HorizonDbReplicaProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbReplicaProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate(_Model): + properties: Optional[HorizonDbReplicaPropertiesForPatchUpdate] + + @overload + def __init__( + self, + *, + properties: Optional[HorizonDbReplicaPropertiesForPatchUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbReplicaProperties(_Model): + availability_zone: Optional[str] + fully_qualified_domain_name: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + role: Optional[Union[str, ReplicaRole]] + status: Optional[Union[str, State]] + + @overload + def __init__( + self, + *, + availability_zone: Optional[str] = ..., + role: Optional[Union[str, ReplicaRole]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate(_Model): + role: Optional[Union[str, ReplicaRole]] + + @overload + def __init__( + self, + *, + role: Optional[Union[str, ReplicaRole]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.horizondb.models.Network(_Model): + public_network_access: Optional[Union[str, PublicNetworkAccessState]] + + + class azure.mgmt.horizondb.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.horizondb.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.horizondb.models.ParameterProperties(_Model): + allowed_values: Optional[str] + data_type: Optional[str] + description: Optional[str] + documentation_link: Optional[str] + is_dynamic: Optional[bool] + is_read_only: Optional[bool] + name: Optional[str] + unit: Optional[str] + value: Optional[str] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrincipalTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + GROUP = "Group" + SERVICE_PRINCIPAL = "ServicePrincipal" + UNKNOWN = "Unknown" + USER = "User" + + + class azure.mgmt.horizondb.models.PrivateEndpoint(_Model): + id: Optional[str] + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties(_Model): + group_ids: Optional[list[str]] + private_endpoint: Optional[PrivateEndpoint] + private_link_service_connection_state: PrivateLinkServiceConnectionState + provisioning_state: Optional[Union[str, PrivateEndpointConnectionProvisioningState]] + + @overload + def __init__( + self, + *, + private_endpoint: Optional[PrivateEndpoint] = ..., + private_link_service_connection_state: PrivateLinkServiceConnectionState + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.horizondb.models.PrivateEndpointConnectionResource(Resource): + id: str + name: str + properties: Optional[PrivateEndpointConnectionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PrivateEndpointConnectionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + PENDING = "Pending" + REJECTED = "Rejected" + + + class azure.mgmt.horizondb.models.PrivateLinkResourceProperties(_Model): + group_id: Optional[str] + required_members: Optional[list[str]] + required_zone_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + required_zone_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState(_Model): + actions_required: Optional[str] + description: Optional[str] + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] + + @overload + def __init__( + self, + *, + actions_required: Optional[str] = ..., + description: Optional[str] = ..., + status: Optional[Union[str, PrivateEndpointServiceConnectionStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + PROVISIONING = "Provisioning" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.horizondb.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.horizondb.models.PublicNetworkAccessState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.horizondb.models.ReplicaRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + READ = "Read" + READ_WRITE = "ReadWrite" + + + class azure.mgmt.horizondb.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.horizondb.models.State(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + DROPPING = "Dropping" + HEALTHY = "Healthy" + READY = "Ready" + STARTING = "Starting" + STOPPED = "Stopped" + STOPPING = "Stopping" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + UPGRADING = "Upgrading" + + + class azure.mgmt.horizondb.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.horizondb.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.horizondb.models.ZonePlacementPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BEST_EFFORT = "BestEffort" + STRICT = "Strict" + + +namespace azure.mgmt.horizondb.operations + + class azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbAdministrator]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbAdministrator]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbAdministrator]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id']}, api_versions_list=['2026-05-01-preview']) + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'object_id', 'accept']}, api_versions_list=['2026-05-01-preview']) + def get( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + **kwargs: Any + ) -> HorizonDbAdministrator: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbAdministrator]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbClustersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: HorizonDbCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: HorizonDbCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + def begin_restart( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + def begin_start( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01-preview', params_added_on={'2026-05-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'cluster_name', 'accept']}, api_versions_list=['2026-05-01-preview']) + def begin_stop( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: HorizonDbClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: HorizonDbClusterForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbCluster]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> HorizonDbCluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbCluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[HorizonDbCluster]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbFirewallRulesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: HorizonDbFirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbFirewallRule]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: HorizonDbFirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbFirewallRule]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbFirewallRule]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + **kwargs: Any + ) -> HorizonDbFirewallRule: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbFirewallRule]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: HorizonDbParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: HorizonDbParameterGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbParameterGroup]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> HorizonDbParameterGroup: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbParameterGroup]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[HorizonDbParameterGroup]: ... + + @distributed_trace + def list_connections( + self, + resource_group_name: str, + parameter_group_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbParameterGroupConnectionProperties]: ... + + @distributed_trace + def list_versions( + self, + resource_group_name: str, + parameter_group_name: str, + *, + version: Optional[int] = ..., + **kwargs: Any + ) -> ItemPaged[HorizonDbParameterGroup]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbPoolsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> HorizonDbPool: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbPool]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[PrivateEndpointConnectionResource]: ... + + @overload + def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @overload + def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + @overload + def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PrivateEndpointConnectionResource: ... + + + class azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + group_name: str, + **kwargs: Any + ) -> HorizonDbPrivateLinkResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbPrivateLinkResource]: ... + + + class azure.mgmt.horizondb.operations.HorizonDbReplicasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: HorizonDbReplica, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: HorizonDbReplica, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[HorizonDbReplica]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + **kwargs: Any + ) -> HorizonDbReplica: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + **kwargs: Any + ) -> ItemPaged[HorizonDbReplica]: ... + + + class azure.mgmt.horizondb.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + +namespace azure.mgmt.horizondb.types + + class azure.mgmt.horizondb.types.HorizonDbAdministratorAdd(TypedDict, total=False): + key "properties": Required[HorizonDbAdministratorPropertiesForAdd] + properties: HorizonDbAdministratorPropertiesForAdd + + + class azure.mgmt.horizondb.types.HorizonDbAdministratorPropertiesForAdd(TypedDict, total=False): + key "principalName": Required[str] + key "principalType": Required[Union[str, PrincipalTypes]] + key "tenantId": str + principalName: str + principalType: Union[str, PrincipalTypes] + tenantId: str + + + class azure.mgmt.horizondb.types.HorizonDbCluster(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('HorizonDbClusterProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: HorizonDbClusterProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.horizondb.types.HorizonDbClusterAuthConfig(TypedDict, total=False): + key "entraIdAuth": Union[str, AuthenticationState] + key "passwordAuth": Union[str, AuthenticationState] + key "tenantId": str + entraIdAuth: Union[str, AuthenticationState] + passwordAuth: Union[str, AuthenticationState] + tenantId: str + + + class azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('HorizonDbClusterPropertiesForPatchUpdate', module='types') + identity: ManagedServiceIdentity + properties: HorizonDbClusterPropertiesForPatchUpdate + tags: dict[str, str] + + + class azure.mgmt.horizondb.types.HorizonDbClusterMirroring(TypedDict, total=False): + key "userAssignedIdentityId": str + databaseNames: list[str] + userAssignedIdentityId: str + + + class azure.mgmt.horizondb.types.HorizonDbClusterParameterGroupConnectionProperties(TypedDict, total=False): + key "applyImmediately": bool + key "id": str + key "syncStatus": str + applyImmediately: bool + id: str + syncStatus: str + + + class azure.mgmt.horizondb.types.HorizonDbClusterProperties(TypedDict, total=False): + key "administratorLogin": Required[str] + key "administratorLoginPassword": str + key "authConfig": ForwardRef('HorizonDbClusterAuthConfig', module='types') + key "computeModel": ForwardRef('HorizonDbComputeModel', module='types') + key "createMode": Union[str, CreateModeCluster] + key "fullyQualifiedDomainName": str + key "mirroring": ForwardRef('HorizonDbClusterMirroring', module='types') + key "network": ForwardRef('Network', module='types') + key "parameterGroup": ForwardRef('HorizonDbClusterParameterGroupConnectionProperties', module='types') + key "pointInTimeUTC": str + key "poolName": str + key "processorType": str + key "provisioningState": Union[str, ProvisioningState] + key "readonlyEndpoint": str + key "replicaCount": int + key "sourceClusterResourceId": str + key "state": Union[str, State] + key "vCores": int + key "version": str + key "zonePlacementPolicy": Union[str, ZonePlacementPolicy] + administratorLogin: str + administratorLoginPassword: str + authConfig: HorizonDbClusterAuthConfig + computeModel: HorizonDbComputeModel + createMode: Union[str, CreateModeCluster] + fullyQualifiedDomainName: str + mirroring: HorizonDbClusterMirroring + network: Network + parameterGroup: HorizonDbClusterParameterGroupConnectionProperties + pointInTimeUTC: str + poolName: str + processorType: str + provisioningState: Union[str, ProvisioningState] + readonlyEndpoint: str + replicaCount: int + sourceClusterResourceId: str + state: Union[str, State] + vCores: int + version: str + zonePlacementPolicy: Union[str, ZonePlacementPolicy] + + + class azure.mgmt.horizondb.types.HorizonDbClusterPropertiesForPatchUpdate(TypedDict, total=False): + key "administratorLoginPassword": str + key "authConfig": ForwardRef('HorizonDbClusterAuthConfig', module='types') + key "computeModel": ForwardRef('HorizonDbComputeModel', module='types') + key "mirroring": ForwardRef('HorizonDbClusterMirroring', module='types') + key "parameterGroup": ForwardRef('HorizonDbClusterParameterGroupConnectionProperties', module='types') + key "vCores": int + administratorLoginPassword: str + authConfig: HorizonDbClusterAuthConfig + computeModel: HorizonDbComputeModel + mirroring: HorizonDbClusterMirroring + parameterGroup: HorizonDbClusterParameterGroupConnectionProperties + vCores: int + + + class azure.mgmt.horizondb.types.HorizonDbComputeModel(TypedDict, total=False): + key "maxvCores": float + key "minvCores": float + key "type": Union[str, HorizonDbComputeModelType] + key "vCores": int + maxvCores: float + minvCores: float + type: Union[str, HorizonDbComputeModelType] + vCores: int + + + class azure.mgmt.horizondb.types.HorizonDbFirewallRule(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('HorizonDbFirewallRuleProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: HorizonDbFirewallRuleProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.HorizonDbFirewallRuleProperties(TypedDict, total=False): + key "description": str + key "endIpAddress": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "startIpAddress": Required[str] + description: str + endIpAddress: str + provisioningState: Union[str, ProvisioningState] + startIpAddress: str + + + class azure.mgmt.horizondb.types.HorizonDbParameterGroup(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('HorizonDbParameterGroupProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: HorizonDbParameterGroupProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('HorizonDbParameterGroupPropertiesForPatchUpdate', module='types') + properties: HorizonDbParameterGroupPropertiesForPatchUpdate + tags: dict[str, str] + + + class azure.mgmt.horizondb.types.HorizonDbParameterGroupProperties(TypedDict, total=False): + key "applyImmediately": bool + key "description": str + key "pgVersion": int + key "provisioningState": Union[str, ProvisioningState] + key "version": int + applyImmediately: bool + description: str + parameters: list[ParameterProperties] + pgVersion: int + provisioningState: Union[str, ProvisioningState] + version: int + + + class azure.mgmt.horizondb.types.HorizonDbParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): + key "applyImmediately": bool + key "description": str + applyImmediately: bool + description: str + parameters: list[ParameterProperties] + + + class azure.mgmt.horizondb.types.HorizonDbReplica(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('HorizonDbReplicaProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: HorizonDbReplicaProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate(TypedDict, total=False): + key "properties": ForwardRef('HorizonDbReplicaPropertiesForPatchUpdate', module='types') + properties: HorizonDbReplicaPropertiesForPatchUpdate + + + class azure.mgmt.horizondb.types.HorizonDbReplicaProperties(TypedDict, total=False): + key "availabilityZone": str + key "fullyQualifiedDomainName": str + key "provisioningState": Union[str, ProvisioningState] + key "role": Union[str, ReplicaRole] + key "status": Union[str, State] + availabilityZone: str + fullyQualifiedDomainName: str + provisioningState: Union[str, ProvisioningState] + role: Union[str, ReplicaRole] + status: Union[str, State] + + + class azure.mgmt.horizondb.types.HorizonDbReplicaPropertiesForPatchUpdate(TypedDict, total=False): + key "role": Union[str, ReplicaRole] + role: Union[str, ReplicaRole] + + + class azure.mgmt.horizondb.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.horizondb.types.Network(TypedDict, total=False): + key "publicNetworkAccess": Union[str, PublicNetworkAccessState] + publicNetworkAccess: Union[str, PublicNetworkAccessState] + + + class azure.mgmt.horizondb.types.ParameterProperties(TypedDict, total=False): + key "allowedValues": str + key "dataType": str + key "description": str + key "documentationLink": str + key "isDynamic": bool + key "isReadOnly": bool + key "name": str + key "unit": str + key "value": str + allowedValues: str + dataType: str + description: str + documentationLink: str + isDynamic: bool + isReadOnly: bool + name: str + unit: str + value: str + + + class azure.mgmt.horizondb.types.PrivateEndpoint(TypedDict, total=False): + key "id": str + id: str + + + class azure.mgmt.horizondb.types.PrivateEndpointConnectionProperties(TypedDict, total=False): + key "privateEndpoint": ForwardRef('PrivateEndpoint', module='types') + key "privateLinkServiceConnectionState": Required[PrivateLinkServiceConnectionState] + key "provisioningState": Union[str, PrivateEndpointConnectionProvisioningState] + groupIds: list[str] + privateEndpoint: PrivateEndpoint + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState + provisioningState: Union[str, PrivateEndpointConnectionProvisioningState] + + + class azure.mgmt.horizondb.types.PrivateEndpointConnectionResource(Resource): + key "id": str + key "name": str + key "properties": ForwardRef('PrivateEndpointConnectionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PrivateEndpointConnectionProperties + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.PrivateLinkServiceConnectionState(TypedDict, total=False): + key "actionsRequired": str + key "description": str + key "status": Union[str, PrivateEndpointServiceConnectionStatus] + actionsRequired: str + description: str + status: Union[str, PrivateEndpointServiceConnectionStatus] + + + class azure.mgmt.horizondb.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.horizondb.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.horizondb.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.horizondb.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + +``` \ No newline at end of file diff --git a/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml b/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml new file mode 100644 index 000000000000..62aae3242a4c --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 43d4079cdf72351e9fcb305f2a9aaad1e9576983d33574e229076ab0eafbd541 +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json b/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json index 79e9327942ec..32bc7f8f97ab 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json +++ b/sdk/horizondb/azure-mgmt-horizondb/apiview-properties.json @@ -5,13 +5,20 @@ "azure.mgmt.horizondb.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.horizondb.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", "azure.mgmt.horizondb.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.horizondb.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.horizondb.models.HorizonDbAdministrator": "Microsoft.HorizonDb.HorizonDbAdministrator", + "azure.mgmt.horizondb.models.HorizonDbAdministratorAdd": "Microsoft.HorizonDb.HorizonDbAdministratorAdd", + "azure.mgmt.horizondb.models.HorizonDbAdministratorProperties": "Microsoft.HorizonDb.HorizonDbAdministratorProperties", + "azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd": "Microsoft.HorizonDb.HorizonDbAdministratorPropertiesForAdd", "azure.mgmt.horizondb.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.horizondb.models.HorizonDbCluster": "Microsoft.HorizonDb.HorizonDbCluster", + "azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig": "Microsoft.HorizonDb.HorizonDbClusterAuthConfig", "azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate": "Microsoft.HorizonDb.HorizonDbClusterForPatchUpdate", + "azure.mgmt.horizondb.models.HorizonDbClusterMirroring": "Microsoft.HorizonDb.HorizonDbClusterMirroring", "azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties": "Microsoft.HorizonDb.HorizonDbClusterParameterGroupConnectionProperties", "azure.mgmt.horizondb.models.HorizonDbClusterProperties": "Microsoft.HorizonDb.HorizonDbClusterProperties", "azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate": "Microsoft.HorizonDb.HorizonDbClusterPropertiesForPatchUpdate", - "azure.mgmt.horizondb.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.horizondb.models.HorizonDbComputeModel": "Microsoft.HorizonDb.HorizonDbComputeModel", "azure.mgmt.horizondb.models.HorizonDbFirewallRule": "Microsoft.HorizonDb.HorizonDbFirewallRule", "azure.mgmt.horizondb.models.HorizonDbFirewallRuleProperties": "Microsoft.HorizonDb.HorizonDbFirewallRuleProperties", "azure.mgmt.horizondb.models.HorizonDbParameterGroup": "Microsoft.HorizonDb.HorizonDbParameterGroup", @@ -26,19 +33,18 @@ "azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate": "Microsoft.HorizonDb.HorizonDbReplicaForPatchUpdate", "azure.mgmt.horizondb.models.HorizonDbReplicaProperties": "Microsoft.HorizonDb.HorizonDbReplicaProperties", "azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate": "Microsoft.HorizonDb.HorizonDbReplicaPropertiesForPatchUpdate", + "azure.mgmt.horizondb.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", "azure.mgmt.horizondb.models.Network": "Microsoft.HorizonDb.Network", "azure.mgmt.horizondb.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.horizondb.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", - "azure.mgmt.horizondb.models.OptionalPropertiesUpdateableProperties": "TypeSpec.OptionalProperties", "azure.mgmt.horizondb.models.ParameterProperties": "Microsoft.HorizonDb.ParameterProperties", "azure.mgmt.horizondb.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", - "azure.mgmt.horizondb.models.PrivateEndpointConnection": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnection", "azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", "azure.mgmt.horizondb.models.PrivateEndpointConnectionResource": "Azure.ResourceManager.PrivateEndpointConnectionResource", - "azure.mgmt.horizondb.models.PrivateEndpointConnectionUpdate": "Azure.ResourceManager.PrivateEndpointConnectionUpdate", "azure.mgmt.horizondb.models.PrivateLinkResourceProperties": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", "azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", "azure.mgmt.horizondb.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.horizondb.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.horizondb.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", "azure.mgmt.horizondb.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", "azure.mgmt.horizondb.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", @@ -47,10 +53,14 @@ "azure.mgmt.horizondb.models.State": "Microsoft.HorizonDb.State", "azure.mgmt.horizondb.models.ProvisioningState": "Microsoft.HorizonDb.ProvisioningState", "azure.mgmt.horizondb.models.ZonePlacementPolicy": "Microsoft.HorizonDb.ZonePlacementPolicy", + "azure.mgmt.horizondb.models.AuthenticationState": "Microsoft.HorizonDb.AuthenticationState", + "azure.mgmt.horizondb.models.HorizonDbComputeModelType": "Microsoft.HorizonDb.HorizonDbComputeModelType", + "azure.mgmt.horizondb.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.horizondb.models.CreateModePool": "Microsoft.HorizonDb.CreateModePool", "azure.mgmt.horizondb.models.ReplicaRole": "Microsoft.HorizonDb.ReplicaRole", "azure.mgmt.horizondb.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", "azure.mgmt.horizondb.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.horizondb.models.PrincipalTypes": "Microsoft.HorizonDb.PrincipalTypes", "azure.mgmt.horizondb.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.horizondb.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.get": "Microsoft.HorizonDb.HorizonDbClusters.get", @@ -65,6 +75,12 @@ "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.list_by_resource_group": "Microsoft.HorizonDb.HorizonDbClusters.listByResourceGroup", "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbClusters.listBySubscription", "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.list_by_subscription": "Microsoft.HorizonDb.HorizonDbClusters.listBySubscription", + "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_start": "Microsoft.HorizonDb.HorizonDbClusters.start", + "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_start": "Microsoft.HorizonDb.HorizonDbClusters.start", + "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_stop": "Microsoft.HorizonDb.HorizonDbClusters.stop", + "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_stop": "Microsoft.HorizonDb.HorizonDbClusters.stop", + "azure.mgmt.horizondb.operations.HorizonDbClustersOperations.begin_restart": "Microsoft.HorizonDb.HorizonDbClusters.restart", + "azure.mgmt.horizondb.aio.operations.HorizonDbClustersOperations.begin_restart": "Microsoft.HorizonDb.HorizonDbClusters.restart", "azure.mgmt.horizondb.operations.HorizonDbPoolsOperations.get": "Microsoft.HorizonDb.HorizonDbPools.get", "azure.mgmt.horizondb.aio.operations.HorizonDbPoolsOperations.get": "Microsoft.HorizonDb.HorizonDbPools.get", "azure.mgmt.horizondb.operations.HorizonDbPoolsOperations.list": "Microsoft.HorizonDb.HorizonDbPools.list", @@ -91,8 +107,8 @@ "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.get", "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list", "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.list": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.list", - "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_update": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update", - "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_update": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.update", + "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.update_status": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.updateStatus", + "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.update_status": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.updateStatus", "azure.mgmt.horizondb.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete", "azure.mgmt.horizondb.aio.operations.HorizonDbPrivateEndpointConnectionsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbPrivateEndpointConnections.delete", "azure.mgmt.horizondb.operations.HorizonDbPrivateLinkResourcesOperations.get": "Microsoft.HorizonDb.HorizonDbPrivateLinkResources.get", @@ -114,6 +130,15 @@ "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections", "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_connections": "Microsoft.HorizonDb.HorizonDbParameterGroups.listConnections", "azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations.list_versions": "Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions", - "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_versions": "Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions" - } + "azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations.list_versions": "Microsoft.HorizonDb.HorizonDbParameterGroups.listVersions", + "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.get": "Microsoft.HorizonDb.HorizonDbAdministrators.get", + "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.get": "Microsoft.HorizonDb.HorizonDbAdministrators.get", + "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbAdministrators.createOrUpdate", + "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.begin_create_or_update": "Microsoft.HorizonDb.HorizonDbAdministrators.createOrUpdate", + "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbAdministrators.delete", + "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.begin_delete": "Microsoft.HorizonDb.HorizonDbAdministrators.delete", + "azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations.list": "Microsoft.HorizonDb.HorizonDbAdministrators.list", + "azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations.list": "Microsoft.HorizonDb.HorizonDbAdministrators.list" + }, + "CrossLanguageVersion": "e073010193f3" } \ No newline at end of file diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py index 42cf650d4784..55ec35cdbcad 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -20,6 +20,7 @@ from ._configuration import HorizonDBMgmtClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( + HorizonDbAdministratorsOperations, HorizonDbClustersOperations, HorizonDbFirewallRulesOperations, HorizonDbParameterGroupsOperations, @@ -30,13 +31,18 @@ Operations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes - """Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall +class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Azure Resource Provider API for managing HorizonDB clusters, pools, replicas, and firewall rules. :ivar operations: Operations operations @@ -60,6 +66,9 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes :ivar horizon_db_parameter_groups: HorizonDbParameterGroupsOperations operations :vartype horizon_db_parameter_groups: azure.mgmt.horizondb.operations.HorizonDbParameterGroupsOperations + :ivar horizon_db_administrators: HorizonDbAdministratorsOperations operations + :vartype horizon_db_administrators: + azure.mgmt.horizondb.operations.HorizonDbAdministratorsOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -70,8 +79,9 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-20-preview". Default value is "2026-01-20-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -144,6 +154,9 @@ def __init__( self.horizon_db_parameter_groups = HorizonDbParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.horizon_db_administrators = HorizonDbAdministratorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py index 9c19e61a6ab2..ab90765ee02d 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for HorizonDBMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -34,8 +35,9 @@ class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-att None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-20-preview". Default value is "2026-01-20-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-01-20-preview") + api_version: str = kwargs.pop("api_version", "2026-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_patch.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_patch.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/model_base.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/model_base.py index 7b7f8ba67b53..35d5fc024978 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/model_base.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -130,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -296,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -308,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -325,12 +373,18 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -420,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,62 +883,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -667,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -693,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -721,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -1067,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1079,6 +1428,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1098,7 +1448,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1111,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1157,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1166,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1190,6 +1549,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1201,10 +1610,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1226,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1238,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1252,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1259,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1268,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1286,8 +1702,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1308,11 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1323,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/serialization.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/serialization.py index 81ec1de5922b..ae08f9d89f74 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/serialization.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -476,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -516,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py index be71c81bd282..bbcd28b4aa67 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0b2" diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py index 7bb6d9087a12..ca8c8ff0cc19 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -20,6 +20,7 @@ from .._utils.serialization import Deserializer, Serializer from ._configuration import HorizonDBMgmtClientConfiguration from .operations import ( + HorizonDbAdministratorsOperations, HorizonDbClustersOperations, HorizonDbFirewallRulesOperations, HorizonDbParameterGroupsOperations, @@ -30,13 +31,18 @@ Operations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes - """Azure Resource Provider API for managing HorizonDb clusters, pools, replicas, and firewall +class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only + """Azure Resource Provider API for managing HorizonDB clusters, pools, replicas, and firewall rules. :ivar operations: Operations operations @@ -60,6 +66,9 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes :ivar horizon_db_parameter_groups: HorizonDbParameterGroupsOperations operations :vartype horizon_db_parameter_groups: azure.mgmt.horizondb.aio.operations.HorizonDbParameterGroupsOperations + :ivar horizon_db_administrators: HorizonDbAdministratorsOperations operations + :vartype horizon_db_administrators: + azure.mgmt.horizondb.aio.operations.HorizonDbAdministratorsOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -70,8 +79,9 @@ class HorizonDBMgmtClient: # pylint: disable=too-many-instance-attributes None. :paramtype cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-20-preview". Default value is "2026-01-20-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -146,6 +156,9 @@ def __init__( self.horizon_db_parameter_groups = HorizonDbParameterGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.horizon_db_administrators = HorizonDbAdministratorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py index ed0f6667b9ba..88cfd10ee386 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for HorizonDBMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -34,8 +35,9 @@ class HorizonDBMgmtClientConfiguration: # pylint: disable=too-many-instance-att None. :type cloud_setting: ~azure.core.AzureClouds :keyword api_version: The API version to use for this operation. Known values are - "2026-01-20-preview". Default value is "2026-01-20-preview". Note that overriding this default - value may result in unsupported behavior. + "2026-05-01-preview" and None. Default value is None. If not set, the operation's default API + version will be used. Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ @@ -47,7 +49,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-01-20-preview") + api_version: str = kwargs.pop("api_version", "2026-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_patch.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_patch.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py index daeac9c6dc50..660c577f1dc7 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/__init__.py @@ -20,6 +20,7 @@ from ._operations import HorizonDbPrivateEndpointConnectionsOperations # type: ignore from ._operations import HorizonDbPrivateLinkResourcesOperations # type: ignore from ._operations import HorizonDbParameterGroupsOperations # type: ignore +from ._operations import HorizonDbAdministratorsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -34,6 +35,7 @@ "HorizonDbPrivateEndpointConnectionsOperations", "HorizonDbPrivateLinkResourcesOperations", "HorizonDbParameterGroupsOperations", + "HorizonDbAdministratorsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py index 271b7c35b56e..9f47333270fb 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_operations.py @@ -33,15 +33,23 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( + build_horizon_db_administrators_create_or_update_request, + build_horizon_db_administrators_delete_request, + build_horizon_db_administrators_get_request, + build_horizon_db_administrators_list_request, build_horizon_db_clusters_create_or_update_request, build_horizon_db_clusters_delete_request, build_horizon_db_clusters_get_request, build_horizon_db_clusters_list_by_resource_group_request, build_horizon_db_clusters_list_by_subscription_request, + build_horizon_db_clusters_restart_request, + build_horizon_db_clusters_start_request, + build_horizon_db_clusters_stop_request, build_horizon_db_clusters_update_request, build_horizon_db_firewall_rules_create_or_update_request, build_horizon_db_firewall_rules_delete_request, @@ -60,7 +68,7 @@ build_horizon_db_private_endpoint_connections_delete_request, build_horizon_db_private_endpoint_connections_get_request, build_horizon_db_private_endpoint_connections_list_request, - build_horizon_db_private_endpoint_connections_update_request, + build_horizon_db_private_endpoint_connections_update_status_request, build_horizon_db_private_link_resources_get_request, build_horizon_db_private_link_resources_list_request, build_horizon_db_replicas_create_or_update_request, @@ -74,11 +82,10 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -142,7 +149,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -185,7 +195,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class HorizonDbClustersOperations: +class HorizonDbClustersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -204,12 +214,12 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.HorizonDbCluster: - """Gets information about a HorizonDb cluster. + """Gets information about a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.mgmt.horizondb.models.HorizonDbCluster @@ -276,7 +286,7 @@ async def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, JSON, IO[bytes]], + resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -359,12 +369,12 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster @@ -382,20 +392,20 @@ async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - resource: JSON, + resource: _types.HorizonDbCluster, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbCluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -415,12 +425,12 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] @@ -438,19 +448,20 @@ async def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, JSON, IO[bytes]], + resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: HorizonDbCluster, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a HorizonDbCluster type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or + ~azure.mgmt.horizondb.types.HorizonDbCluster or IO[bytes] :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -512,7 +523,7 @@ async def _update_initial( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -593,12 +604,12 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate @@ -616,20 +627,20 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: JSON, + properties: _types.HorizonDbClusterForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -649,12 +660,12 @@ async def begin_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] @@ -672,20 +683,20 @@ async def begin_update( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbClusterForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + HorizonDbClusterForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -807,12 +818,12 @@ async def _delete_initial(self, resource_group_name: str, cluster_name: str, **k @distributed_trace_async async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a HorizonDb cluster. + """Deletes a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] @@ -866,7 +877,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def list_by_resource_group( self, resource_group_name: str, **kwargs: Any ) -> AsyncItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDb clusters in a resource group. + """Lists all HorizonDB clusters in a resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -916,7 +927,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -960,7 +974,7 @@ async def get_next(next_link=None): @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDb clusters in a subscription. + """Lists all HorizonDB clusters in a subscription. :return: An iterator like instance of HorizonDbCluster :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -1006,7 +1020,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1048,41 +1065,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - -class HorizonDbPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> _models.HorizonDbPool: - """Gets information about a HorizonDb pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool - :raises ~azure.core.exceptions.HttpResponseError: - """ + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _start_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1094,12 +1084,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_pools_get_request( + _request = build_horizon_db_clusters_start_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1111,19 +1100,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True 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: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1131,152 +1119,93 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbPool, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbPool"]: - """Lists all HorizonDb pools in a cluster. + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Starts a stopped HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPool - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_pools_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbPool], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - async def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class HorizonDbReplicasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_replicas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> _models.HorizonDbReplica: - """Gets information about a HorizonDb replica. + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica - :raises ~azure.core.exceptions.HttpResponseError: - """ + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1288,13 +1217,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_get_request( + _request = build_horizon_db_clusters_stop_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -1306,19 +1233,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True 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: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1326,126 +1252,94 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbReplica"]: - """Lists all HorizonDb replicas in a pool. + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stops a running HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :return: An iterator like instance of HorizonDbReplica - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_replicas_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbReplica], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - async def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, JSON, IO[bytes]], - **kwargs: Any + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _restart_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1455,28 +1349,16 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_replicas_create_or_update_request( + _request = build_horizon_db_clusters_restart_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -1493,7 +1375,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1506,10 +1388,11 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -1519,153 +1402,37 @@ async def _create_or_update_initial( return deserialized # type: ignore - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: _models.HorizonDbReplica, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: 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: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_restart(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Restarts a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Is one of the following types: HorizonDbReplica, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._restart_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - resource=resource, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1674,12 +1441,9 @@ async def begin_create_or_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -1694,25 +1458,49 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbReplica]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: + +class HorizonDbPoolsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`horizon_db_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> _models.HorizonDbPool: + """Gets information about a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1721,28 +1509,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_update_request( + _request = build_horizon_db_pools_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -1752,18 +1529,19 @@ async def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -1771,207 +1549,36 @@ async def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbPool, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: _models.HorizonDbReplicaForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Required. - :type properties: 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: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbPool"]: + """Lists all HorizonDB pools in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbReplicaForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An iterator like instance of HorizonDbPool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.HorizonDbReplica]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1980,135 +1587,89 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_horizon_db_replicas_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + def prepare_request(next_link=None): + if not next_link: - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + _request = build_horizon_db_pools_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + return _request - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbPool], + deserialized.get("value", []), ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a HorizonDb replica. + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + async def get_next(next_link=None): + _request = prepare_request(next_link) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + response = pipeline_response.http_response - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + return pipeline_response - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncItemPaged(get_next, extract_data) -class HorizonDbFirewallRulesOperations: +class HorizonDbReplicasOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_firewall_rules` attribute. + :attr:`horizon_db_replicas` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -2120,21 +1681,21 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.HorizonDbFirewallRule: - """Gets information about a HorizonDb firewall rule. + self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any + ) -> _models.HorizonDbReplica: + """Gets information about a HorizonDB replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str - :return: HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2148,13 +1709,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_get_request( + _request = build_horizon_db_replicas_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2189,7 +1750,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + deserialized = _deserialize(_models.HorizonDbReplica, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2199,25 +1760,24 @@ async def get( @distributed_trace def list( self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbFirewallRule"]: - """Lists all HorizonDb firewall rules in a pool. + ) -> AsyncItemPaged["_models.HorizonDbReplica"]: + """Lists all HorizonDB replicas in a pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :return: An iterator like instance of HorizonDbFirewallRule - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An iterator like instance of HorizonDbReplica + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbFirewallRule]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2230,7 +1790,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_firewall_rules_list_request( + _request = build_horizon_db_replicas_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, @@ -2257,7 +1817,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2271,7 +1834,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbFirewallRule], + List[_models.HorizonDbReplica], deserialized.get("value", []), ) if cls: @@ -2304,8 +1867,8 @@ async def _create_or_update_initial( resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, JSON, IO[bytes]], + replica_name: str, + resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2329,11 +1892,11 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_firewall_rules_create_or_update_request( + _request = build_horizon_db_replicas_create_or_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + replica_name=replica_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2386,31 +1949,31 @@ async def begin_create_or_update( resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: _models.HorizonDbFirewallRule, + replica_name: str, + resource: _models.HorizonDbReplica, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2420,31 +1983,31 @@ async def begin_create_or_update( resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: JSON, + replica_name: str, + resource: _types.HorizonDbReplica, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbReplica :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2454,31 +2017,31 @@ async def begin_create_or_update( resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, + replica_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str :param resource: Resource create parameters. Required. :type resource: 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: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2488,34 +2051,35 @@ async def begin_create_or_update( resource_group_name: str, cluster_name: str, pool_name: str, - firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, JSON, IO[bytes]], + replica_name: str, + resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str - :param resource: Resource create parameters. Is one of the following types: - HorizonDbFirewallRule, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The - HorizonDbFirewallRule is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param resource: Resource create parameters. Is either a HorizonDbReplica type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or + ~azure.mgmt.horizondb.types.HorizonDbReplica or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ _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[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -2524,7 +2088,7 @@ async def begin_create_or_update( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + replica_name=replica_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -2537,7 +2101,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + deserialized = _deserialize(_models.HorizonDbReplica, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2555,18 +2119,24 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbFirewallRule].from_continuation_token( + return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbFirewallRule]( + return AsyncLROPoller[_models.HorizonDbReplica]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2576,18 +2146,28 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_firewall_rules_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_replicas_update_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + replica_name=replica_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -2604,7 +2184,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -2618,9 +2198,6 @@ async def _delete_initial( response_headers = {} if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) @@ -2631,38 +2208,154 @@ async def _delete_initial( return deserialized # type: ignore + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: _models.HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Updates an existing HorizonDB replica (e.g., role). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: _types.HorizonDbReplicaForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Updates an existing HorizonDB replica (e.g., role). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Updates an existing HorizonDB replica (e.g., role). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a HorizonDb firewall rule. + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbReplica]: + """Updates an existing HorizonDB replica (e.g., role). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. - :type firewall_rule_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param properties: The resource properties to be updated. Is either a + HorizonDbReplicaForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbReplica. The HorizonDbReplica is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, - firewall_rule_name=firewall_rule_name, + replica_name=replica_name, + properties=properties, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2671,9 +2364,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.HorizonDbReplica, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -2688,51 +2384,19 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.HorizonDbReplica].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_endpoint_connections` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnectionResource: - """Gets a private endpoint connection. + return AsyncLROPoller[_models.HorizonDbReplica]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible - with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2744,12 +2408,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_get_request( + _request = build_horizon_db_replicas_delete_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - private_endpoint_connection_name=private_endpoint_connection_name, + pool_name=pool_name, + replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2761,19 +2426,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True 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: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -2781,36 +2445,204 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateEndpointConnectionResource"]: - """Lists private endpoint connections in a HorizonDb cluster. + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HorizonDB replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of PrivateEndpointConnectionResource - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + replica_name=replica_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class HorizonDbFirewallRulesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`horizon_db_firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.HorizonDbFirewallRule: + """Gets information about a HorizonDB firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str + :return: HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) + + _request = build_horizon_db_firewall_rules_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbFirewallRule"]: + """Lists all HorizonDB firewall rules in a pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: An iterator like instance of HorizonDbFirewallRule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbFirewallRule]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2823,9 +2655,10 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_endpoint_connections_list_request( + _request = build_horizon_db_firewall_rules_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, + pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2849,7 +2682,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2863,7 +2699,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.PrivateEndpointConnectionResource], + List[_models.HorizonDbFirewallRule], deserialized.get("value", []), ) if cls: @@ -2891,11 +2727,13 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - async def _update_initial( + async def _create_or_update_initial( self, resource_group_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2914,14 +2752,16 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_horizon_db_private_endpoint_connections_update_request( + _request = build_horizon_db_firewall_rules_create_or_update_request( resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -2942,7 +2782,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -2955,8 +2795,10 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -2967,134 +2809,152 @@ async def _update_initial( return deserialized # type: ignore @overload - async def begin_update( + async def begin_create_or_update( self, resource_group_name: str, - private_endpoint_connection_name: str, - properties: _models.PrivateEndpointConnectionUpdate, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: _models.HorizonDbFirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionUpdate + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The + HorizonDbFirewallRule is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_update( self, resource_group_name: str, - private_endpoint_connection_name: str, - properties: JSON, + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: _types.HorizonDbFirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.HorizonDbFirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The + HorizonDbFirewallRule is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_update( self, resource_group_name: str, - private_endpoint_connection_name: str, - properties: IO[bytes], + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The + HorizonDbFirewallRule is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_update( + async def begin_create_or_update( self, resource_group_name: str, - private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + cluster_name: str, + pool_name: str, + firewall_rule_name: str, + resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> AsyncLROPoller[_models.HorizonDbFirewallRule]: + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str + :param resource: Resource create parameters. Is either a HorizonDbFirewallRule type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or + ~azure.mgmt.horizondb.types.HorizonDbFirewallRule or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbFirewallRule. The + HorizonDbFirewallRule is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ _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[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + cls: ClsType[_models.HorizonDbFirewallRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, - properties=properties, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -3106,7 +2966,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + deserialized = _deserialize(_models.HorizonDbFirewallRule, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3124,18 +2984,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PrivateEndpointConnection].from_continuation_token( + return AsyncLROPoller[_models.HorizonDbFirewallRule].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PrivateEndpointConnection]( + return AsyncLROPoller[_models.HorizonDbFirewallRule]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) async def _delete_initial( - self, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3150,9 +3010,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_private_endpoint_connections_delete_request( + _request = build_horizon_db_firewall_rules_delete_request( resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3200,16 +3062,19 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection. + """Deletes a HorizonDB firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. + :type firewall_rule_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3224,7 +3089,9 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, + cluster_name=cluster_name, + pool_name=pool_name, + firewall_rule_name=firewall_rule_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3259,14 +3126,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbPrivateLinkResourcesOperations: +class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_private_link_resources` attribute. + :attr:`horizon_db_private_endpoint_connections` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3278,20 +3145,21 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get( - self, resource_group_name: str, cluster_name: str, group_name: str, **kwargs: Any - ) -> _models.HorizonDbPrivateLinkResource: - """Gets a private link resource. + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Gets a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param group_name: The name of the private link resource. Required. - :type group_name: str - :return: HorizonDbPrivateLinkResource. The HorizonDbPrivateLinkResource is compatible with - MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3305,12 +3173,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPrivateLinkResource] = kwargs.pop("cls", None) + cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) - _request = build_horizon_db_private_link_resources_get_request( + _request = build_horizon_db_private_endpoint_connections_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - group_name=group_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3345,7 +3213,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbPrivateLinkResource, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3355,23 +3223,23 @@ async def get( @distributed_trace def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbPrivateLinkResource"]: - """Lists private link resources in a HorizonDb cluster. + ) -> AsyncItemPaged["_models.PrivateEndpointConnectionResource"]: + """Lists private endpoint connections in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPrivateLinkResource + :return: An iterator like instance of PrivateEndpointConnectionResource :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPrivateLinkResource]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.PrivateEndpointConnectionResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3384,7 +3252,7 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_private_link_resources_list_request( + _request = build_horizon_db_private_endpoint_connections_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, @@ -3410,7 +3278,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3424,7 +3295,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbPrivateLinkResource], + List[_models.PrivateEndpointConnectionResource], deserialized.get("value", []), ) if cls: @@ -3452,37 +3323,143 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: _models.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. -class HorizonDbParameterGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s - :attr:`horizon_db_parameter_groups` attribute. - """ + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: _types.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: 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: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async - async def get( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> _models.HorizonDbParameterGroup: - """Gets information about a HorizonDb parameter group. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :return: HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type + or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource or + ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource or IO[bytes] + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3493,16 +3470,27 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_private_endpoint_connections_update_status_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -3519,7 +3507,7 @@ async def get( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -3535,19 +3523,15 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_or_update_initial( - self, - resource_group_name: str, - parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, JSON, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3557,26 +3541,17 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_parameter_groups_create_or_update_request( + _request = build_horizon_db_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3593,7 +3568,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3606,10 +3581,11 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -3619,131 +3595,36 @@ async def _create_or_update_initial( return deserialized # type: ignore - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - parameter_group_name: str, - resource: _models.HorizonDbParameterGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - parameter_group_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - parameter_group_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Required. - :type resource: 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: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param resource: Resource create parameters. Is one of the following types: - HorizonDbParameterGroup, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - resource=resource, - content_type=content_type, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3752,12 +3633,9 @@ async def begin_create_or_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -3772,23 +3650,50 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.HorizonDbParameterGroup].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbParameterGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _update_initial( - self, - resource_group_name: str, - parameter_group_name: str, - properties: Union[_models.HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: + +class HorizonDbPrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`horizon_db_private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, group_name: str, **kwargs: Any + ) -> _models.HorizonDbPrivateLinkResource: + """Gets a private link resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: HorizonDbPrivateLinkResource. The HorizonDbPrivateLinkResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3797,26 +3702,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.HorizonDbPrivateLinkResource] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_update_request( + _request = build_horizon_db_private_link_resources_get_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + group_name=group_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -3826,18 +3722,19 @@ async def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -3845,96 +3742,306 @@ async def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbPrivateLinkResource, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: _models.HorizonDbParameterGroupForPatchUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbPrivateLinkResource"]: + """Lists private link resources in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of HorizonDbPrivateLinkResource :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_update( - self, - resource_group_name: str, - parameter_group_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + cls: ClsType[List[_models.HorizonDbPrivateLinkResource]] = kwargs.pop("cls", None) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The - HorizonDbParameterGroup is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - @overload - async def begin_update( + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_private_link_resources_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbPrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class HorizonDbParameterGroupsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`horizon_db_parameter_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> _models.HorizonDbParameterGroup: + """Gets information about a HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + + _request = build_horizon_db_parameter_groups_get_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( self, resource_group_name: str, parameter_group_name: str, - properties: IO[bytes], + resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_parameter_groups_create_or_update_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: _models.HorizonDbParameterGroup, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The @@ -3944,32 +4051,90 @@ async def begin_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async - async def begin_update( + @overload + async def begin_create_or_update( self, resource_group_name: str, parameter_group_name: str, - properties: Union[_models.HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes]], + resource: _types.HorizonDbParameterGroup, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or JSON or - IO[bytes] + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.HorizonDbParameterGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Creates a new HorizonDB parameter group or updates an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + parameter_group_name: str, + resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Creates a new HorizonDB parameter group or updates an existing parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param resource: Resource create parameters. Is either a HorizonDbParameterGroup type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or + ~azure.mgmt.horizondb.types.HorizonDbParameterGroup or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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)) @@ -3978,10 +4143,10 @@ async def begin_update( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, parameter_group_name=parameter_group_name, - properties=properties, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4017,12 +4182,908 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.HorizonDbParameterGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[_models.HorizonDbParameterGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + parameter_group_name: str, + properties: Union[ + _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_parameter_groups_update_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: _models.HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Updates an existing HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: _types.HorizonDbParameterGroupForPatchUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Updates an existing HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Updates an existing HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + parameter_group_name: str, + properties: Union[ + _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbParameterGroup]: + """Updates an existing HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :param properties: The resource properties to be updated. Is either a + HorizonDbParameterGroupForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbParameterGroup. The + HorizonDbParameterGroup is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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[_models.HorizonDbParameterGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.HorizonDbParameterGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HorizonDbParameterGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HorizonDbParameterGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_horizon_db_parameter_groups_delete_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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 [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: + """Lists all HorizonDB parameter groups in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: + """Lists all HorizonDB parameter groups in a subscription. + + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_connections( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: + """Gets all connections to a parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_connections_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroupConnectionProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_versions( + self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: + """Lists parameter groups filtered by version number. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :keyword version: The version number to filter by. Default value is None. + :paramtype version: int + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_versions_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + version=version, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class HorizonDbAdministratorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.aio.HorizonDBMgmtClient`'s + :attr:`horizon_db_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def get( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> _models.HorizonDbAdministrator: + """Gets information about a HorizonDB administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :return: HorizonDbAdministrator. The HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) + + _request = build_horizon_db_administrators_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - async def _delete_initial( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4032,16 +5093,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_administrators_create_or_update_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + object_id=object_id, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4058,7 +5130,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4071,11 +5143,10 @@ async def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: + if response.status_code == 201: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -4085,32 +5156,156 @@ async def _delete_initial( return deserialized # type: ignore + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _models.HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _types.HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a HorizonDb parameter group. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Is either a HorizonDbAdministratorAdd type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd or + ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd or IO[bytes] + :return: An instance of AsyncLROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + object_id=object_id, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4119,9 +5314,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -4130,131 +5328,32 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- if polling is True: polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDb parameter groups in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_parameter_groups_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDb parameter groups in a subscription. - - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.HorizonDbAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.HorizonDbAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4263,197 +5362,156 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Horizon } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_horizon_db_parameter_groups_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_horizon_db_administrators_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + response = pipeline_response.http_response - async def get_next(next_link=None): - _request = prepare_request(next_link) + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") ) - response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore - @distributed_trace - def list_connections( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: - """Gets all connections to a parameter group. + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] + }, + api_versions_list=["2026-05-01-preview"], + ) + async def begin_delete( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a HorizonDB administrator. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_parameter_groups_list_connections_request( - resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroupConnectionProperties], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - async def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_versions( - self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.HorizonDbParameterGroup"]: - """Lists parameter groups filtered by version number. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.HorizonDbAdministrator"]: + """Lists all HorizonDB administrators in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :keyword version: The version number to filter by. Default value is None. - :paramtype version: int - :return: An iterator like instance of HorizonDbParameterGroup + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of HorizonDbAdministrator :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.horizondb.models.HorizonDbAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.HorizonDbAdministrator]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4466,11 +5524,10 @@ def list_versions( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_versions_request( + _request = build_horizon_db_administrators_list_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, - version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -4493,7 +5550,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4507,7 +5567,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.HorizonDbAdministrator], deserialized.get("value", []), ) if cls: diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_patch.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_patch.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py index 571c0b4a0c47..4c01d651cb25 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/__init__.py @@ -17,11 +17,18 @@ ErrorAdditionalInfo, ErrorDetail, ErrorResponse, + HorizonDbAdministrator, + HorizonDbAdministratorAdd, + HorizonDbAdministratorProperties, + HorizonDbAdministratorPropertiesForAdd, HorizonDbCluster, + HorizonDbClusterAuthConfig, HorizonDbClusterForPatchUpdate, + HorizonDbClusterMirroring, HorizonDbClusterParameterGroupConnectionProperties, HorizonDbClusterProperties, HorizonDbClusterPropertiesForPatchUpdate, + HorizonDbComputeModel, HorizonDbFirewallRule, HorizonDbFirewallRuleProperties, HorizonDbParameterGroup, @@ -36,30 +43,33 @@ HorizonDbReplicaForPatchUpdate, HorizonDbReplicaProperties, HorizonDbReplicaPropertiesForPatchUpdate, + ManagedServiceIdentity, Network, Operation, OperationDisplay, - OptionalPropertiesUpdateableProperties, ParameterProperties, PrivateEndpoint, - PrivateEndpointConnection, PrivateEndpointConnectionProperties, PrivateEndpointConnectionResource, - PrivateEndpointConnectionUpdate, PrivateLinkResourceProperties, PrivateLinkServiceConnectionState, ProxyResource, Resource, SystemData, TrackedResource, + UserAssignedIdentity, ) from ._enums import ( # type: ignore ActionType, + AuthenticationState, CreateModeCluster, CreateModePool, CreatedByType, + HorizonDbComputeModelType, + ManagedServiceIdentityType, Origin, + PrincipalTypes, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, ProvisioningState, @@ -76,11 +86,18 @@ "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "HorizonDbAdministrator", + "HorizonDbAdministratorAdd", + "HorizonDbAdministratorProperties", + "HorizonDbAdministratorPropertiesForAdd", "HorizonDbCluster", + "HorizonDbClusterAuthConfig", "HorizonDbClusterForPatchUpdate", + "HorizonDbClusterMirroring", "HorizonDbClusterParameterGroupConnectionProperties", "HorizonDbClusterProperties", "HorizonDbClusterPropertiesForPatchUpdate", + "HorizonDbComputeModel", "HorizonDbFirewallRule", "HorizonDbFirewallRuleProperties", "HorizonDbParameterGroup", @@ -95,27 +112,30 @@ "HorizonDbReplicaForPatchUpdate", "HorizonDbReplicaProperties", "HorizonDbReplicaPropertiesForPatchUpdate", + "ManagedServiceIdentity", "Network", "Operation", "OperationDisplay", - "OptionalPropertiesUpdateableProperties", "ParameterProperties", "PrivateEndpoint", - "PrivateEndpointConnection", "PrivateEndpointConnectionProperties", "PrivateEndpointConnectionResource", - "PrivateEndpointConnectionUpdate", "PrivateLinkResourceProperties", "PrivateLinkServiceConnectionState", "ProxyResource", "Resource", "SystemData", "TrackedResource", + "UserAssignedIdentity", "ActionType", + "AuthenticationState", "CreateModeCluster", "CreateModePool", "CreatedByType", + "HorizonDbComputeModelType", + "ManagedServiceIdentityType", "Origin", + "PrincipalTypes", "PrivateEndpointConnectionProvisioningState", "PrivateEndpointServiceConnectionStatus", "ProvisioningState", diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py index 4ab745fe9b3c..eece19388040 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_enums.py @@ -19,6 +19,15 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Actions are for internal-only APIs.""" +class AuthenticationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates if authentication state is enabled or not.""" + + ENABLED = "Enabled" + """Is enabled.""" + DISABLED = "Disabled" + """Is disabled.""" + + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of entity that created the resource.""" @@ -33,7 +42,7 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CreateModeCluster(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode to create a new HorizonDb cluster.""" + """The mode to create a new HorizonDB cluster.""" CREATE = "Create" """Create a new cluster.""" @@ -44,7 +53,7 @@ class CreateModeCluster(str, Enum, metaclass=CaseInsensitiveEnumMeta): class CreateModePool(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode to create a new HorizonDb cluster.""" + """The mode to create a new HorizonDB cluster.""" CREATE = "Create" """Create a new pool.""" @@ -52,6 +61,30 @@ class CreateModePool(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Update an existing pool.""" +class HorizonDbComputeModelType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The compute model type.""" + + PROVISIONED = "Provisioned" + """Provisioned compute.""" + SERVERLESS = "Serverless" + """Serverless compute.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". @@ -65,6 +98,19 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" +class PrincipalTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the Entra ID principal.""" + + UNKNOWN = "Unknown" + """Unknown or unrecognized type (internal only, not accepted in requests).""" + USER = "User" + """An Entra ID user account (UPN-based principal).""" + GROUP = "Group" + """An Entra ID security group. All members of the group inherit admin privileges.""" + SERVICE_PRINCIPAL = "ServicePrincipal" + """An Entra ID application / service principal (used for automated workloads).""" + + class PrivateEndpointConnectionProvisioningState( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): @@ -143,6 +189,10 @@ class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Is being updated.""" HEALTHY = "Healthy" """Is healthy.""" + SUCCEEDED = "Succeeded" + """Is succeeded.""" + UPGRADING = "Upgrading" + """Is upgrading.""" class ZonePlacementPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py index 86a5dc772994..5cb1ce4f50d0 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_models.py @@ -61,7 +61,7 @@ class ErrorDetail(_Model): """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -117,7 +117,205 @@ class Resource(_Model): """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" -class TrackedResource(Resource): +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + """ + + +class HorizonDbAdministrator(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents an Entra ID administrator configured on a HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbAdministratorProperties + """ + + properties: Optional["_models.HorizonDbAdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.HorizonDbAdministratorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbAdministratorAdd(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request body for adding a HorizonDB administrator. + + :ivar properties: The properties for adding a HorizonDB administrator. Required. + :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbAdministratorPropertiesForAdd + """ + + properties: "_models.HorizonDbAdministratorPropertiesForAdd" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties for adding a HorizonDB administrator. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.HorizonDbAdministratorPropertiesForAdd", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbAdministratorProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB administrator. + + :ivar principal_name: The display name or UPN of the Entra ID principal. For users, typically + the User Principal Name (e.g., `admin@contoso.com `_). For groups, + the group display name. For service principals, the application display name. Required. + :vartype principal_name: str + :ivar principal_type: The type of the Entra ID principal. Required. Known values are: + "Unknown", "User", "Group", and "ServicePrincipal". + :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes + :ivar object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). On PUT + requests, this value comes from the URI path parameter. + :vartype object_id: str + :ivar tenant_id: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the + tenant of the subscription. + :vartype tenant_id: str + :ivar provisioning_state: The provisioning state of the administrator. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioning_state: str or ~azure.mgmt.horizondb.models.ProvisioningState + """ + + principal_name: str = rest_field(name="principalName", visibility=["read", "create"]) + """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name + (e.g., `admin@contoso.com `_). For groups, the group display name. + For service principals, the application display name. Required.""" + principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( + name="principalType", visibility=["read", "create"] + ) + """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", + \"Group\", and \"ServicePrincipal\".""" + object_id: Optional[str] = rest_field(name="objectId", visibility=["read"]) + """The Entra ID object identifier of the principal (an RFC 4122 GUID). On PUT requests, this value + comes from the URI path parameter.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create"]) + """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the + subscription.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the administrator. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, "_models.PrincipalTypes"], + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbAdministratorPropertiesForAdd(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties for adding a HorizonDB administrator. + + :ivar principal_name: The display name or UPN of the Entra ID principal. For users, typically + the User Principal Name (e.g., `admin@contoso.com `_). For groups, + the group display name. For service principals, the application display name. Required. + :vartype principal_name: str + :ivar principal_type: The type of the Entra ID principal. Required. Known values are: + "Unknown", "User", "Group", and "ServicePrincipal". + :vartype principal_type: str or ~azure.mgmt.horizondb.models.PrincipalTypes + :ivar tenant_id: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the + tenant of the subscription. + :vartype tenant_id: str + """ + + principal_name: str = rest_field(name="principalName", visibility=["read", "create", "update", "delete", "query"]) + """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name + (e.g., `admin@contoso.com `_). For groups, the group display name. + For service principals, the application display name. Required.""" + principal_type: Union[str, "_models.PrincipalTypes"] = rest_field( + name="principalType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", + \"Group\", and \"ServicePrincipal\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the + subscription.""" + + @overload + def __init__( + self, + *, + principal_name: str, + principal_type: Union[str, "_models.PrincipalTypes"], + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -161,8 +359,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbCluster(TrackedResource): - """Represents the HorizonDb cluster. +class HorizonDbCluster(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB cluster. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -181,12 +379,18 @@ class HorizonDbCluster(TrackedResource): :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbClusterProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.horizondb.models.ManagedServiceIdentity """ properties: Optional["_models.HorizonDbClusterProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" @overload def __init__( @@ -195,6 +399,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, properties: Optional["_models.HorizonDbClusterProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -208,27 +413,80 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterForPatchUpdate(_Model): - """HorizonDb cluster for update operations. +class HorizonDbClusterAuthConfig(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Authentication configuration for a HorizonDB cluster. + + :ivar entra_id_auth: Indicates whether Microsoft Entra ID authentication is enabled or + disabled. Known values are: "Enabled" and "Disabled". + :vartype entra_id_auth: str or ~azure.mgmt.horizondb.models.AuthenticationState + :ivar tenant_id: The Microsoft Entra tenant ID. + :vartype tenant_id: str + :ivar password_auth: Indicates whether password authentication is enabled or disabled. Known + values are: "Enabled" and "Disabled". + :vartype password_auth: str or ~azure.mgmt.horizondb.models.AuthenticationState + """ + + entra_id_auth: Optional[Union[str, "_models.AuthenticationState"]] = rest_field( + name="entraIdAuth", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether Microsoft Entra ID authentication is enabled or disabled. Known values are: + \"Enabled\" and \"Disabled\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The Microsoft Entra tenant ID.""" + password_auth: Optional[Union[str, "_models.AuthenticationState"]] = rest_field( + name="passwordAuth", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether password authentication is enabled or disabled. Known values are: \"Enabled\" + and \"Disabled\".""" + + @overload + def __init__( + self, + *, + entra_id_auth: Optional[Union[str, "_models.AuthenticationState"]] = None, + tenant_id: Optional[str] = None, + password_auth: Optional[Union[str, "_models.AuthenticationState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbClusterForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HorizonDB cluster for update operations. :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar properties: The properties that can be updated for a HorizonDb cluster. + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.horizondb.models.ManagedServiceIdentity + :ivar properties: The properties that can be updated for a HorizonDB cluster. :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbClusterPropertiesForPatchUpdate """ tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" properties: Optional["_models.HorizonDbClusterPropertiesForPatchUpdate"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties that can be updated for a HorizonDb cluster.""" + """The properties that can be updated for a HorizonDB cluster.""" @overload def __init__( self, *, tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, properties: Optional["_models.HorizonDbClusterPropertiesForPatchUpdate"] = None, ) -> None: ... @@ -243,12 +501,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterParameterGroupConnectionProperties(_Model): # pylint: disable=name-too-long - """Connection information for HorizonDb parameter group. +class HorizonDbClusterMirroring(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Mirroring configuration for a HorizonDB cluster. + + :ivar database_names: The names of the databases to mirror. + :vartype database_names: list[str] + :ivar user_assigned_identity_id: The resource ID of the user-assigned managed identity used for + mirroring. + :vartype user_assigned_identity_id: str + """ + + database_names: Optional[list[str]] = rest_field( + name="databaseNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The names of the databases to mirror.""" + user_assigned_identity_id: Optional[str] = rest_field( + name="userAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the user-assigned managed identity used for mirroring.""" + + @overload + def __init__( + self, + *, + database_names: Optional[list[str]] = None, + user_assigned_identity_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HorizonDbClusterParameterGroupConnectionProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Connection information for HorizonDB parameter group. :ivar id: The resource ID of the connected parameter group. :vartype id: str - :ivar sync_status: Indication of if parameter group is applied on HorizonDb resource. + :ivar sync_status: Indication of if parameter group is applied on HorizonDB resource. :vartype sync_status: str :ivar apply_immediately: Indicates whether the parameters should be applied immediately. :vartype apply_immediately: bool @@ -257,7 +555,7 @@ class HorizonDbClusterParameterGroupConnectionProperties(_Model): # pylint: dis id: Optional[str] = rest_field(visibility=["read", "update"]) """The resource ID of the connected parameter group.""" sync_status: Optional[str] = rest_field(name="syncStatus", visibility=["read"]) - """Indication of if parameter group is applied on HorizonDb resource.""" + """Indication of if parameter group is applied on HorizonDB resource.""" apply_immediately: Optional[bool] = rest_field(name="applyImmediately", visibility=["read", "update"]) """Indicates whether the parameters should be applied immediately.""" @@ -280,16 +578,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterProperties(_Model): - """Properties of a HorizonDb cluster. +class HorizonDbClusterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB cluster. :ivar administrator_login: The administrator login name. Required. :vartype administrator_login: str :ivar administrator_login_password: The administrator login password. :vartype administrator_login_password: str - :ivar version: The version of the HorizonDb cluster. + :ivar version: The version of the HorizonDB cluster. :vartype version: str - :ivar create_mode: The mode to create a new HorizonDb cluster. Known values are: "Create", + :ivar create_mode: The mode to create a new HorizonDB cluster. Known values are: "Create", "Update", and "PointInTimeRestore". :vartype create_mode: str or ~azure.mgmt.horizondb.models.CreateModeCluster :ivar point_in_time_utc: Restore point creation time specifying the time to restore from. @@ -303,12 +601,12 @@ class HorizonDbClusterProperties(_Model): :vartype replica_count: int :ivar v_cores: Number of vCores. :vartype v_cores: int - :ivar processor_type: The processor type for the HorizonDb cluster. + :ivar processor_type: The processor type for the HorizonDB cluster. :vartype processor_type: str :ivar network: The network related info. :vartype network: ~azure.mgmt.horizondb.models.Network :ivar state: Current state of the cluster. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", and "Healthy". + "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". :vartype state: str or ~azure.mgmt.horizondb.models.State :ivar fully_qualified_domain_name: The fully qualified domain name of the cluster. :vartype fully_qualified_domain_name: str @@ -324,6 +622,12 @@ class HorizonDbClusterProperties(_Model): :ivar parameter_group: Defines connection to a parameter group. :vartype parameter_group: ~azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties + :ivar auth_config: Authentication configuration for the HorizonDB cluster. + :vartype auth_config: ~azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig + :ivar compute_model: The compute model for the cluster. + :vartype compute_model: ~azure.mgmt.horizondb.models.HorizonDbComputeModel + :ivar mirroring: Mirroring configuration for the HorizonDB cluster. + :vartype mirroring: ~azure.mgmt.horizondb.models.HorizonDbClusterMirroring """ administrator_login: str = rest_field(name="administratorLogin", visibility=["read", "create"]) @@ -333,11 +637,11 @@ class HorizonDbClusterProperties(_Model): ) """The administrator login password.""" version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The version of the HorizonDb cluster.""" + """The version of the HorizonDB cluster.""" create_mode: Optional[Union[str, "_models.CreateModeCluster"]] = rest_field( name="createMode", visibility=["read", "create", "update", "delete", "query"] ) - """The mode to create a new HorizonDb cluster. Known values are: \"Create\", \"Update\", and + """The mode to create a new HorizonDB cluster. Known values are: \"Create\", \"Update\", and \"PointInTimeRestore\".""" point_in_time_utc: Optional[datetime.datetime] = rest_field( name="pointInTimeUTC", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" @@ -356,12 +660,13 @@ class HorizonDbClusterProperties(_Model): processor_type: Optional[str] = rest_field( name="processorType", visibility=["read", "create", "update", "delete", "query"] ) - """The processor type for the HorizonDb cluster.""" + """The processor type for the HorizonDB cluster.""" network: Optional["_models.Network"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The network related info.""" state: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) """Current state of the cluster. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", and \"Healthy\".""" + \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and + \"Upgrading\".""" fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) """The fully qualified domain name of the cluster.""" readonly_endpoint: Optional[str] = rest_field(name="readonlyEndpoint", visibility=["read"]) @@ -380,6 +685,16 @@ class HorizonDbClusterProperties(_Model): name="parameterGroup", visibility=["read", "update"] ) """Defines connection to a parameter group.""" + auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = rest_field( + name="authConfig", visibility=["read", "create", "update"] + ) + """Authentication configuration for the HorizonDB cluster.""" + compute_model: Optional["_models.HorizonDbComputeModel"] = rest_field( + name="computeModel", visibility=["read", "create", "update"] + ) + """The compute model for the cluster.""" + mirroring: Optional["_models.HorizonDbClusterMirroring"] = rest_field(visibility=["read", "create", "update"]) + """Mirroring configuration for the HorizonDB cluster.""" @overload def __init__( @@ -398,6 +713,9 @@ def __init__( network: Optional["_models.Network"] = None, zone_placement_policy: Optional[Union[str, "_models.ZonePlacementPolicy"]] = None, parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = None, + auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = None, + compute_model: Optional["_models.HorizonDbComputeModel"] = None, + mirroring: Optional["_models.HorizonDbClusterMirroring"] = None, ) -> None: ... @overload @@ -411,8 +729,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbClusterPropertiesForPatchUpdate(_Model): - """Properties of a HorizonDb cluster for update operations. +class HorizonDbClusterPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB cluster for update operations. :ivar administrator_login_password: The administrator login password. :vartype administrator_login_password: str @@ -421,6 +739,12 @@ class HorizonDbClusterPropertiesForPatchUpdate(_Model): :ivar parameter_group: Defines connection to a parameter group. :vartype parameter_group: ~azure.mgmt.horizondb.models.HorizonDbClusterParameterGroupConnectionProperties + :ivar auth_config: Authentication configuration for the HorizonDB cluster. + :vartype auth_config: ~azure.mgmt.horizondb.models.HorizonDbClusterAuthConfig + :ivar compute_model: The compute model for the cluster. + :vartype compute_model: ~azure.mgmt.horizondb.models.HorizonDbComputeModel + :ivar mirroring: Mirroring configuration for the HorizonDB cluster. + :vartype mirroring: ~azure.mgmt.horizondb.models.HorizonDbClusterMirroring """ administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["update"]) @@ -431,6 +755,12 @@ class HorizonDbClusterPropertiesForPatchUpdate(_Model): name="parameterGroup", visibility=["read", "create", "update", "delete", "query"] ) """Defines connection to a parameter group.""" + auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = rest_field(name="authConfig", visibility=["update"]) + """Authentication configuration for the HorizonDB cluster.""" + compute_model: Optional["_models.HorizonDbComputeModel"] = rest_field(name="computeModel", visibility=["update"]) + """The compute model for the cluster.""" + mirroring: Optional["_models.HorizonDbClusterMirroring"] = rest_field(visibility=["update"]) + """Mirroring configuration for the HorizonDB cluster.""" @overload def __init__( @@ -439,6 +769,9 @@ def __init__( administrator_login_password: Optional[str] = None, v_cores: Optional[int] = None, parameter_group: Optional["_models.HorizonDbClusterParameterGroupConnectionProperties"] = None, + auth_config: Optional["_models.HorizonDbClusterAuthConfig"] = None, + compute_model: Optional["_models.HorizonDbComputeModel"] = None, + mirroring: Optional["_models.HorizonDbClusterMirroring"] = None, ) -> None: ... @overload @@ -452,25 +785,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ProxyResource(Resource): - """Proxy Resource. +class HorizonDbComputeModel(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The compute model for a HorizonDB cluster. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.horizondb.models.SystemData + :ivar type: The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values + are: "Provisioned" and "Serverless". + :vartype type: str or ~azure.mgmt.horizondb.models.HorizonDbComputeModelType + :ivar v_cores: The fixed vCore count for Provisioned compute. + :vartype v_cores: int + :ivar minv_cores: The minimum vCores for Serverless compute. Defines the lower autoscaling + bound. + :vartype minv_cores: float + :ivar maxv_cores: The maximum vCores for Serverless compute. Defines the upper autoscaling + bound. + :vartype maxv_cores: float """ + type: Optional[Union[str, "_models.HorizonDbComputeModelType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values are: + \"Provisioned\" and \"Serverless\".""" + v_cores: Optional[int] = rest_field(name="vCores", visibility=["read", "create", "update", "delete", "query"]) + """The fixed vCore count for Provisioned compute.""" + minv_cores: Optional[float] = rest_field( + name="minvCores", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum vCores for Serverless compute. Defines the lower autoscaling bound.""" + maxv_cores: Optional[float] = rest_field( + name="maxvCores", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum vCores for Serverless compute. Defines the upper autoscaling bound.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.HorizonDbComputeModelType"]] = None, + v_cores: Optional[int] = None, + minv_cores: Optional[float] = None, + maxv_cores: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + -class HorizonDbFirewallRule(ProxyResource): - """Represents the HorizonDb firewall rule. +class HorizonDbFirewallRule(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB firewall rule. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -510,14 +879,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbFirewallRuleProperties(_Model): - """Properties of a HorizonDb firewall rule. +class HorizonDbFirewallRuleProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB firewall rule. :ivar start_ip_address: The start IP address of the firewall rule (IPv4). Required. :vartype start_ip_address: str :ivar end_ip_address: The end IP address of the firewall rule (IPv4). Required. :vartype end_ip_address: str - :ivar description: The description of the HorizonDb firewall rule. + :ivar description: The description of the HorizonDB firewall rule. :vartype description: str :ivar provisioning_state: The provisioning state of the firewall rule. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". @@ -529,7 +898,7 @@ class HorizonDbFirewallRuleProperties(_Model): end_ip_address: str = rest_field(name="endIpAddress", visibility=["read", "create", "update"]) """The end IP address of the firewall rule (IPv4). Required.""" description: Optional[str] = rest_field(visibility=["read", "create", "update"]) - """The description of the HorizonDb firewall rule.""" + """The description of the HorizonDB firewall rule.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -556,8 +925,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroup(TrackedResource): - """Represents the HorizonDb parameter group. +class HorizonDbParameterGroup(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB parameter group. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -604,7 +973,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class HorizonDbParameterGroupConnectionProperties(_Model): # pylint: disable=name-too-long - """Connection information for HorizonDb parameter group. + """Connection information for HorizonDB parameter group. :ivar name: The name of the connected resource. :vartype name: str @@ -622,12 +991,12 @@ class HorizonDbParameterGroupConnectionProperties(_Model): # pylint: disable=na """The type of the resource.""" -class HorizonDbParameterGroupForPatchUpdate(_Model): - """HorizonDb parameter group for update operations. +class HorizonDbParameterGroupForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HorizonDB parameter group for update operations. :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar properties: The properties that can be updated for a HorizonDb parameter group. + :ivar properties: The properties that can be updated for a HorizonDB parameter group. :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupPropertiesForPatchUpdate """ @@ -637,7 +1006,7 @@ class HorizonDbParameterGroupForPatchUpdate(_Model): properties: Optional["_models.HorizonDbParameterGroupPropertiesForPatchUpdate"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The properties that can be updated for a HorizonDb parameter group.""" + """The properties that can be updated for a HorizonDB parameter group.""" @overload def __init__( @@ -658,8 +1027,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroupProperties(_Model): - """Properties of a HorizonDb parameter group. +class HorizonDbParameterGroupProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB parameter group. :ivar parameters: Parameters in the parameter group. :vartype parameters: list[~azure.mgmt.horizondb.models.ParameterProperties] @@ -713,8 +1082,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbParameterGroupPropertiesForPatchUpdate(_Model): # pylint: disable=name-too-long - """Properties of a HorizonDb parameter group for update operations. +class HorizonDbParameterGroupPropertiesForPatchUpdate( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB parameter group for update operations. :ivar parameters: Parameters in the parameter group. :vartype parameters: list[~azure.mgmt.horizondb.models.ParameterProperties] @@ -751,8 +1122,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPool(ProxyResource): - """Represents the HorizonDb pool. +class HorizonDbPool(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB pool. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -797,17 +1168,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPoolProperties(_Model): - """Properties of a HorizonDb pool. +class HorizonDbPoolProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB pool. - :ivar location: The location of the HorizonDb pool. + :ivar location: The location of the HorizonDB pool. :vartype location: str :ivar state: Current state of the pool. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", and "Healthy". + "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". :vartype state: str or ~azure.mgmt.horizondb.models.State :ivar replica_count: Number of replicas in the pool. :vartype replica_count: int - :ivar version: The version of the HorizonDb pool. + :ivar version: The version of the HorizonDB pool. :vartype version: str :ivar create_mode: The create mode for the pool. Known values are: "Create" and "Update". :vartype create_mode: str or ~azure.mgmt.horizondb.models.CreateModePool @@ -817,14 +1188,15 @@ class HorizonDbPoolProperties(_Model): """ location: Optional[str] = rest_field(visibility=["read", "create"]) - """The location of the HorizonDb pool.""" + """The location of the HorizonDB pool.""" state: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) """Current state of the pool. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", and \"Healthy\".""" + \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and + \"Upgrading\".""" replica_count: Optional[int] = rest_field(name="replicaCount", visibility=["read"]) """Number of replicas in the pool.""" version: Optional[str] = rest_field(visibility=["read"]) - """The version of the HorizonDb pool.""" + """The version of the HorizonDB pool.""" create_mode: Optional[Union[str, "_models.CreateModePool"]] = rest_field(name="createMode", visibility=["read"]) """The create mode for the pool. Known values are: \"Create\" and \"Update\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -851,8 +1223,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbPrivateLinkResource(ProxyResource): - """Represents the HorizonDb private link resource. +class HorizonDbPrivateLinkResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB private link resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -892,8 +1264,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplica(ProxyResource): - """Represents the HorizonDb replica. +class HorizonDbReplica(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Represents the HorizonDB replica. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -933,17 +1305,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaForPatchUpdate(_Model): - """HorizonDb replica for update operations. +class HorizonDbReplicaForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """HorizonDB replica for update operations. - :ivar properties: Properties of a HorizonDb replica for update operations. + :ivar properties: Properties of a HorizonDB replica for update operations. :vartype properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaPropertiesForPatchUpdate """ properties: Optional["_models.HorizonDbReplicaPropertiesForPatchUpdate"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Properties of a HorizonDb replica for update operations.""" + """Properties of a HorizonDB replica for update operations.""" @overload def __init__( @@ -963,13 +1335,13 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaProperties(_Model): - """Properties of a HorizonDb replica. +class HorizonDbReplicaProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB replica. :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". :vartype role: str or ~azure.mgmt.horizondb.models.ReplicaRole :ivar status: Current status of the replica. Known values are: "Ready", "Dropping", "Disabled", - "Starting", "Stopping", "Stopped", "Updating", and "Healthy". + "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". :vartype status: str or ~azure.mgmt.horizondb.models.State :ivar fully_qualified_domain_name: The fully qualified domain name of the replica. :vartype fully_qualified_domain_name: str @@ -984,7 +1356,8 @@ class HorizonDbReplicaProperties(_Model): """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" status: Optional[Union[str, "_models.State"]] = rest_field(visibility=["read"]) """Current status of the replica. Known values are: \"Ready\", \"Dropping\", \"Disabled\", - \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", and \"Healthy\".""" + \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and + \"Upgrading\".""" fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) """The fully qualified domain name of the replica.""" availability_zone: Optional[str] = rest_field( @@ -1016,8 +1389,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HorizonDbReplicaPropertiesForPatchUpdate(_Model): - """Properties of a HorizonDb replica for update operations. +class HorizonDbReplicaPropertiesForPatchUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB replica for update operations. :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". :vartype role: str or ~azure.mgmt.horizondb.models.ReplicaRole @@ -1044,6 +1417,57 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.horizondb.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.horizondb.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class Network(_Model): """Network properties. @@ -1059,7 +1483,7 @@ class Network(_Model): \"Disabled\".""" -class Operation(_Model): +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -1147,48 +1571,8 @@ class OperationDisplay(_Model): views.""" -class OptionalPropertiesUpdateableProperties(_Model): - """The template for adding optional properties. - - :ivar private_endpoint: The private endpoint resource. - :vartype private_endpoint: ~azure.mgmt.horizondb.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.horizondb.models.PrivateLinkServiceConnectionState - """ - - private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field( - name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] - ) - """The private endpoint resource.""" - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = rest_field( - name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] - ) - """A collection of information about the state of the connection between service consumer and - provider.""" - - @overload - def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ParameterProperties(_Model): - """Properties of a HorizonDb parameters. +class ParameterProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties of a HorizonDB parameters. :ivar name: The name of the parameter. :vartype name: str @@ -1259,48 +1643,7 @@ class PrivateEndpoint(_Model): """The resource identifier of the private endpoint.""" -class PrivateEndpointConnection(Resource): - """The private endpoint connection resource. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.horizondb.models.SystemData - :ivar properties: The private endpoint connection properties. - :vartype properties: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionProperties - """ - - properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The private endpoint connection properties.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateEndpointConnectionProperties(_Model): +class PrivateEndpointConnectionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of the private endpoint connection. :ivar group_ids: The group ids for the private endpoint resource. @@ -1353,7 +1696,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionResource(Resource): +class PrivateEndpointConnectionResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """A private endpoint connection resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1394,37 +1737,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateEndpointConnectionUpdate(_Model): - """PATCH model for private endpoint connections. - - :ivar properties: The private endpoint connection properties. - :vartype properties: ~azure.mgmt.horizondb.models.OptionalPropertiesUpdateableProperties - """ - - properties: Optional["_models.OptionalPropertiesUpdateableProperties"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The private endpoint connection properties.""" - - @overload - def __init__( - self, - *, - properties: Optional["_models.OptionalPropertiesUpdateableProperties"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PrivateLinkResourceProperties(_Model): +class PrivateLinkResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a private link resource. :ivar group_id: The private link resource group id. @@ -1462,7 +1775,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PrivateLinkServiceConnectionState(_Model): +class PrivateLinkServiceConnectionState(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """A collection of information about the state of the connection between service consumer and provider. @@ -1508,7 +1821,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -1573,3 +1886,18 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_patch.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_patch.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py index daeac9c6dc50..660c577f1dc7 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/__init__.py @@ -20,6 +20,7 @@ from ._operations import HorizonDbPrivateEndpointConnectionsOperations # type: ignore from ._operations import HorizonDbPrivateLinkResourcesOperations # type: ignore from ._operations import HorizonDbParameterGroupsOperations # type: ignore +from ._operations import HorizonDbAdministratorsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -34,6 +35,7 @@ "HorizonDbPrivateEndpointConnectionsOperations", "HorizonDbPrivateLinkResourcesOperations", "HorizonDbParameterGroupsOperations", + "HorizonDbAdministratorsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py index 0fd30eb59185..a837d1891469 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_operations.py @@ -32,14 +32,14 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import HorizonDBMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -50,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_horizon_db_clusters_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_horizon_db_clusters_create_or_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_horizon_db_clusters_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +160,7 @@ def build_horizon_db_clusters_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}" path_format_arguments = { @@ -183,7 +183,7 @@ def build_horizon_db_clusters_list_by_resource_group_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +210,7 @@ def build_horizon_db_clusters_list_by_subscription_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,13 +230,97 @@ def build_horizon_db_clusters_list_by_subscription_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_horizon_db_clusters_start_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/start" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_horizon_db_clusters_stop_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/stop" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_horizon_db_clusters_restart_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/restart" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_horizon_db_pools_get_request( resource_group_name: str, cluster_name: str, pool_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +349,7 @@ def build_horizon_db_pools_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,7 +377,7 @@ def build_horizon_db_replicas_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +407,7 @@ def build_horizon_db_replicas_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -353,7 +437,7 @@ def build_horizon_db_replicas_create_or_update_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -386,7 +470,7 @@ def build_horizon_db_replicas_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,7 +501,7 @@ def build_horizon_db_replicas_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/replicas/{replicaName}" path_format_arguments = { @@ -447,7 +531,7 @@ def build_horizon_db_firewall_rules_get_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -477,7 +561,7 @@ def build_horizon_db_firewall_rules_list_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -512,7 +596,7 @@ def build_horizon_db_firewall_rules_create_or_update_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -548,7 +632,7 @@ def build_horizon_db_firewall_rules_delete_request( # pylint: disable=name-too- ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/pools/{poolName}/firewallRules/{firewallRuleName}" path_format_arguments = { @@ -577,7 +661,7 @@ def build_horizon_db_private_endpoint_connections_get_request( # pylint: disabl _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -608,7 +692,7 @@ def build_horizon_db_private_endpoint_connections_list_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -630,21 +714,26 @@ def build_horizon_db_private_endpoint_connections_list_request( # pylint: disab return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_horizon_db_private_endpoint_connections_update_request( # pylint: disable=name-too-long - resource_group_name: str, private_endpoint_connection_name: str, subscription_id: str, **kwargs: Any +def build_horizon_db_private_endpoint_connections_update_status_request( # pylint: disable=name-too-long + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), "privateEndpointConnectionName": _SERIALIZER.url( "private_endpoint_connection_name", private_endpoint_connection_name, "str" ), @@ -660,20 +749,25 @@ def build_horizon_db_private_endpoint_connections_update_request( # pylint: dis _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_horizon_db_private_endpoint_connections_delete_request( # pylint: disable=name-too-long - resource_group_name: str, private_endpoint_connection_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/privateEndpointConnections/{privateEndpointConnectionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), "privateEndpointConnectionName": _SERIALIZER.url( "private_endpoint_connection_name", private_endpoint_connection_name, "str" ), @@ -693,7 +787,7 @@ def build_horizon_db_private_link_resources_get_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -722,7 +816,7 @@ def build_horizon_db_private_link_resources_list_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -750,7 +844,7 @@ def build_horizon_db_parameter_groups_get_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -779,7 +873,7 @@ def build_horizon_db_parameter_groups_create_or_update_request( # pylint: disab _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -810,7 +904,7 @@ def build_horizon_db_parameter_groups_update_request( # pylint: disable=name-to _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -839,7 +933,7 @@ def build_horizon_db_parameter_groups_delete_request( # pylint: disable=name-to ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/parameterGroups/{parameterGroupName}" path_format_arguments = { @@ -862,7 +956,7 @@ def build_horizon_db_parameter_groups_list_by_resource_group_request( # pylint: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -889,7 +983,7 @@ def build_horizon_db_parameter_groups_list_by_subscription_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -915,7 +1009,7 @@ def build_horizon_db_parameter_groups_list_connections_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -948,7 +1042,7 @@ def build_horizon_db_parameter_groups_list_versions_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-01-20-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -972,7 +1066,119 @@ def build_horizon_db_parameter_groups_list_versions_request( # pylint: disable= return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +def build_horizon_db_administrators_get_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "objectId": _SERIALIZER.url("object_id", object_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_horizon_db_administrators_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "objectId": _SERIALIZER.url("object_id", object_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # 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, params=_params, headers=_headers, **kwargs) + + +def build_horizon_db_administrators_delete_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, object_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators/{objectId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "objectId": _SERIALIZER.url("object_id", object_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_horizon_db_administrators_list_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HorizonDb/clusters/{clusterName}/administrators" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1036,7 +1242,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1079,7 +1288,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class HorizonDbClustersOperations: +class HorizonDbClustersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1098,12 +1307,12 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.HorizonDbCluster: - """Gets information about a HorizonDb cluster. + """Gets information about a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.mgmt.horizondb.models.HorizonDbCluster @@ -1170,7 +1379,7 @@ def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, JSON, IO[bytes]], + resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1253,12 +1462,12 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster @@ -1276,20 +1485,20 @@ def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - resource: JSON, + resource: _types.HorizonDbCluster, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbCluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1309,12 +1518,12 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] @@ -1332,19 +1541,20 @@ def begin_create_or_update( self, resource_group_name: str, cluster_name: str, - resource: Union[_models.HorizonDbCluster, JSON, IO[bytes]], + resource: Union[_models.HorizonDbCluster, _types.HorizonDbCluster, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Creates a new HorizonDb cluster or updates an existing cluster. + """Creates a new HorizonDB cluster or updates an existing cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param resource: Resource create parameters. Is one of the following types: HorizonDbCluster, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a HorizonDbCluster type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbCluster or + ~azure.mgmt.horizondb.types.HorizonDbCluster or IO[bytes] :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -1406,7 +1616,7 @@ def _update_initial( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1487,12 +1697,12 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate @@ -1510,20 +1720,20 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - properties: JSON, + properties: _types.HorizonDbClusterForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1543,12 +1753,12 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] @@ -1566,20 +1776,20 @@ def begin_update( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.HorizonDbClusterForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbClusterForPatchUpdate, _types.HorizonDbClusterForPatchUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbCluster]: - """Updates an existing HorizonDb cluster (e.g., tags, virtual cores, replica count). + """Updates an existing HorizonDB cluster (e.g., tags, virtual cores, replica count). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbClusterForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + HorizonDbClusterForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbClusterForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbClusterForPatchUpdate or IO[bytes] :return: An instance of LROPoller that returns HorizonDbCluster. The HorizonDbCluster is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -1701,12 +1911,12 @@ def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: @distributed_trace def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a HorizonDb cluster. + """Deletes a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] @@ -1758,7 +1968,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDb clusters in a resource group. + """Lists all HorizonDB clusters in a resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1808,7 +2018,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1852,7 +2065,7 @@ def get_next(next_link=None): @distributed_trace def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbCluster"]: - """Lists all HorizonDb clusters in a subscription. + """Lists all HorizonDB clusters in a subscription. :return: An iterator like instance of HorizonDbCluster :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbCluster] @@ -1898,7 +2111,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1940,39 +2156,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - -class HorizonDbPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_pools` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any) -> _models.HorizonDbPool: - """Gets information about a HorizonDb pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. - :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool - :raises ~azure.core.exceptions.HttpResponseError: - """ + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _start_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1984,12 +2175,11 @@ def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_pools_get_request( + _request = build_horizon_db_clusters_start_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2001,19 +2191,18 @@ def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwa _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True 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: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -2021,150 +2210,226 @@ def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwa ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbPool, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.HorizonDbPool"]: - """Lists all HorizonDb pools in a cluster. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_start(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts a stopped HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :return: An iterator like instance of HorizonDbPool - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _stop_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_pools_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - return _request + _request = build_horizon_db_clusters_stop_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbPool], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) -class HorizonDbReplicasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - Instead, you should access the following operations through - :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s - :attr:`horizon_db_replicas` attribute. - """ + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return deserialized # type: ignore @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any - ) -> _models.HorizonDbReplica: - """Gets information about a HorizonDb replica. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_stop(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops a running HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping - :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _restart_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2176,13 +2441,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_get_request( + _request = build_horizon_db_clusters_restart_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, - replica_name=replica_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2194,19 +2457,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True 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: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -2214,39 +2476,195 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.HorizonDbReplica, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbReplica"]: - """Lists all HorizonDb replicas in a pool. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_restart(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Restarts a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. - :type pool_name: str - :return: An iterator like instance of HorizonDbReplica - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class HorizonDbPoolsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`horizon_db_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any) -> _models.HorizonDbPool: + """Gets information about a HorizonDB pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :return: HorizonDbPool. The HorizonDbPool is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.HorizonDbPool] = kwargs.pop("cls", None) + + _request = build_horizon_db_pools_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbPool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.HorizonDbPool"]: + """Lists all HorizonDB pools in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of HorizonDbPool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbPool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2257,10 +2675,9 @@ def list( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_replicas_list_request( + _request = build_horizon_db_pools_list_request( resource_group_name=resource_group_name, cluster_name=cluster_name, - pool_name=pool_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -2284,7 +2701,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2298,7 +2718,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbReplica], + List[_models.HorizonDbPool], deserialized.get("value", []), ) if cls: @@ -2326,15 +2746,43 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: Union[_models.HorizonDbReplica, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + +class HorizonDbReplicasOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`horizon_db_replicas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any + ) -> _models.HorizonDbReplica: + """Gets information about a HorizonDB replica. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :return: HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbReplica + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2343,28 +2791,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.HorizonDbReplica] = kwargs.pop("cls", None) - _request = build_horizon_db_replicas_create_or_update_request( + _request = build_horizon_db_replicas_get_request( resource_group_name=resource_group_name, cluster_name=cluster_name, pool_name=pool_name, replica_name=replica_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -2374,18 +2812,19 @@ def _create_or_update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("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, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -2393,49 +2832,231 @@ def _create_or_update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbReplica, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - pool_name: str, - replica_name: str, - resource: _models.HorizonDbReplica, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.HorizonDbReplica"]: + """Lists all HorizonDB replicas in a pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. - :type replica_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is + :return: An iterator like instance of HorizonDbReplica + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbReplica] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbReplica]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_replicas_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbReplica], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_replicas_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + pool_name=pool_name, + replica_name=replica_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + pool_name: str, + replica_name: str, + resource: _models.HorizonDbReplica, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HorizonDbReplica]: + """Creates a new HorizonDB replica or updates an existing replica. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param pool_name: The name of the HorizonDB pool. Required. + :type pool_name: str + :param replica_name: The name of the HorizonDB replica. Required. + :type replica_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] :raises ~azure.core.exceptions.HttpResponseError: @@ -2448,24 +3069,24 @@ def begin_create_or_update( cluster_name: str, pool_name: str, replica_name: str, - resource: JSON, + resource: _types.HorizonDbReplica, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbReplica :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2487,16 +3108,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] @@ -2516,23 +3137,24 @@ def begin_create_or_update( cluster_name: str, pool_name: str, replica_name: str, - resource: Union[_models.HorizonDbReplica, JSON, IO[bytes]], + resource: Union[_models.HorizonDbReplica, _types.HorizonDbReplica, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Creates a new HorizonDb replica or updates an existing replica. + """Creates a new HorizonDB replica or updates an existing replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str - :param resource: Resource create parameters. Is one of the following types: HorizonDbReplica, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a HorizonDbReplica type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbReplica or + ~azure.mgmt.horizondb.types.HorizonDbReplica or IO[bytes] :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] @@ -2598,7 +3220,7 @@ def _update_initial( cluster_name: str, pool_name: str, replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2683,16 +3305,16 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). + """Updates an existing HorizonDB replica (e.g., role). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate @@ -2712,24 +3334,24 @@ def begin_update( cluster_name: str, pool_name: str, replica_name: str, - properties: JSON, + properties: _types.HorizonDbReplicaForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). + """Updates an existing HorizonDB replica (e.g., role). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2751,16 +3373,16 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). + """Updates an existing HorizonDB replica (e.g., role). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] @@ -2780,24 +3402,24 @@ def begin_update( cluster_name: str, pool_name: str, replica_name: str, - properties: Union[_models.HorizonDbReplicaForPatchUpdate, JSON, IO[bytes]], + properties: Union[_models.HorizonDbReplicaForPatchUpdate, _types.HorizonDbReplicaForPatchUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbReplica]: - """Updates an existing HorizonDb replica (e.g., role). + """Updates an existing HorizonDB replica (e.g., role). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbReplicaForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + HorizonDbReplicaForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbReplicaForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbReplicaForPatchUpdate or IO[bytes] :return: An instance of LROPoller that returns HorizonDbReplica. The HorizonDbReplica is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbReplica] @@ -2927,16 +3549,16 @@ def _delete_initial( def begin_delete( self, resource_group_name: str, cluster_name: str, pool_name: str, replica_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a HorizonDb replica. + """Deletes a HorizonDB replica. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param replica_name: The name of the HorizonDb replica. Required. + :param replica_name: The name of the HorizonDB replica. Required. :type replica_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] @@ -2989,7 +3611,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbFirewallRulesOperations: +class HorizonDbFirewallRulesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3010,16 +3632,16 @@ def __init__(self, *args, **kwargs) -> None: def get( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any ) -> _models.HorizonDbFirewallRule: - """Gets information about a HorizonDb firewall rule. + """Gets information about a HorizonDB firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str :return: HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping :rtype: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule @@ -3088,14 +3710,14 @@ def get( def list( self, resource_group_name: str, cluster_name: str, pool_name: str, **kwargs: Any ) -> ItemPaged["_models.HorizonDbFirewallRule"]: - """Lists all HorizonDb firewall rules in a pool. + """Lists all HorizonDB firewall rules in a pool. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str :return: An iterator like instance of HorizonDbFirewallRule :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] @@ -3144,7 +3766,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3192,7 +3817,7 @@ def _create_or_update_initial( cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, JSON, IO[bytes]], + resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3279,16 +3904,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule @@ -3308,24 +3933,24 @@ def begin_create_or_update( cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: JSON, + resource: _types.HorizonDbFirewallRule, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbFirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3347,16 +3972,16 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] @@ -3376,23 +4001,24 @@ def begin_create_or_update( cluster_name: str, pool_name: str, firewall_rule_name: str, - resource: Union[_models.HorizonDbFirewallRule, JSON, IO[bytes]], + resource: Union[_models.HorizonDbFirewallRule, _types.HorizonDbFirewallRule, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbFirewallRule]: - """Creates a new HorizonDb firewall rule or updates an existing rule. + """Creates a new HorizonDB firewall rule or updates an existing rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str - :param resource: Resource create parameters. Is one of the following types: - HorizonDbFirewallRule, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a HorizonDbFirewallRule type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbFirewallRule or + ~azure.mgmt.horizondb.types.HorizonDbFirewallRule or IO[bytes] :return: An instance of LROPoller that returns HorizonDbFirewallRule. The HorizonDbFirewallRule is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbFirewallRule] @@ -3522,16 +4148,16 @@ def _delete_initial( def begin_delete( self, resource_group_name: str, cluster_name: str, pool_name: str, firewall_rule_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a HorizonDb firewall rule. + """Deletes a HorizonDB firewall rule. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str - :param pool_name: The name of the HorizonDb pool. Required. + :param pool_name: The name of the HorizonDB pool. Required. :type pool_name: str - :param firewall_rule_name: The name of the HorizonDb firewall rule. Required. + :param firewall_rule_name: The name of the HorizonDB firewall rule. Required. :type firewall_rule_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] @@ -3584,7 +4210,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long +class HorizonDbPrivateEndpointConnectionsOperations: # pylint: disable=docstring-missing-param,name-too-long """ .. warning:: **DO NOT** instantiate this class directly. @@ -3610,7 +4236,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. @@ -3682,12 +4308,12 @@ def get( def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> ItemPaged["_models.PrivateEndpointConnectionResource"]: - """Lists private endpoint connections in a HorizonDb cluster. + """Lists private endpoint connections in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: An iterator like instance of PrivateEndpointConnectionResource :rtype: @@ -3736,7 +4362,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3778,247 +4407,215 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - def _update_initial( + @overload + def update_status( self, resource_group_name: str, + cluster_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + resource: _models.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. Required. + :type private_endpoint_connection_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource + :raises ~azure.core.exceptions.HttpResponseError: + """ - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_horizon_db_private_endpoint_connections_update_request( - resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - private_endpoint_connection_name: str, - properties: _models.PrivateEndpointConnectionUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - private_endpoint_connection_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + @overload + def update_status( + self, + resource_group_name: str, + cluster_name: str, + private_endpoint_connection_name: str, + resource: _types.PrivateEndpointConnectionResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def update_status( self, resource_group_name: str, + cluster_name: str, private_endpoint_connection_name: str, - properties: IO[bytes], + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update( + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "private_endpoint_connection_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def update_status( self, resource_group_name: str, + cluster_name: str, private_endpoint_connection_name: str, - properties: Union[_models.PrivateEndpointConnectionUpdate, JSON, IO[bytes]], + resource: Union[_models.PrivateEndpointConnectionResource, _types.PrivateEndpointConnectionResource, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Updates a private endpoint connection. + ) -> _models.PrivateEndpointConnectionResource: + """Approves or rejects a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PrivateEndpointConnectionUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionUpdate or JSON or - IO[bytes] - :return: An instance of LROPoller that returns PrivateEndpointConnection. The - PrivateEndpointConnection is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.PrivateEndpointConnection] + :param resource: Resource create parameters. Is either a PrivateEndpointConnectionResource type + or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource or + ~azure.mgmt.horizondb.types.PrivateEndpointConnectionResource or IO[bytes] + :return: PrivateEndpointConnectionResource. The PrivateEndpointConnectionResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + 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[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - private_endpoint_connection_name=private_endpoint_connection_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_horizon_db_private_endpoint_connections_update_status_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.PrivateEndpointConnectionResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore def _delete_initial( - self, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4035,6 +4632,7 @@ def _delete_initial( _request = build_horizon_db_private_endpoint_connections_delete_request( resource_group_name=resource_group_name, + cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, @@ -4083,13 +4681,15 @@ def _delete_initial( @distributed_trace def begin_delete( - self, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any + self, resource_group_name: str, cluster_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: """Deletes a private endpoint connection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str :param private_endpoint_connection_name: The name of the private endpoint connection associated with the Azure resource. Required. :type private_endpoint_connection_name: str @@ -4107,6 +4707,7 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, + cluster_name=cluster_name, private_endpoint_connection_name=private_endpoint_connection_name, cls=lambda x, y, z: x, headers=_headers, @@ -4142,7 +4743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class HorizonDbPrivateLinkResourcesOperations: +class HorizonDbPrivateLinkResourcesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4168,7 +4769,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :param group_name: The name of the private link resource. Required. :type group_name: str @@ -4239,12 +4840,12 @@ def get( def list( self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> ItemPaged["_models.HorizonDbPrivateLinkResource"]: - """Lists private link resources in a HorizonDb cluster. + """Lists private link resources in a HorizonDB cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param cluster_name: The name of the HorizonDb cluster. Required. + :param cluster_name: The name of the HorizonDB cluster. Required. :type cluster_name: str :return: An iterator like instance of HorizonDbPrivateLinkResource :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbPrivateLinkResource] @@ -4292,7 +4893,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4335,7 +4939,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class HorizonDbParameterGroupsOperations: +class HorizonDbParameterGroupsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4356,12 +4960,12 @@ def __init__(self, *args, **kwargs) -> None: def get( self, resource_group_name: str, parameter_group_name: str, **kwargs: Any ) -> _models.HorizonDbParameterGroup: - """Gets information about a HorizonDb parameter group. + """Gets information about a HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :return: HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping :rtype: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup @@ -4428,7 +5032,7 @@ def _create_or_update_initial( self, resource_group_name: str, parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, JSON, IO[bytes]], + resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4511,12 +5115,12 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param resource: Resource create parameters. Required. :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup @@ -4534,20 +5138,20 @@ def begin_create_or_update( self, resource_group_name: str, parameter_group_name: str, - resource: JSON, + resource: _types.HorizonDbParameterGroup, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.horizondb.types.HorizonDbParameterGroup :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4567,12 +5171,12 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] @@ -4590,19 +5194,20 @@ def begin_create_or_update( self, resource_group_name: str, parameter_group_name: str, - resource: Union[_models.HorizonDbParameterGroup, JSON, IO[bytes]], + resource: Union[_models.HorizonDbParameterGroup, _types.HorizonDbParameterGroup, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Creates a new HorizonDb parameter group or updates an existing parameter group. + """Creates a new HorizonDB parameter group or updates an existing parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :param resource: Resource create parameters. Is one of the following types: - HorizonDbParameterGroup, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a HorizonDbParameterGroup type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbParameterGroup or + ~azure.mgmt.horizondb.types.HorizonDbParameterGroup or IO[bytes] :return: An instance of LROPoller that returns HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] @@ -4664,7 +5269,9 @@ def _update_initial( self, resource_group_name: str, parameter_group_name: str, - properties: Union[_models.HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes]], + properties: Union[ + _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4745,12 +5352,12 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Updates an existing HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Required. :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate @@ -4768,20 +5375,20 @@ def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: JSON, + properties: _types.HorizonDbParameterGroupForPatchUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Updates an existing HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4801,12 +5408,12 @@ def begin_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Updates an existing HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] @@ -4824,20 +5431,22 @@ def begin_update( self, resource_group_name: str, parameter_group_name: str, - properties: Union[_models.HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes]], + properties: Union[ + _models.HorizonDbParameterGroupForPatchUpdate, _types.HorizonDbParameterGroupForPatchUpdate, IO[bytes] + ], **kwargs: Any ) -> LROPoller[_models.HorizonDbParameterGroup]: - """Updates an existing HorizonDb parameter group. + """Updates an existing HorizonDB parameter group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. + :param parameter_group_name: The name of the HorizonDB parameter group. Required. :type parameter_group_name: str - :param properties: The resource properties to be updated. Is one of the following types: - HorizonDbParameterGroupForPatchUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + HorizonDbParameterGroupForPatchUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.horizondb.models.HorizonDbParameterGroupForPatchUpdate or + ~azure.mgmt.horizondb.types.HorizonDbParameterGroupForPatchUpdate or IO[bytes] :return: An instance of LROPoller that returns HorizonDbParameterGroup. The HorizonDbParameterGroup is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] @@ -4891,11 +5500,659 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.HorizonDbParameterGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[_models.HorizonDbParameterGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_horizon_db_parameter_groups_delete_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + 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 [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a HorizonDB parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.HorizonDbParameterGroup"]: + """Lists all HorizonDB parameter groups in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbParameterGroup"]: + """Lists all HorizonDB parameter groups in a subscription. + + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_connections( + self, resource_group_name: str, parameter_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: + """Gets all connections to a parameter group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_connections_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroupConnectionProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_versions( + self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.HorizonDbParameterGroup"]: + """Lists parameter groups filtered by version number. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param parameter_group_name: The name of the HorizonDB parameter group. Required. + :type parameter_group_name: str + :keyword version: The version number to filter by. Default value is None. + :paramtype version: int + :return: An iterator like instance of HorizonDbParameterGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_horizon_db_parameter_groups_list_versions_request( + resource_group_name=resource_group_name, + parameter_group_name=parameter_group_name, + subscription_id=self._config.subscription_id, + version=version, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.HorizonDbParameterGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class HorizonDbAdministratorsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.horizondb.HorizonDBMgmtClient`'s + :attr:`horizon_db_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HorizonDBMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def get( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> _models.HorizonDbAdministrator: + """Gets information about a HorizonDB administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :return: HorizonDbAdministrator. The HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.mgmt.horizondb.models.HorizonDbAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) + + _request = build_horizon_db_administrators_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("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: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def _delete_initial(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> Iterator[bytes]: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4904,16 +6161,27 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) 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[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_horizon_db_parameter_groups_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_horizon_db_administrators_create_or_update_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + object_id=object_id, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -4930,7 +6198,7 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4943,11 +6211,10 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: + if response.status_code == 201: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -4957,30 +6224,156 @@ def _delete_initial(self, resource_group_name: str, parameter_group_name: str, * return deserialized # type: ignore + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _models.HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: _types.HorizonDbAdministratorAdd, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of LROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace - def begin_delete(self, resource_group_name: str, parameter_group_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a HorizonDb parameter group. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "cluster_name", + "object_id", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + object_id: str, + resource: Union[_models.HorizonDbAdministratorAdd, _types.HorizonDbAdministratorAdd, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.HorizonDbAdministrator]: + """Creates a new HorizonDB administrator or updates an existing administrator. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :param resource: Resource create parameters. Is either a HorizonDbAdministratorAdd type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.horizondb.models.HorizonDbAdministratorAdd or + ~azure.mgmt.horizondb.types.HorizonDbAdministratorAdd or IO[bytes] + :return: An instance of LROPoller that returns HorizonDbAdministrator. The + HorizonDbAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.horizondb.models.HorizonDbAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.HorizonDbAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, + object_id=object_id, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4989,140 +6382,46 @@ def begin_delete(self, resource_group_name: str, parameter_group_name: str, **kw raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.HorizonDbAdministrator, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDb parameter groups in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_parameter_groups_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists all HorizonDb parameter groups in a subscription. - - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.HorizonDbAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.HorizonDbAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def _delete_initial( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5131,196 +6430,155 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.HorizonDbPar } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_horizon_db_parameter_groups_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _request = build_horizon_db_administrators_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - return _request + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + response = pipeline_response.http_response - def get_next(next_link=None): - _request = prepare_request(next_link) + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") ) - response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + deserialized = response.iter_bytes() if _decompress else response.iter_raw() - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @distributed_trace - def list_connections( - self, resource_group_name: str, parameter_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroupConnectionProperties"]: - """Gets all connections to a parameter group. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "object_id"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def begin_delete( + self, resource_group_name: str, cluster_name: str, object_id: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a HorizonDB administrator. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :return: An iterator like instance of HorizonDbParameterGroupConnectionProperties - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroupConnectionProperties] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :param object_id: The Entra ID object identifier of the principal (an RFC 4122 GUID). Required. + :type object_id: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroupConnectionProperties]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_horizon_db_parameter_groups_list_connections_request( - resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroupConnectionProperties], - deserialized.get("value", []), + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + object_id=object_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + return cls(pipeline_response, None, {}) # type: ignore - def get_next(next_link=None): - _request = prepare_request(next_link) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def list_versions( - self, resource_group_name: str, parameter_group_name: str, *, version: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.HorizonDbParameterGroup"]: - """Lists parameter groups filtered by version number. + @api_version_validation( + method_added_on="2026-05-01-preview", + params_added_on={ + "2026-05-01-preview": ["api_version", "subscription_id", "resource_group_name", "cluster_name", "accept"] + }, + api_versions_list=["2026-05-01-preview"], + ) + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.HorizonDbAdministrator"]: + """Lists all HorizonDB administrators in a cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param parameter_group_name: The name of the HorizonDb parameter group. Required. - :type parameter_group_name: str - :keyword version: The version number to filter by. Default value is None. - :paramtype version: int - :return: An iterator like instance of HorizonDbParameterGroup - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbParameterGroup] + :param cluster_name: The name of the HorizonDB cluster. Required. + :type cluster_name: str + :return: An iterator like instance of HorizonDbAdministrator + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.horizondb.models.HorizonDbAdministrator] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.HorizonDbParameterGroup]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.HorizonDbAdministrator]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5333,11 +6591,10 @@ def list_versions( def prepare_request(next_link=None): if not next_link: - _request = build_horizon_db_parameter_groups_list_versions_request( + _request = build_horizon_db_administrators_list_request( resource_group_name=resource_group_name, - parameter_group_name=parameter_group_name, + cluster_name=cluster_name, subscription_id=self._config.subscription_id, - version=version, api_version=self._config.api_version, headers=_headers, params=_params, @@ -5360,7 +6617,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5374,7 +6634,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.HorizonDbParameterGroup], + List[_models.HorizonDbAdministrator], deserialized.get("value", []), ) if cls: diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_patch.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_patch.py +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py new file mode 100644 index 000000000000..5e333ef4bd38 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/azure/mgmt/horizondb/types.py @@ -0,0 +1,833 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + AuthenticationState, + CreateModeCluster, + CreatedByType, + HorizonDbComputeModelType, + ManagedServiceIdentityType, + PrincipalTypes, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccessState, + ReplicaRole, + State, + ZonePlacementPolicy, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class HorizonDbAdministratorAdd(TypedDict, total=False): + """The request body for adding a HorizonDB administrator. + + :ivar properties: The properties for adding a HorizonDB administrator. Required. + :vartype properties: "HorizonDbAdministratorPropertiesForAdd" + """ + + properties: Required["HorizonDbAdministratorPropertiesForAdd"] + """The properties for adding a HorizonDB administrator. Required.""" + + +class HorizonDbAdministratorPropertiesForAdd(TypedDict, total=False): + """The properties for adding a HorizonDB administrator. + + :ivar principalName: The display name or UPN of the Entra ID principal. For users, typically + the User Principal Name (e.g., `admin@contoso.com `_). For groups, + the group display name. For service principals, the application display name. Required. + :vartype principalName: str + :ivar principalType: The type of the Entra ID principal. Required. Known values are: "Unknown", + "User", "Group", and "ServicePrincipal". + :vartype principalType: Union[str, "PrincipalTypes"] + :ivar tenantId: The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the + tenant of the subscription. + :vartype tenantId: str + """ + + principalName: Required[str] + """The display name or UPN of the Entra ID principal. For users, typically the User Principal Name + (e.g., `admin@contoso.com `_). For groups, the group display name. + For service principals, the application display name. Required.""" + principalType: Required[Union[str, "PrincipalTypes"]] + """The type of the Entra ID principal. Required. Known values are: \"Unknown\", \"User\", + \"Group\", and \"ServicePrincipal\".""" + tenantId: str + """The Entra ID tenant identifier (an RFC 4122 GUID). If omitted, defaults to the tenant of the + subscription.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class HorizonDbCluster(TrackedResource): + """Represents the HorizonDB cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "HorizonDbClusterProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "HorizonDbClusterProperties" + """The resource-specific properties for this resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class HorizonDbClusterAuthConfig(TypedDict, total=False): + """Authentication configuration for a HorizonDB cluster. + + :ivar entraIdAuth: Indicates whether Microsoft Entra ID authentication is enabled or disabled. + Known values are: "Enabled" and "Disabled". + :vartype entraIdAuth: Union[str, "AuthenticationState"] + :ivar tenantId: The Microsoft Entra tenant ID. + :vartype tenantId: str + :ivar passwordAuth: Indicates whether password authentication is enabled or disabled. Known + values are: "Enabled" and "Disabled". + :vartype passwordAuth: Union[str, "AuthenticationState"] + """ + + entraIdAuth: Union[str, "AuthenticationState"] + """Indicates whether Microsoft Entra ID authentication is enabled or disabled. Known values are: + \"Enabled\" and \"Disabled\".""" + tenantId: str + """The Microsoft Entra tenant ID.""" + passwordAuth: Union[str, "AuthenticationState"] + """Indicates whether password authentication is enabled or disabled. Known values are: \"Enabled\" + and \"Disabled\".""" + + +class HorizonDbClusterForPatchUpdate(TypedDict, total=False): + """HorizonDB cluster for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar properties: The properties that can be updated for a HorizonDB cluster. + :vartype properties: "HorizonDbClusterPropertiesForPatchUpdate" + """ + + tags: dict[str, str] + """Resource tags.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + properties: "HorizonDbClusterPropertiesForPatchUpdate" + """The properties that can be updated for a HorizonDB cluster.""" + + +class HorizonDbClusterMirroring(TypedDict, total=False): + """Mirroring configuration for a HorizonDB cluster. + + :ivar databaseNames: The names of the databases to mirror. + :vartype databaseNames: list[str] + :ivar userAssignedIdentityId: The resource ID of the user-assigned managed identity used for + mirroring. + :vartype userAssignedIdentityId: str + """ + + databaseNames: list[str] + """The names of the databases to mirror.""" + userAssignedIdentityId: str + """The resource ID of the user-assigned managed identity used for mirroring.""" + + +class HorizonDbClusterParameterGroupConnectionProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Connection information for HorizonDB parameter group. + + :ivar id: The resource ID of the connected parameter group. + :vartype id: str + :ivar syncStatus: Indication of if parameter group is applied on HorizonDB resource. + :vartype syncStatus: str + :ivar applyImmediately: Indicates whether the parameters should be applied immediately. + :vartype applyImmediately: bool + """ + + id: str + """The resource ID of the connected parameter group.""" + syncStatus: str + """Indication of if parameter group is applied on HorizonDB resource.""" + applyImmediately: bool + """Indicates whether the parameters should be applied immediately.""" + + +class HorizonDbClusterProperties(TypedDict, total=False): + """Properties of a HorizonDB cluster. + + :ivar administratorLogin: The administrator login name. Required. + :vartype administratorLogin: str + :ivar administratorLoginPassword: The administrator login password. + :vartype administratorLoginPassword: str + :ivar version: The version of the HorizonDB cluster. + :vartype version: str + :ivar createMode: The mode to create a new HorizonDB cluster. Known values are: "Create", + "Update", and "PointInTimeRestore". + :vartype createMode: Union[str, "CreateModeCluster"] + :ivar pointInTimeUTC: Restore point creation time specifying the time to restore from. + :vartype pointInTimeUTC: str + :ivar sourceClusterResourceId: The source cluster resource ID for restore or replica creation. + :vartype sourceClusterResourceId: str + :ivar poolName: The pool name for restore or replica operations. + :vartype poolName: str + :ivar replicaCount: Number of replicas. + :vartype replicaCount: int + :ivar vCores: Number of vCores. + :vartype vCores: int + :ivar processorType: The processor type for the HorizonDB cluster. + :vartype processorType: str + :ivar network: The network related info. + :vartype network: "Network" + :ivar state: Current state of the cluster. Known values are: "Ready", "Dropping", "Disabled", + "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". + :vartype state: Union[str, "State"] + :ivar fullyQualifiedDomainName: The fully qualified domain name of the cluster. + :vartype fullyQualifiedDomainName: str + :ivar readonlyEndpoint: The fully qualified domain name used for readonly endpoint for the + cluster. + :vartype readonlyEndpoint: str + :ivar provisioningState: The provisioning state of the cluster. Known values are: "Succeeded", + "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar zonePlacementPolicy: Defines how replicas are placed across availability zones. Known + values are: "Strict" and "BestEffort". + :vartype zonePlacementPolicy: Union[str, "ZonePlacementPolicy"] + :ivar parameterGroup: Defines connection to a parameter group. + :vartype parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" + :ivar authConfig: Authentication configuration for the HorizonDB cluster. + :vartype authConfig: "HorizonDbClusterAuthConfig" + :ivar computeModel: The compute model for the cluster. + :vartype computeModel: "HorizonDbComputeModel" + :ivar mirroring: Mirroring configuration for the HorizonDB cluster. + :vartype mirroring: "HorizonDbClusterMirroring" + """ + + administratorLogin: Required[str] + """The administrator login name. Required.""" + administratorLoginPassword: str + """The administrator login password.""" + version: str + """The version of the HorizonDB cluster.""" + createMode: Union[str, "CreateModeCluster"] + """The mode to create a new HorizonDB cluster. Known values are: \"Create\", \"Update\", and + \"PointInTimeRestore\".""" + pointInTimeUTC: str + """Restore point creation time specifying the time to restore from.""" + sourceClusterResourceId: str + """The source cluster resource ID for restore or replica creation.""" + poolName: str + """The pool name for restore or replica operations.""" + replicaCount: int + """Number of replicas.""" + vCores: int + """Number of vCores.""" + processorType: str + """The processor type for the HorizonDB cluster.""" + network: "Network" + """The network related info.""" + state: Union[str, "State"] + """Current state of the cluster. Known values are: \"Ready\", \"Dropping\", \"Disabled\", + \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and + \"Upgrading\".""" + fullyQualifiedDomainName: str + """The fully qualified domain name of the cluster.""" + readonlyEndpoint: str + """The fully qualified domain name used for readonly endpoint for the cluster.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the cluster. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + zonePlacementPolicy: Union[str, "ZonePlacementPolicy"] + """Defines how replicas are placed across availability zones. Known values are: \"Strict\" and + \"BestEffort\".""" + parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" + """Defines connection to a parameter group.""" + authConfig: "HorizonDbClusterAuthConfig" + """Authentication configuration for the HorizonDB cluster.""" + computeModel: "HorizonDbComputeModel" + """The compute model for the cluster.""" + mirroring: "HorizonDbClusterMirroring" + """Mirroring configuration for the HorizonDB cluster.""" + + +class HorizonDbClusterPropertiesForPatchUpdate(TypedDict, total=False): + """Properties of a HorizonDB cluster for update operations. + + :ivar administratorLoginPassword: The administrator login password. + :vartype administratorLoginPassword: str + :ivar vCores: Number of vCores. + :vartype vCores: int + :ivar parameterGroup: Defines connection to a parameter group. + :vartype parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" + :ivar authConfig: Authentication configuration for the HorizonDB cluster. + :vartype authConfig: "HorizonDbClusterAuthConfig" + :ivar computeModel: The compute model for the cluster. + :vartype computeModel: "HorizonDbComputeModel" + :ivar mirroring: Mirroring configuration for the HorizonDB cluster. + :vartype mirroring: "HorizonDbClusterMirroring" + """ + + administratorLoginPassword: str + """The administrator login password.""" + vCores: int + """Number of vCores.""" + parameterGroup: "HorizonDbClusterParameterGroupConnectionProperties" + """Defines connection to a parameter group.""" + authConfig: "HorizonDbClusterAuthConfig" + """Authentication configuration for the HorizonDB cluster.""" + computeModel: "HorizonDbComputeModel" + """The compute model for the cluster.""" + mirroring: "HorizonDbClusterMirroring" + """Mirroring configuration for the HorizonDB cluster.""" + + +class HorizonDbComputeModel(TypedDict, total=False): + """The compute model for a HorizonDB cluster. + + :ivar type: The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values + are: "Provisioned" and "Serverless". + :vartype type: Union[str, "HorizonDbComputeModelType"] + :ivar vCores: The fixed vCore count for Provisioned compute. + :vartype vCores: int + :ivar minvCores: The minimum vCores for Serverless compute. Defines the lower autoscaling + bound. + :vartype minvCores: float + :ivar maxvCores: The maximum vCores for Serverless compute. Defines the upper autoscaling + bound. + :vartype maxvCores: float + """ + + type: Union[str, "HorizonDbComputeModelType"] + """The compute model type. Supported values: 'Provisioned', 'Serverless'. Known values are: + \"Provisioned\" and \"Serverless\".""" + vCores: int + """The fixed vCore count for Provisioned compute.""" + minvCores: float + """The minimum vCores for Serverless compute. Defines the lower autoscaling bound.""" + maxvCores: float + """The maximum vCores for Serverless compute. Defines the upper autoscaling bound.""" + + +class HorizonDbFirewallRule(ProxyResource): + """Represents the HorizonDB firewall rule. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "HorizonDbFirewallRuleProperties" + """ + + properties: "HorizonDbFirewallRuleProperties" + """The resource-specific properties for this resource.""" + + +class HorizonDbFirewallRuleProperties(TypedDict, total=False): + """Properties of a HorizonDB firewall rule. + + :ivar startIpAddress: The start IP address of the firewall rule (IPv4). Required. + :vartype startIpAddress: str + :ivar endIpAddress: The end IP address of the firewall rule (IPv4). Required. + :vartype endIpAddress: str + :ivar description: The description of the HorizonDB firewall rule. + :vartype description: str + :ivar provisioningState: The provisioning state of the firewall rule. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + startIpAddress: Required[str] + """The start IP address of the firewall rule (IPv4). Required.""" + endIpAddress: Required[str] + """The end IP address of the firewall rule (IPv4). Required.""" + description: str + """The description of the HorizonDB firewall rule.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the firewall rule. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class HorizonDbParameterGroup(TrackedResource): + """Represents the HorizonDB parameter group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "HorizonDbParameterGroupProperties" + """ + + properties: "HorizonDbParameterGroupProperties" + """The resource-specific properties for this resource.""" + + +class HorizonDbParameterGroupForPatchUpdate(TypedDict, total=False): + """HorizonDB parameter group for update operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The properties that can be updated for a HorizonDB parameter group. + :vartype properties: "HorizonDbParameterGroupPropertiesForPatchUpdate" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "HorizonDbParameterGroupPropertiesForPatchUpdate" + """The properties that can be updated for a HorizonDB parameter group.""" + + +class HorizonDbParameterGroupProperties(TypedDict, total=False): + """Properties of a HorizonDB parameter group. + + :ivar parameters: Parameters in the parameter group. + :vartype parameters: list["ParameterProperties"] + :ivar description: Description of the parameter group. + :vartype description: str + :ivar pgVersion: PostgreSQL version for the parameter group. + :vartype pgVersion: int + :ivar version: Current version of the parameter group. + :vartype version: int + :ivar applyImmediately: Indicates whether the parameters should be applied immediately. + :vartype applyImmediately: bool + :ivar provisioningState: The provisioning state of the parameter group. Known values are: + "Succeeded", "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + parameters: list["ParameterProperties"] + """Parameters in the parameter group.""" + description: str + """Description of the parameter group.""" + pgVersion: int + """PostgreSQL version for the parameter group.""" + version: int + """Current version of the parameter group.""" + applyImmediately: bool + """Indicates whether the parameters should be applied immediately.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the parameter group. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class HorizonDbParameterGroupPropertiesForPatchUpdate(TypedDict, total=False): # pylint: disable=name-too-long + """Properties of a HorizonDB parameter group for update operations. + + :ivar parameters: Parameters in the parameter group. + :vartype parameters: list["ParameterProperties"] + :ivar description: Description of the parameter group. + :vartype description: str + :ivar applyImmediately: Indicates whether the parameters should be applied immediately. + :vartype applyImmediately: bool + """ + + parameters: list["ParameterProperties"] + """Parameters in the parameter group.""" + description: str + """Description of the parameter group.""" + applyImmediately: bool + """Indicates whether the parameters should be applied immediately.""" + + +class HorizonDbReplica(ProxyResource): + """Represents the HorizonDB replica. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "HorizonDbReplicaProperties" + """ + + properties: "HorizonDbReplicaProperties" + """The resource-specific properties for this resource.""" + + +class HorizonDbReplicaForPatchUpdate(TypedDict, total=False): + """HorizonDB replica for update operations. + + :ivar properties: Properties of a HorizonDB replica for update operations. + :vartype properties: "HorizonDbReplicaPropertiesForPatchUpdate" + """ + + properties: "HorizonDbReplicaPropertiesForPatchUpdate" + """Properties of a HorizonDB replica for update operations.""" + + +class HorizonDbReplicaProperties(TypedDict, total=False): + """Properties of a HorizonDB replica. + + :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". + :vartype role: Union[str, "ReplicaRole"] + :ivar status: Current status of the replica. Known values are: "Ready", "Dropping", "Disabled", + "Starting", "Stopping", "Stopped", "Updating", "Healthy", "Succeeded", and "Upgrading". + :vartype status: Union[str, "State"] + :ivar fullyQualifiedDomainName: The fully qualified domain name of the replica. + :vartype fullyQualifiedDomainName: str + :ivar availabilityZone: The availability zone of the replica. + :vartype availabilityZone: str + :ivar provisioningState: The provisioning state of the replica. Known values are: "Succeeded", + "Failed", "Canceled", "InProgress", and "Provisioning". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + role: Union[str, "ReplicaRole"] + """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" + status: Union[str, "State"] + """Current status of the replica. Known values are: \"Ready\", \"Dropping\", \"Disabled\", + \"Starting\", \"Stopping\", \"Stopped\", \"Updating\", \"Healthy\", \"Succeeded\", and + \"Upgrading\".""" + fullyQualifiedDomainName: str + """The fully qualified domain name of the replica.""" + availabilityZone: str + """The availability zone of the replica.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the replica. Known values are: \"Succeeded\", \"Failed\", + \"Canceled\", \"InProgress\", and \"Provisioning\".""" + + +class HorizonDbReplicaPropertiesForPatchUpdate(TypedDict, total=False): + """Properties of a HorizonDB replica for update operations. + + :ivar role: Role of the replica. Known values are: "Read" and "ReadWrite". + :vartype role: Union[str, "ReplicaRole"] + """ + + role: Union[str, "ReplicaRole"] + """Role of the replica. Known values are: \"Read\" and \"ReadWrite\".""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class Network(TypedDict, total=False): + """Network properties. + + :ivar publicNetworkAccess: The flag indicating whether public ip is requested. Known values + are: "Enabled" and "Disabled". + :vartype publicNetworkAccess: Union[str, "PublicNetworkAccessState"] + """ + + publicNetworkAccess: Union[str, "PublicNetworkAccessState"] + """The flag indicating whether public ip is requested. Known values are: \"Enabled\" and + \"Disabled\".""" + + +class ParameterProperties(TypedDict, total=False): + """Properties of a HorizonDB parameters. + + :ivar name: The name of the parameter. + :vartype name: str + :ivar description: The description of the parameter. + :vartype description: str + :ivar value: The value of the configuration. + :vartype value: str + :ivar dataType: The data type of the parameter. + :vartype dataType: str + :ivar allowedValues: The allowed values for the parameter. + :vartype allowedValues: str + :ivar isDynamic: Whether the parameter can be changed dynamically. + :vartype isDynamic: bool + :ivar isReadOnly: Whether the parameter is a read-only parameter. + :vartype isReadOnly: bool + :ivar documentationLink: Link to parameter documentation. + :vartype documentationLink: str + :ivar unit: The unit of measurement for the parameter. + :vartype unit: str + """ + + name: str + """The name of the parameter.""" + description: str + """The description of the parameter.""" + value: str + """The value of the configuration.""" + dataType: str + """The data type of the parameter.""" + allowedValues: str + """The allowed values for the parameter.""" + isDynamic: bool + """Whether the parameter can be changed dynamically.""" + isReadOnly: bool + """Whether the parameter is a read-only parameter.""" + documentationLink: str + """Link to parameter documentation.""" + unit: str + """The unit of measurement for the parameter.""" + + +class PrivateEndpoint(TypedDict, total=False): + """The private endpoint resource. + + :ivar id: The resource identifier of the private endpoint. + :vartype id: str + """ + + id: str + """The resource identifier of the private endpoint.""" + + +class PrivateEndpointConnectionProperties(TypedDict, total=False): + """Properties of the private endpoint connection. + + :ivar groupIds: The group ids for the private endpoint resource. + :vartype groupIds: list[str] + :ivar privateEndpoint: The private endpoint resource. + :vartype privateEndpoint: "PrivateEndpoint" + :ivar privateLinkServiceConnectionState: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype privateLinkServiceConnectionState: "PrivateLinkServiceConnectionState" + :ivar provisioningState: The provisioning state of the private endpoint connection resource. + Known values are: "Succeeded", "Creating", "Deleting", and "Failed". + :vartype provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """ + + groupIds: list[str] + """The group ids for the private endpoint resource.""" + privateEndpoint: "PrivateEndpoint" + """The private endpoint resource.""" + privateLinkServiceConnectionState: Required["PrivateLinkServiceConnectionState"] + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + provisioningState: Union[str, "PrivateEndpointConnectionProvisioningState"] + """The provisioning state of the private endpoint connection resource. Known values are: + \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\".""" + + +class PrivateEndpointConnectionResource(Resource): + """A private endpoint connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The private endpoint connection properties. + :vartype properties: "PrivateEndpointConnectionProperties" + """ + + properties: "PrivateEndpointConnectionProperties" + """The private endpoint connection properties.""" + + +class PrivateLinkServiceConnectionState(TypedDict, total=False): + """A collection of information about the state of the connection between service consumer and + provider. + + :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Known values are: "Pending", "Approved", and "Rejected". + :vartype status: Union[str, "PrivateEndpointServiceConnectionStatus"] + :ivar description: The reason for approval/rejection of the connection. + :vartype description: str + :ivar actionsRequired: A message indicating if changes on the service provider require any + updates on the consumer. + :vartype actionsRequired: str + """ + + status: Union[str, "PrivateEndpointServiceConnectionStatus"] + """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + service. Known values are: \"Pending\", \"Approved\", and \"Rejected\".""" + description: str + """The reason for approval/rejection of the connection.""" + actionsRequired: str + """A message indicating if changes on the service provider require any updates on the consumer.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py new file mode 100644 index 000000000000..971bbd5b4cfc --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_create_or_update.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python administrators_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.horizon_db_administrators.begin_create_or_update( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + resource={ + "properties": { + "principalName": "admin@contoso.com", + "principalType": "User", + "tenantId": "11111111-2222-3333-4444-555555555555", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-05-01-preview/Administrators_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py new file mode 100644 index 000000000000..38d830acd81b --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python administrators_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.horizon_db_administrators.begin_delete( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + ).result() + + +# x-ms-original-file: 2026-05-01-preview/Administrators_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py new file mode 100644 index 000000000000..b9430274b0a2 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python administrators_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.horizon_db_administrators.get( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + object_id="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + ) + print(response) + + +# x-ms-original-file: 2026-05-01-preview/Administrators_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py new file mode 100644 index 000000000000..9ffbcb09dccb --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/administrators_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python administrators_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.horizon_db_administrators.list( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-05-01-preview/Administrators_List.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py index f3d7e3479016..0fb68dd1fad2 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_create_or_update.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,10 +40,9 @@ def main(): "administratorLoginPassword": "examplepassword", "createMode": "Create", "replicaCount": 2, - "sourceClusterResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/examplesourceresourcegroup/providers/Microsoft.HorizonDb/clusters/examplesourcecluster", "vCores": 4, "version": "17", - "zonePlacementPolicy": "Strict", + "zonePlacementPolicy": "BestEffort", }, "tags": {"env": "dev"}, }, @@ -52,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Clusters_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01-preview/Clusters_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py index 5294142d7d5b..a0e24ef52c71 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-20-preview/Clusters_Delete.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py index 16c1bd784086..8aa0d44252fe 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Clusters_Get.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py index 3c6b1c99f0c3..fec6ecf13d00 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/Clusters_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py index 36bdf62e952b..b8b88554fc66 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/Clusters_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/Clusters_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py new file mode 100644 index 000000000000..b69615adf97e --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_restart.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_restart.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.horizon_db_clusters.begin_restart( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + ).result() + + +# x-ms-original-file: 2026-05-01-preview/Clusters_Restart.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py new file mode 100644 index 000000000000..09c00699a763 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_start.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_start.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.horizon_db_clusters.begin_start( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + ).result() + + +# x-ms-original-file: 2026-05-01-preview/Clusters_Start.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py new file mode 100644 index 000000000000..6bb813d39f32 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_stop.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.horizondb import HorizonDBMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-horizondb +# USAGE + python clusters_stop.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HorizonDBMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.horizon_db_clusters.begin_stop( + resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", + ).result() + + +# x-ms-original-file: 2026-05-01-preview/Clusters_Stop.json +if __name__ == "__main__": + main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py index 474ad06f1e2c..a1e35348eef1 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/clusters_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Clusters_Update.json +# x-ms-original-file: 2026-05-01-preview/Clusters_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py index c2f83fef692e..dfac37be9145 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_create_or_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/FirewallRules_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01-preview/FirewallRules_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py index c03f1109f374..71d440fb3819 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-20-preview/FirewallRules_Delete.json +# x-ms-original-file: 2026-05-01-preview/FirewallRules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py index 2790e7b3b736..e701ee7c830f 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/FirewallRules_Get.json +# x-ms-original-file: 2026-05-01-preview/FirewallRules_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py index a712144b86f8..5d73afa432c3 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/firewall_rules_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/FirewallRules_List.json +# x-ms-original-file: 2026-05-01-preview/FirewallRules_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py index d990a73c676f..6a328524cf08 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/Operations_List.json +# x-ms-original-file: 2026-05-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py index eb1b7c596528..24268cdd4f0b 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_create_or_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py index c437301336f8..9601df4a8742 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_Delete.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py index c4cd2debd0b9..01b2cb44862c 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_Get.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py index 6ebf8222d0ca..fe206fb5caa3 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListByResourceGroup.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py index 308c8344149b..2835974b2913 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListBySubscription.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py index b5f486ef5018..11e47d870a6c 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_connections.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListConnections.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListConnections.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py index fe2874c0676f..c26cfe913781 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_list_versions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_ListVersions.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_ListVersions.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py index 6368af28bd48..be3476e20ac7 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/parameter_groups_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/ParameterGroups_Update.json +# x-ms-original-file: 2026-05-01-preview/ParameterGroups_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py index 328067a9f63d..0fdafd072871 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Pools_Get.json +# x-ms-original-file: 2026-05-01-preview/Pools_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py index 541592188075..6440cf0d2e9a 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/pools_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/Pools_List.json +# x-ms-original-file: 2026-05-01-preview/Pools_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py index 7e843de63d35..33ffe03f7ac4 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_delete.py @@ -32,10 +32,11 @@ def main(): client.horizon_db_private_endpoint_connections.begin_delete( resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", private_endpoint_connection_name="exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", ).result() -# x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Delete.json +# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py index 9a9208728f6f..1cd057096062 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Get.json +# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py index c998ac0515d0..181e75bef40e 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_List.json +# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py similarity index 85% rename from sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update.py rename to sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py index 01e55741c2ca..5833fe078f02 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_endpoint_connections_update_status.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-horizondb # USAGE - python private_endpoint_connections_update.py + python private_endpoint_connections_update_status.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,10 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.horizon_db_private_endpoint_connections.begin_update( + response = client.horizon_db_private_endpoint_connections.update_status( resource_group_name="exampleresourcegroup", + cluster_name="examplecluster", private_endpoint_connection_name="exampleprivateendpointconnection.1fa229cd-bf3f-47f0-8c49-afb36723997e", - properties={ + resource={ "properties": { "privateLinkServiceConnectionState": { "description": "Approved by `johndoe@contoso.com `_", @@ -41,10 +42,10 @@ def main(): } } }, - ).result() + ) print(response) -# x-ms-original-file: 2026-01-20-preview/PrivateEndpointConnections_Update.json +# x-ms-original-file: 2026-05-01-preview/PrivateEndpointConnections_UpdateStatus.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py index c6092ba18ac0..fac5fab62a7f 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_Get.json +# x-ms-original-file: 2026-05-01-preview/PrivateLinkResources_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py index 42d7b549d75a..92e49b4efa92 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/private_link_resources_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/PrivateLinkResources_List.json +# x-ms-original-file: 2026-05-01-preview/PrivateLinkResources_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py index 68f520f1152c..11f08272495b 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_create_or_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Replicas_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01-preview/Replicas_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py index 0fb86fcf8ff4..a1d306429237 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-01-20-preview/Replicas_Delete.json +# x-ms-original-file: 2026-05-01-preview/Replicas_Delete.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py index f3727e06490d..b82378afe31c 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Replicas_Get.json +# x-ms-original-file: 2026-05-01-preview/Replicas_Get.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py index adf97f50271d..68258f051f96 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-01-20-preview/Replicas_List.json +# x-ms-original-file: 2026-05-01-preview/Replicas_List.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py index 1de6fb7ffe3f..a3686156a0e6 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_samples/replicas_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2026-01-20-preview/Replicas_Update.json +# x-ms-original-file: 2026-05-01-preview/Replicas_Update.json if __name__ == "__main__": main() diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py new file mode 100644 index 000000000000..d715fb907bd5 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtHorizonDbAdministratorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_administrators_get(self, resource_group): + response = self.client.horizon_db_administrators.get( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_administrators_begin_create_or_update(self, resource_group): + response = self.client.horizon_db_administrators.begin_create_or_update( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + resource={"properties": {"principalName": "str", "principalType": "str", "tenantId": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_administrators_begin_delete(self, resource_group): + response = self.client.horizon_db_administrators.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_administrators_list(self, resource_group): + response = self.client.horizon_db_administrators.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py new file mode 100644 index 000000000000..ef79dd286594 --- /dev/null +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_administrators_operations_async.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.horizondb.aio import HorizonDBMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHorizonDBMgmtHorizonDbAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HorizonDBMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_administrators_get(self, resource_group): + response = await self.client.horizon_db_administrators.get( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_administrators_begin_create_or_update(self, resource_group): + response = await ( + await self.client.horizon_db_administrators.begin_create_or_update( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + resource={"properties": {"principalName": "str", "principalType": "str", "tenantId": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_administrators_begin_delete(self, resource_group): + response = await ( + await self.client.horizon_db_administrators.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + object_id="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_administrators_list(self, resource_group): + response = self.client.horizon_db_administrators.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py index 1d81be24fdb2..27d08a587f33 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations.py @@ -38,12 +38,21 @@ def test_horizon_db_clusters_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", + "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, + "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, "createMode": "str", "fullyQualifiedDomainName": "str", + "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, "network": {"publicNetworkAccess": "str"}, "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, "pointInTimeUTC": "2020-02-20 00:00:00", @@ -81,8 +90,17 @@ def test_horizon_db_clusters_begin_update(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "administratorLoginPassword": "str", + "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, + "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, + "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, "vCores": 0, }, @@ -121,3 +139,36 @@ def test_horizon_db_clusters_list_by_subscription(self, resource_group): result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_clusters_begin_start(self, resource_group): + response = self.client.horizon_db_clusters.begin_start( + resource_group_name=resource_group.name, + cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_clusters_begin_stop(self, resource_group): + response = self.client.horizon_db_clusters.begin_stop( + resource_group_name=resource_group.name, + cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_horizon_db_clusters_begin_restart(self, resource_group): + response = self.client.horizon_db_clusters.begin_restart( + resource_group_name=resource_group.name, + cluster_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py index aa682c1d88f1..d12cd2a60160 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_clusters_operations_async.py @@ -40,12 +40,21 @@ async def test_horizon_db_clusters_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", + "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, + "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, "createMode": "str", "fullyQualifiedDomainName": "str", + "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, "network": {"publicNetworkAccess": "str"}, "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, "pointInTimeUTC": "2020-02-20 00:00:00", @@ -85,8 +94,17 @@ async def test_horizon_db_clusters_begin_update(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { "administratorLoginPassword": "str", + "authConfig": {"entraIdAuth": "str", "passwordAuth": "str", "tenantId": "str"}, + "computeModel": {"maxvCores": 0.0, "minvCores": 0.0, "type": "str", "vCores": 0}, + "mirroring": {"databaseNames": ["str"], "userAssignedIdentityId": "str"}, "parameterGroup": {"applyImmediately": bool, "id": "str", "syncStatus": "str"}, "vCores": 0, }, @@ -128,3 +146,42 @@ async def test_horizon_db_clusters_list_by_subscription(self, resource_group): result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_clusters_begin_start(self, resource_group): + response = await ( + await self.client.horizon_db_clusters.begin_start( + resource_group_name=resource_group.name, + cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_clusters_begin_stop(self, resource_group): + response = await ( + await self.client.horizon_db_clusters.begin_stop( + resource_group_name=resource_group.name, + cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_horizon_db_clusters_begin_restart(self, resource_group): + response = await ( + await self.client.horizon_db_clusters.begin_restart( + resource_group_name=resource_group.name, + cluster_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py index b8a133a94434..1d94d6e90f14 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations.py @@ -43,21 +43,35 @@ def test_horizon_db_private_endpoint_connections_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_horizon_db_private_endpoint_connections_begin_update(self, resource_group): - response = self.client.horizon_db_private_endpoint_connections.begin_update( + def test_horizon_db_private_endpoint_connections_update_status(self, resource_group): + response = self.client.horizon_db_private_endpoint_connections.update_status( resource_group_name=resource_group.name, + cluster_name="str", private_endpoint_connection_name="str", - properties={ + resource={ + "id": "str", + "name": "str", "properties": { - "privateEndpoint": {"id": "str"}, "privateLinkServiceConnectionState": { "actionsRequired": "str", "description": "str", "status": "str", }, - } + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", }, - ).result() # call '.result()' to poll until service return final result + ) # please add some check logic here by yourself # ... @@ -67,6 +81,7 @@ def test_horizon_db_private_endpoint_connections_begin_update(self, resource_gro def test_horizon_db_private_endpoint_connections_begin_delete(self, resource_group): response = self.client.horizon_db_private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, + cluster_name="str", private_endpoint_connection_name="str", ).result() # call '.result()' to poll until service return final result diff --git a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py index 00c736eb134e..3147d90fd6cd 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py +++ b/sdk/horizondb/azure-mgmt-horizondb/generated_tests/test_horizon_db_mgmt_horizon_db_private_endpoint_connections_operations_async.py @@ -44,23 +44,35 @@ async def test_horizon_db_private_endpoint_connections_list(self, resource_group @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_horizon_db_private_endpoint_connections_begin_update(self, resource_group): - response = await ( - await self.client.horizon_db_private_endpoint_connections.begin_update( - resource_group_name=resource_group.name, - private_endpoint_connection_name="str", - properties={ - "properties": { - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", - }, - } + async def test_horizon_db_private_endpoint_connections_update_status(self, resource_group): + response = await self.client.horizon_db_private_endpoint_connections.update_status( + resource_group_name=resource_group.name, + cluster_name="str", + private_endpoint_connection_name="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "privateLinkServiceConnectionState": { + "actionsRequired": "str", + "description": "str", + "status": "str", + }, + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "provisioningState": "str", }, - ) - ).result() # call '.result()' to poll until service return final result + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) # please add some check logic here by yourself # ... @@ -71,6 +83,7 @@ async def test_horizon_db_private_endpoint_connections_begin_delete(self, resour response = await ( await self.client.horizon_db_private_endpoint_connections.begin_delete( resource_group_name=resource_group.name, + cluster_name="str", private_endpoint_connection_name="str", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/horizondb/azure-mgmt-horizondb/pyproject.toml b/sdk/horizondb/azure-mgmt-horizondb/pyproject.toml index f86dfe0c7b95..61cd294ade4b 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/pyproject.toml +++ b/sdk/horizondb/azure-mgmt-horizondb/pyproject.toml @@ -17,13 +17,13 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", diff --git a/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml b/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml index 2167576afed9..99a86da7b095 100644 --- a/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml +++ b/sdk/horizondb/azure-mgmt-horizondb/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/horizondb/resource-manager/Microsoft.HorizonDb/HorizonDb -commit: 6ac841ec30b3333ba3efcf11edef182a4a0f6393 +commit: f868cf045de6223d605ed9b7bf2a9ce2947c808f repo: Azure/azure-rest-api-specs additionalDirectories: