diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md b/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md index 575a98a1e518..c307acb1fa55 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/CHANGELOG.md @@ -1,5 +1,277 @@ # Release History +## 2.0.0 (2026-07-03) + +### Features Added + + - Client `AzureArcDataManagementClient` added method `send_request` + - Client `AzureArcDataManagementClient` added operation group `sql_server_licenses` + - Client `AzureArcDataManagementClient` added operation group `postgres_instances` + - Client `AzureArcDataManagementClient` added operation group `sql_server_esu_licenses` + - Client `AzureArcDataManagementClient` added operation group `failover_groups` + - Client `AzureArcDataManagementClient` added operation group `sql_server_availability_groups` + - Client `AzureArcDataManagementClient` added operation group `active_directory_connectors` + - Client `AzureArcDataManagementClient` added operation group `sql_server_databases` + - Enum `ArcSqlServerLicenseType` added member `FABRIC_CAPACITY` + - Enum `ArcSqlServerLicenseType` added member `LICENSE_ONLY` + - Enum `ArcSqlServerLicenseType` added member `PAYG` + - Enum `ArcSqlServerLicenseType` added member `SERVER_CAL` + - Enum `ConnectionStatus` added member `DISCOVERED` + - Enum `ConnectionStatus` added member `REGISTERED` + - Model `DataControllerUpdate` added property `properties` + - Enum `EditionType` added member `BUSINESS_INTELLIGENCE` + - Enum `EditionType` added member `STANDARD_DEVELOPER` + - Enum `EditionType` added member `UNKNOWN` + - Model `SqlManagedInstanceK8SSpec` added property `security` + - Model `SqlManagedInstanceK8SSpec` added property `settings` + - Model `SqlManagedInstanceProperties` added property `active_directory_information` + - Model `SqlServerInstanceProperties` added property `vm_id` + - Model `SqlServerInstanceProperties` added property `cores` + - Model `SqlServerInstanceProperties` added property `discovery_source` + - Model `SqlServerInstanceProperties` added property `db_master_key_exists` + - Model `SqlServerInstanceProperties` added property `is_hadr_enabled` + - Model `SqlServerInstanceProperties` added property `trace_flags` + - Model `SqlServerInstanceProperties` added property `last_inventory_upload_time` + - Model `SqlServerInstanceProperties` added property `last_usage_upload_time` + - Model `SqlServerInstanceProperties` added property `host_type` + - Model `SqlServerInstanceProperties` added property `always_on_role` + - Model `SqlServerInstanceProperties` added property `database_mirroring_endpoint` + - Model `SqlServerInstanceProperties` added property `failover_cluster` + - Model `SqlServerInstanceProperties` added property `backup_policy` + - Model `SqlServerInstanceProperties` added property `upgrade_locked_until` + - Model `SqlServerInstanceProperties` added property `monitoring` + - Model `SqlServerInstanceProperties` added property `migration` + - Model `SqlServerInstanceProperties` added property `best_practices_assessment` + - Model `SqlServerInstanceProperties` added property `client_connection` + - Model `SqlServerInstanceProperties` added property `service_type` + - Model `SqlServerInstanceProperties` added property `max_server_memory_mb` + - Model `SqlServerInstanceProperties` added property `is_microsoft_pki_cert_trust_configured` + - Model `SqlServerInstanceProperties` added property `is_digi_cert_pki_cert_trust_configured` + - Model `SqlServerInstanceProperties` added property `authentication` + - Model `SqlServerInstanceUpdate` added property `properties` + - Enum `SqlVersion` added member `SQL_SERVER2012` + - Enum `SqlVersion` added member `SQL_SERVER2014` + - Enum `SqlVersion` added member `SQL_SERVER2022` + - Enum `SqlVersion` added member `SQL_SERVER2025` + - Enum `SqlVersion` added member `UNKNOWN` + - Added enum `AccountProvisioningMode` + - Added enum `ActivationState` + - Added model `ActiveDirectoryConnectorDNSDetails` + - Added model `ActiveDirectoryConnectorDomainDetails` + - Added model `ActiveDirectoryConnectorProperties` + - Added model `ActiveDirectoryConnectorResource` + - Added model `ActiveDirectoryConnectorSpec` + - Added model `ActiveDirectoryConnectorStatus` + - Added model `ActiveDirectoryDomainController` + - Added model `ActiveDirectoryDomainControllers` + - Added model `ActiveDirectoryInformation` + - Added model `AdditionalMigrationJobAttributes` + - Added enum `AggregationType` + - Added enum `AlwaysOnRole` + - Added enum `ArcSqlServerAvailabilityGroupTypeFilter` + - Added enum `ArcSqlServerAvailabilityMode` + - Added enum `ArcSqlServerFailoverMode` + - Added enum `AssessmentStatus` + - Added model `Authentication` + - Added enum `AutomatedBackupPreference` + - Added model `AvailabilityGroupConfigure` + - Added model `AvailabilityGroupCreateUpdateConfiguration` + - Added model `AvailabilityGroupCreateUpdateReplicaConfiguration` + - Added model `AvailabilityGroupInfo` + - Added model `AvailabilityGroupRetrievalFilters` + - Added model `AvailabilityGroupState` + - Added enum `AzureManagedInstanceRole` + - Added model `BackgroundJob` + - Added model `BackupPolicy` + - Added model `BestPracticesAssessment` + - Added enum `BillingPlan` + - Added model `ClientConnection` + - Added enum `ClusterType` + - Added model `CommonSku` + - Added enum `ConnectionAuth` + - Added model `CostOptionSelectedValues` + - Added model `CostTypeValues` + - Added model `CronTrigger` + - Added model `DBMEndpoint` + - Added model `DataBaseMigration` + - Added model `DataBaseMigrationAssessment` + - Added model `DatabaseAssessmentsItem` + - Added enum `DatabaseCreateMode` + - Added model `DatabaseMigrationJobsItem` + - Added enum `DatabaseState` + - Added model `Databases` + - Added enum `DbFailover` + - Added enum `DifferentialBackupHours` + - Added enum `DiscoverySource` + - Added model `DiskSizes` + - Added model `DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration` + - Added model `DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration` + - Added model `DistributedAvailabilityGroupCreateUpdateConfiguration` + - Added enum `DtcSupport` + - Added enum `EncryptionAlgorithm` + - Added model `EntraAuthentication` + - Added model `ErrorAdditionalInfo` + - Added model `ErrorDetail` + - Added enum `ExecutionState` + - Added model `FailoverCluster` + - Added enum `FailoverGroupPartnerSyncMode` + - Added model `FailoverGroupProperties` + - Added model `FailoverGroupResource` + - Added model `FailoverGroupSpec` + - Added model `FailoverMiLinkResourceId` + - Added enum `FailureConditionLevel` + - Added model `HostIPAddressInformation` + - Added enum `HostType` + - Added enum `IdentityType` + - Added model `ImpactedObjectsInfo` + - Added model `ImpactedObjectsSuitabilitySummary` + - Added enum `InitiatedFrom` + - Added enum `InstanceFailoverGroupRole` + - Added enum `JobStatus` + - Added model `K8SActiveDirectory` + - Added model `K8SActiveDirectoryConnector` + - Added model `K8SNetworkSettings` + - Added model `K8SSecurity` + - Added model `K8SSettings` + - Added model `K8StransparentDataEncryption` + - Added model `KeytabInformation` + - Added enum `LastExecutionStatus` + - Added enum `LicenseCategory` + - Added model `ManagedInstanceLinkCreateUpdateConfiguration` + - Added enum `MiLinkAssessmentCategory` + - Added model `MiLinkCreateUpdateConfiguration` + - Added model `Migration` + - Added model `MigrationAssessment` + - Added model `MigrationAssessmentSettings` + - Added enum `MigrationMode` + - Added enum `MigrationStatus` + - Added enum `Mode` + - Added model `Monitoring` + - Added model `PostgresInstance` + - Added model `PostgresInstanceProperties` + - Added model `PostgresInstanceSku` + - Added model `PostgresInstanceUpdate` + - Added enum `PrimaryAllowConnections` + - Added enum `ProvisioningState` + - Added model `ProxyResource` + - Added enum `RecommendationStatus` + - Added enum `RecoveryMode` + - Added enum `ReplicationPartnerType` + - Added enum `ResourceUpdateMode` + - Added enum `Result` + - Added enum `Role` + - Added model `Schedule` + - Added enum `ScopeType` + - Added enum `SecondaryAllowConnections` + - Added enum `SeedingMode` + - Added model `SequencerAction` + - Added enum `SequencerState` + - Added model `ServerAssessmentsItem` + - Added model `ServerAssessmentsPropertiesItemsItem` + - Added enum `ServiceType` + - Added model `SkuRecommendationResults` + - Added model `SkuRecommendationResultsAzureSqlDatabase` + - Added model `SkuRecommendationResultsAzureSqlDatabaseTargetSku` + - Added model `SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory` + - Added model `SkuRecommendationResultsAzureSqlManagedInstance` + - Added model `SkuRecommendationResultsAzureSqlManagedInstanceTargetSku` + - Added model `SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory` + - Added model `SkuRecommendationResultsAzureSqlVirtualMachine` + - Added model `SkuRecommendationResultsAzureSqlVirtualMachineTargetSku` + - Added model `SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory` + - Added model `SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize` + - Added model `SkuRecommendationResultsMonthlyCost` + - Added model `SkuRecommendationResultsMonthlyCostOptionItem` + - Added model `SkuRecommendationSummary` + - Added model `SkuRecommendationSummaryTargetSku` + - Added model `SkuRecommendationSummaryTargetSkuCategory` + - Added model `SqlAvailabilityGroupDatabaseReplicaResourceProperties` + - Added model `SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem` + - Added model `SqlAvailabilityGroupReplicaResourceProperties` + - Added model `SqlAvailabilityGroupStaticIPListenerProperties` + - Added model `SqlServerAvailabilityGroupResource` + - Added model `SqlServerAvailabilityGroupResourceProperties` + - Added model `SqlServerAvailabilityGroupResourcePropertiesDatabases` + - Added model `SqlServerAvailabilityGroupResourcePropertiesReplicas` + - Added model `SqlServerAvailabilityGroupUpdate` + - Added model `SqlServerDatabaseResource` + - Added model `SqlServerDatabaseResourceProperties` + - Added model `SqlServerDatabaseResourcePropertiesBackupInformation` + - Added model `SqlServerDatabaseResourcePropertiesDatabaseOptions` + - Added model `SqlServerDatabaseUpdate` + - Added model `SqlServerEsuLicense` + - Added model `SqlServerEsuLicenseProperties` + - Added model `SqlServerEsuLicenseUpdate` + - Added model `SqlServerEsuLicenseUpdateProperties` + - Added model `SqlServerInstanceBpaColumn` + - Added enum `SqlServerInstanceBpaColumnType` + - Added enum `SqlServerInstanceBpaQueryType` + - Added enum `SqlServerInstanceBpaReportType` + - Added model `SqlServerInstanceBpaRequest` + - Added model `SqlServerInstanceJob` + - Added model `SqlServerInstanceJobStatus` + - Added model `SqlServerInstanceJobsRequest` + - Added model `SqlServerInstanceJobsResponse` + - Added model `SqlServerInstanceJobsStatusRequest` + - Added model `SqlServerInstanceJobsStatusResponse` + - Added model `SqlServerInstanceManagedInstanceLinkAssessment` + - Added model `SqlServerInstanceManagedInstanceLinkAssessmentRequest` + - Added model `SqlServerInstanceManagedInstanceLinkAssessmentResponse` + - Added model `SqlServerInstanceMigrationReadinessReportResponse` + - Added model `SqlServerInstanceRunBestPracticesAssessmentResponse` + - Added model `SqlServerInstanceRunMigrationAssessmentResponse` + - Added model `SqlServerInstanceRunMigrationReadinessAssessmentResponse` + - Added model `SqlServerInstanceRunTargetRecommendationJobRequest` + - Added model `SqlServerInstanceRunTargetRecommendationJobResponse` + - Added model `SqlServerInstanceTargetRecommendationReport` + - Added model `SqlServerInstanceTargetRecommendationReportSection` + - Added enum `SqlServerInstanceTargetRecommendationReportSectionType` + - Added model `SqlServerInstanceTargetRecommendationReportsRequest` + - Added model `SqlServerInstanceTargetRecommendationReportsResponse` + - Added model `SqlServerInstanceTelemetryColumn` + - Added enum `SqlServerInstanceTelemetryColumnType` + - Added model `SqlServerInstanceTelemetryRequest` + - Added model `SqlServerInstanceUpdateProperties` + - Added model `SqlServerLicense` + - Added model `SqlServerLicenseProperties` + - Added model `SqlServerLicenseUpdate` + - Added model `SqlServerLicenseUpdateProperties` + - Added enum `State` + - Added model `TargetReadiness` + - Added enum `TargetType` + - Added enum `Version` + - Operation group `SqlServerInstancesOperations` added method `begin_get_best_practices_assessment` + - Operation group `SqlServerInstancesOperations` added method `begin_get_jobs` + - Operation group `SqlServerInstancesOperations` added method `begin_get_migration_readiness_report` + - Operation group `SqlServerInstancesOperations` added method `begin_get_target_recommendation_reports` + - Operation group `SqlServerInstancesOperations` added method `begin_get_telemetry` + - Operation group `SqlServerInstancesOperations` added method `begin_run_best_practice_assessment` + - Operation group `SqlServerInstancesOperations` added method `begin_run_managed_instance_link_assessment` + - Operation group `SqlServerInstancesOperations` added method `begin_run_migration_readiness_assessment` + - Operation group `SqlServerInstancesOperations` added method `begin_run_target_recommendation_job` + - Operation group `SqlServerInstancesOperations` added method `get_all_availability_groups` + - Operation group `SqlServerInstancesOperations` added method `get_jobs_status` + - Operation group `SqlServerInstancesOperations` added method `post_upgrade` + - Operation group `SqlServerInstancesOperations` added method `pre_upgrade` + - Operation group `SqlServerInstancesOperations` added method `run_best_practices_assessment` + - Operation group `SqlServerInstancesOperations` added method `run_migration_assessment` + - Added operation group `ActiveDirectoryConnectorsOperations` + - Added operation group `FailoverGroupsOperations` + - Added operation group `PostgresInstancesOperations` + - Added operation group `SqlServerAvailabilityGroupsOperations` + - Added operation group `SqlServerDatabasesOperations` + - Added operation group `SqlServerEsuLicensesOperations` + - Added operation group `SqlServerLicensesOperations` + +### Breaking Changes + + - Renamed method `DataControllersOperations.patch_data_controller` to `begin_patch_data_controller` + - Renamed method `SqlServerInstancesOperations.update` to `begin_update` + +### Other Changes + + - Deleted model `ErrorResponseBody`/`OperationListResult`/`PageOfDataControllerResource`/`SqlManagedInstanceListResult`/`SqlManagedInstanceSkuName`/`SqlServerInstanceListResult` which actually were not used by SDK users + ## 2.0.0b2 (2026-05-14) ### Other Changes diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md b/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md index 4a2f4001907b..1ac404aff3ee 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/README.md @@ -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/azurearcdata/azure-mgmt-azurearcdata/_metadata.json b/sdk/azurearcdata/azure-mgmt-azurearcdata/_metadata.json index bd15186ae186..a030c2a8f925 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/_metadata.json +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/_metadata.json @@ -1,11 +1,11 @@ { - "commit": "9ed645a9bde75631449533eb3825348417661959", + "apiVersion": "2026-03-01-preview", + "apiVersions": { + "Microsoft.AzureArcData": "2026-03-01-preview" + }, + "commit": "0e47f51219c4dac6a75e69a75d158298b852eda3", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.50.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/azurearcdata/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=C:\\dev\\azure-sdk-for-python\\sdk --tag=package-preview-2022-03 --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/azurearcdata/resource-manager/readme.md" + "typespec_src": "specification/azurearcdata/AzureArcData.Management", + "emitterVersion": "0.63.2", + "httpClientPythonVersion": "^0.34.0" } \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/api.md b/sdk/azurearcdata/azure-mgmt-azurearcdata/api.md new file mode 100644 index 000000000000..82d6a4c5a30c --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/api.md @@ -0,0 +1,8858 @@ +```py +namespace azure.mgmt.azurearcdata + + class azure.mgmt.azurearcdata.AzureArcDataManagementClient: implements ContextManager + active_directory_connectors: ActiveDirectoryConnectorsOperations + data_controllers: DataControllersOperations + failover_groups: FailoverGroupsOperations + operations: Operations + postgres_instances: PostgresInstancesOperations + sql_managed_instances: SqlManagedInstancesOperations + sql_server_availability_groups: SqlServerAvailabilityGroupsOperations + sql_server_databases: SqlServerDatabasesOperations + sql_server_esu_licenses: SqlServerEsuLicensesOperations + sql_server_instances: SqlServerInstancesOperations + sql_server_licenses: SqlServerLicensesOperations + + 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.azurearcdata.aio + + class azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient: implements AsyncContextManager + active_directory_connectors: ActiveDirectoryConnectorsOperations + data_controllers: DataControllersOperations + failover_groups: FailoverGroupsOperations + operations: Operations + postgres_instances: PostgresInstancesOperations + sql_managed_instances: SqlManagedInstancesOperations + sql_server_availability_groups: SqlServerAvailabilityGroupsOperations + sql_server_databases: SqlServerDatabasesOperations + sql_server_esu_licenses: SqlServerEsuLicensesOperations + sql_server_instances: SqlServerInstancesOperations + sql_server_licenses: SqlServerLicensesOperations + + 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.azurearcdata.aio.operations + + class azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ActiveDirectoryConnectorResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ActiveDirectoryConnectorResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ActiveDirectoryConnectorResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + **kwargs: Any + ) -> ActiveDirectoryConnectorResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ActiveDirectoryConnectorResource]: ... + + + class azure.mgmt.azurearcdata.aio.operations.DataControllersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @overload + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @overload + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @overload + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @overload + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @overload + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[DataControllerResource]: ... + + @distributed_trace_async + async def get_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> DataControllerResource: ... + + @distributed_trace + def list_in_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[DataControllerResource]: ... + + @distributed_trace + def list_in_subscription(self, **kwargs: Any) -> AsyncItemPaged[DataControllerResource]: ... + + + class azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverGroupResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverGroupResource]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[FailoverGroupResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + **kwargs: Any + ) -> FailoverGroupResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> AsyncItemPaged[FailoverGroupResource]: ... + + + class azure.mgmt.azurearcdata.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PostgresInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PostgresInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PostgresInstance]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + postgres_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + postgres_instance_name: str, + **kwargs: Any + ) -> PostgresInstance: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[PostgresInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PostgresInstance]: ... + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlManagedInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlManagedInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlManagedInstance]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> SqlManagedInstance: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[SqlManagedInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlManagedInstance]: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + async def begin_delete_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace_async + async def detail_view( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace_async + async def failover( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace_async + async def force_failover_allow_data_loss( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerDatabaseResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerDatabaseResource]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerDatabaseResource]: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlServerDatabaseResource]: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[SqlServerEsuLicense]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlServerEsuLicense]: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceJobsResponse]: ... + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceJobsResponse]: ... + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceJobsResponse]: ... + + @distributed_trace_async + async def begin_get_migration_readiness_report( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceMigrationReadinessReportResponse]: ... + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[SqlServerInstanceTargetRecommendationReportsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[SqlServerInstanceTargetRecommendationReportsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: ... + + @distributed_trace_async + async def begin_run_best_practice_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceRunBestPracticesAssessmentResponse]: ... + + @overload + async def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @overload + async def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @overload + async def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @distributed_trace_async + async def begin_run_migration_readiness_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceRunMigrationReadinessAssessmentResponse]: ... + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[SqlServerInstanceRunTargetRecommendationJobRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[SqlServerInstanceRunTargetRecommendationJobRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SqlServerInstance]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[SqlServerInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlServerInstance]: ... + + @distributed_trace_async + async def post_upgrade( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @distributed_trace_async + async def pre_upgrade( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @distributed_trace_async + async def run_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstanceRunBestPracticesAssessmentResponse: ... + + @distributed_trace_async + async def run_migration_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstanceRunMigrationAssessmentResponse: ... + + + class azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + sql_server_license_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + sql_server_license_name: str, + **kwargs: Any + ) -> SqlServerLicense: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[SqlServerLicense]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SqlServerLicense]: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + +namespace azure.mgmt.azurearcdata.models + + class azure.mgmt.azurearcdata.models.AccountProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTOMATIC = "automatic" + MANUAL = "manual" + + + class azure.mgmt.azurearcdata.models.ActivationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVATED = "Activated" + DEACTIVATED = "Deactivated" + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails(_Model): + domain_name: Optional[str] + nameserver_ip_addresses: list[str] + prefer_k8_s_dns_for_ptr_lookups: Optional[bool] + replicas: Optional[int] + + @overload + def __init__( + self, + *, + domain_name: Optional[str] = ..., + nameserver_ip_addresses: list[str], + prefer_k8_s_dns_for_ptr_lookups: Optional[bool] = ..., + replicas: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails(_Model): + domain_controllers: Optional[ActiveDirectoryDomainControllers] + netbios_domain_name: Optional[str] + ou_distinguished_name: Optional[str] + realm: str + service_account_provisioning: Optional[Union[str, AccountProvisioningMode]] + + @overload + def __init__( + self, + *, + domain_controllers: Optional[ActiveDirectoryDomainControllers] = ..., + netbios_domain_name: Optional[str] = ..., + ou_distinguished_name: Optional[str] = ..., + realm: str, + service_account_provisioning: Optional[Union[str, AccountProvisioningMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties(_Model): + domain_service_account_login_information: Optional[BasicLoginInformation] + provisioning_state: Optional[str] + spec: ActiveDirectoryConnectorSpec + status: Optional[ActiveDirectoryConnectorStatus] + + @overload + def __init__( + self, + *, + domain_service_account_login_information: Optional[BasicLoginInformation] = ..., + spec: ActiveDirectoryConnectorSpec, + status: Optional[ActiveDirectoryConnectorStatus] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource(ProxyResource): + id: str + name: str + properties: ActiveDirectoryConnectorProperties + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: ActiveDirectoryConnectorProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec(_Model): + active_directory: ActiveDirectoryConnectorDomainDetails + dns: ActiveDirectoryConnectorDNSDetails + + @overload + def __init__( + self, + *, + active_directory: ActiveDirectoryConnectorDomainDetails, + dns: ActiveDirectoryConnectorDNSDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus(_Model): + last_update_time: Optional[str] + observed_generation: Optional[int] + state: Optional[str] + + @overload + def __init__( + self, + *, + last_update_time: Optional[str] = ..., + observed_generation: Optional[int] = ..., + state: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController(_Model): + hostname: str + + @overload + def __init__( + self, + *, + hostname: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers(_Model): + primary_domain_controller: Optional[ActiveDirectoryDomainController] + secondary_domain_controllers: Optional[list[ActiveDirectoryDomainController]] + + @overload + def __init__( + self, + *, + primary_domain_controller: Optional[ActiveDirectoryDomainController] = ..., + secondary_domain_controllers: Optional[list[ActiveDirectoryDomainController]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ActiveDirectoryInformation(_Model): + keytab_information: Optional[KeytabInformation] + + @overload + def __init__( + self, + *, + keytab_information: Optional[KeytabInformation] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AdditionalMigrationJobAttributes(_Model): + key_name: Optional[str] + key_value: Optional[str] + + @overload + def __init__( + self, + *, + key_name: Optional[str] = ..., + key_value: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVERAGE = "Average" + COUNT = "Count" + MAXIMUM = "Maximum" + MINIMUM = "Minimum" + SUM = "Sum" + + + class azure.mgmt.azurearcdata.models.AlwaysOnRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABILITY_GROUP_REPLICA = "AvailabilityGroupReplica" + FAILOVER_CLUSTER_INSTANCE = "FailoverClusterInstance" + FAILOVER_CLUSTER_NODE = "FailoverClusterNode" + NONE = "None" + + + class azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASE_PRICE = "BasePrice" + DISASTER_RECOVERY = "DisasterRecovery" + LICENSE_INCLUDED = "LicenseIncluded" + + + class azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityGroupTypeFilter(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONTAINED = "CONTAINED" + DEFAULT = "DEFAULT" + DISTRIBUTED = "DISTRIBUTED" + + + class azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASYNCHRONOUS_COMMIT = "ASYNCHRONOUS_COMMIT" + SYNCHRONOUS_COMMIT = "SYNCHRONOUS_COMMIT" + + + class azure.mgmt.azurearcdata.models.ArcSqlServerFailoverMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTOMATIC = "AUTOMATIC" + EXTERNAL = "EXTERNAL" + MANUAL = "MANUAL" + NONE = "NONE" + + + class azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FABRIC_CAPACITY = "FabricCapacity" + FREE = "Free" + HADR = "HADR" + LICENSE_ONLY = "LicenseOnly" + PAID = "Paid" + PAYG = "PAYG" + SERVER_CAL = "ServerCAL" + UNDEFINED = "Undefined" + + + class azure.mgmt.azurearcdata.models.AssessmentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILURE = "Failure" + SUCCESS = "Success" + WARNING = "Warning" + + + class azure.mgmt.azurearcdata.models.Authentication(_Model): + mode: Optional[Union[str, Mode]] + sql_server_entra_identity: Optional[list[EntraAuthentication]] + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, Mode]] = ..., + sql_server_entra_identity: Optional[list[EntraAuthentication]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AutomatedBackupPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "NONE" + PRIMARY = "PRIMARY" + SECONDARY = "SECONDARY" + SECONDARY_ONLY = "SECONDARY_ONLY" + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupConfigure(_Model): + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] + availability_mode_description: Optional[str] + backup_priority: Optional[int] + certificate_name: Optional[str] + endpoint_authentication_mode: Optional[Union[str, ConnectionAuth]] + endpoint_connect_login: Optional[str] + endpoint_name: Optional[str] + endpoint_url: Optional[str] + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] + failover_mode_description: Optional[str] + primary_allow_connections: Optional[Union[str, PrimaryAllowConnections]] + primary_role_allow_connections_description: Optional[str] + read_only_routing_url: Optional[str] + read_write_routing_url: Optional[str] + replica_create_date: Optional[datetime] + replica_modify_date: Optional[datetime] + secondary_allow_connections: Optional[Union[str, SecondaryAllowConnections]] + secondary_role_allow_connections_description: Optional[str] + seeding_mode: Optional[Union[str, SeedingMode]] + seeding_mode_description: Optional[str] + session_timeout: Optional[int] + + @overload + def __init__( + self, + *, + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] = ..., + backup_priority: Optional[int] = ..., + certificate_name: Optional[str] = ..., + endpoint_authentication_mode: Optional[Union[str, ConnectionAuth]] = ..., + endpoint_connect_login: Optional[str] = ..., + endpoint_name: Optional[str] = ..., + endpoint_url: Optional[str] = ..., + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] = ..., + primary_allow_connections: Optional[Union[str, PrimaryAllowConnections]] = ..., + read_only_routing_url: Optional[str] = ..., + read_write_routing_url: Optional[str] = ..., + secondary_allow_connections: Optional[Union[str, SecondaryAllowConnections]] = ..., + seeding_mode: Optional[Union[str, SeedingMode]] = ..., + session_timeout: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration(_Model): + automated_backup_preference: Optional[Union[str, AutomatedBackupPreference]] + availability_group_name: Optional[str] + cluster_type: Optional[Union[str, ClusterType]] + databases: Optional[list[str]] + db_failover: Optional[Union[str, DbFailover]] + dtc_support: Optional[Union[str, DtcSupport]] + failure_condition_level: Optional[Union[int, FailureConditionLevel]] + health_check_timeout: Optional[int] + listener: Optional[SqlAvailabilityGroupStaticIPListenerProperties] + replicas: Optional[list[AvailabilityGroupCreateUpdateReplicaConfiguration]] + required_synchronized_secondaries_to_commit: Optional[int] + + @overload + def __init__( + self, + *, + automated_backup_preference: Optional[Union[str, AutomatedBackupPreference]] = ..., + availability_group_name: Optional[str] = ..., + cluster_type: Optional[Union[str, ClusterType]] = ..., + databases: Optional[list[str]] = ..., + db_failover: Optional[Union[str, DbFailover]] = ..., + dtc_support: Optional[Union[str, DtcSupport]] = ..., + failure_condition_level: Optional[Union[int, FailureConditionLevel]] = ..., + health_check_timeout: Optional[int] = ..., + listener: Optional[SqlAvailabilityGroupStaticIPListenerProperties] = ..., + replicas: Optional[list[AvailabilityGroupCreateUpdateReplicaConfiguration]] = ..., + required_synchronized_secondaries_to_commit: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateReplicaConfiguration(_Model): + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] + backup_priority: Optional[int] + certificate_name: Optional[str] + endpoint_authentication_mode: Optional[Union[str, ConnectionAuth]] + endpoint_connect_login: Optional[str] + endpoint_name: Optional[str] + endpoint_url: Optional[str] + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] + primary_role_allow_connections: Optional[Union[str, PrimaryAllowConnections]] + primary_role_read_only_routing_list: Optional[list[str]] + secondary_role_allow_connections: Optional[Union[str, SecondaryAllowConnections]] + secondary_role_read_only_routing_url: Optional[str] + seeding_mode: Optional[Union[str, SeedingMode]] + server_instance: Optional[str] + session_timeout: Optional[int] + + @overload + def __init__( + self, + *, + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] = ..., + backup_priority: Optional[int] = ..., + certificate_name: Optional[str] = ..., + endpoint_authentication_mode: Optional[Union[str, ConnectionAuth]] = ..., + endpoint_connect_login: Optional[str] = ..., + endpoint_name: Optional[str] = ..., + endpoint_url: Optional[str] = ..., + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] = ..., + primary_role_allow_connections: Optional[Union[str, PrimaryAllowConnections]] = ..., + primary_role_read_only_routing_list: Optional[list[str]] = ..., + secondary_role_allow_connections: Optional[Union[str, SecondaryAllowConnections]] = ..., + secondary_role_read_only_routing_url: Optional[str] = ..., + seeding_mode: Optional[Union[str, SeedingMode]] = ..., + server_instance: Optional[str] = ..., + session_timeout: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupInfo(_Model): + automated_backup_preference_description: Optional[str] + basic_features: Optional[bool] + cluster_type_description: Optional[str] + db_failover: Optional[bool] + dtc_support: Optional[bool] + failure_condition_level: Optional[int] + health_check_timeout: Optional[int] + is_contained: Optional[bool] + is_distributed: Optional[bool] + listener: Optional[SqlAvailabilityGroupStaticIPListenerProperties] + primary_recovery_health_description: Optional[str] + primary_replica: Optional[str] + replication_partner_type: Optional[Union[str, ReplicationPartnerType]] + required_synchronized_secondaries_to_commit: Optional[int] + secondary_recovery_health_description: Optional[str] + synchronization_health_description: Optional[str] + version: Optional[int] + + @overload + def __init__( + self, + *, + basic_features: Optional[bool] = ..., + db_failover: Optional[bool] = ..., + dtc_support: Optional[bool] = ..., + failure_condition_level: Optional[int] = ..., + health_check_timeout: Optional[int] = ..., + is_contained: Optional[bool] = ..., + is_distributed: Optional[bool] = ..., + listener: Optional[SqlAvailabilityGroupStaticIPListenerProperties] = ..., + required_synchronized_secondaries_to_commit: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters(_Model): + availability_group_type_filter: Optional[Union[str, ArcSqlServerAvailabilityGroupTypeFilter]] + replication_partner_type_filter: Optional[Union[str, ReplicationPartnerType]] + + @overload + def __init__( + self, + *, + availability_group_type_filter: Optional[Union[str, ArcSqlServerAvailabilityGroupTypeFilter]] = ..., + replication_partner_type_filter: Optional[Union[str, ReplicationPartnerType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.AvailabilityGroupState(_Model): + availability_group_replica_role: Optional[str] + connected_state_description: Optional[str] + last_connect_error_description: Optional[str] + last_connect_error_timestamp: Optional[datetime] + operational_state_description: Optional[str] + recovery_health_description: Optional[str] + synchronization_health_description: Optional[str] + + + class azure.mgmt.azurearcdata.models.AzureManagedInstanceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRIMARY = "Primary" + SECONDARY = "Secondary" + + + class azure.mgmt.azurearcdata.models.BackgroundJob(_Model): + end_time: Optional[datetime] + execution_state: Optional[Union[str, ExecutionState]] + last_execution_status: Optional[Union[str, LastExecutionStatus]] + last_execution_time: Optional[datetime] + next_execution_time: Optional[datetime] + start_time: Optional[datetime] + state: Optional[Union[str, State]] + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + execution_state: Optional[Union[str, ExecutionState]] = ..., + last_execution_status: Optional[Union[str, LastExecutionStatus]] = ..., + last_execution_time: Optional[datetime] = ..., + next_execution_time: Optional[datetime] = ..., + start_time: Optional[datetime] = ..., + state: Optional[Union[str, State]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.BackupPolicy(_Model): + differential_backup_hours: Optional[Union[int, DifferentialBackupHours]] + full_backup_days: Optional[int] + retention_period_days: Optional[int] + transaction_log_backup_minutes: Optional[int] + + @overload + def __init__( + self, + *, + differential_backup_hours: Optional[Union[int, DifferentialBackupHours]] = ..., + full_backup_days: Optional[int] = ..., + retention_period_days: Optional[int] = ..., + transaction_log_backup_minutes: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.BasicLoginInformation(_Model): + password: Optional[str] + username: Optional[str] + + @overload + def __init__( + self, + *, + password: Optional[str] = ..., + username: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.BestPracticesAssessment(_Model): + enabled: Optional[bool] + schedule: Optional[Schedule] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ..., + schedule: Optional[Schedule] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.BillingPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PAID = "Paid" + PAYG = "PAYG" + + + class azure.mgmt.azurearcdata.models.ClientConnection(_Model): + enabled: Optional[bool] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ClusterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "NONE" + WSFC = "WSFC" + + + class azure.mgmt.azurearcdata.models.CommonSku(_Model): + capacity: Optional[int] + dev: Optional[bool] + family: Optional[str] + name: str + size: Optional[str] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + dev: Optional[bool] = ..., + family: Optional[str] = ..., + name: str, + size: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ConnectionAuth(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CERTIFICATE = "Certificate" + CERTIFICATE_WINDOWS_KERBEROS = "Certificate_Windows_Kerberos" + CERTIFICATE_WINDOWS_NEGOTIATE = "Certificate_Windows_Negotiate" + CERTIFICATE_WINDOWS_NTLM = "Certificate_Windows_NTLM" + WINDOWS_KERBEROS = "Windows_Kerberos" + WINDOWS_KERBEROS_CERTIFICATE = "Windows_Kerberos_Certificate" + WINDOWS_NEGOTIATE = "Windows_Negotiate" + WINDOWS_NEGOTIATE_CERTIFICATE = "Windows_Negotiate_Certificate" + WINDOWS_NTLM = "Windows_NTLM" + WINDOWS_NTLM_CERTIFICATE = "Windows_NTLM_Certificate" + + + class azure.mgmt.azurearcdata.models.ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONNECTED = "Connected" + DISCONNECTED = "Disconnected" + DISCOVERED = "Discovered" + REGISTERED = "Registered" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.CostOptionSelectedValues(_Model): + compute_and_storage_cost_option: Optional[str] + sql_license_cost_option: Optional[str] + windows_license_cost_option: Optional[str] + + @overload + def __init__( + self, + *, + compute_and_storage_cost_option: Optional[str] = ..., + sql_license_cost_option: Optional[str] = ..., + windows_license_cost_option: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.CostTypeValues(_Model): + compute_cost: Optional[float] + iops_cost: Optional[float] + storage_cost: Optional[float] + + @overload + def __init__( + self, + *, + compute_cost: Optional[float] = ..., + iops_cost: Optional[float] = ..., + storage_cost: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.azurearcdata.models.CronTrigger(_Model): + expression: Optional[str] + start_time: Optional[str] + time_zone: Optional[str] + + @overload + def __init__( + self, + *, + expression: Optional[str] = ..., + start_time: Optional[str] = ..., + time_zone: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DBMEndpoint(_Model): + certificate_expiry_date: Optional[datetime] + certificate_name: Optional[str] + connection_auth: Optional[Union[str, ConnectionAuth]] + encryption_algorithm: Optional[Union[str, EncryptionAlgorithm]] + endpoint_name: Optional[str] + ip_address: Optional[str] + is_dynamic_port: Optional[bool] + is_encryption_enabled: Optional[bool] + port: Optional[int] + role: Optional[Union[str, Role]] + + + class azure.mgmt.azurearcdata.models.DataBaseMigration(_Model): + assessment: Optional[DataBaseMigrationAssessment] + jobs: Optional[list[DatabaseMigrationJobsItem]] + + @overload + def __init__( + self, + *, + assessment: Optional[DataBaseMigrationAssessment] = ..., + jobs: Optional[list[DatabaseMigrationJobsItem]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DataBaseMigrationAssessment(_Model): + assessment_upload_time: Optional[datetime] + database_assessments: Optional[list[DatabaseAssessmentsItem]] + target_readiness: Optional[TargetReadiness] + target_recommendation_generation_time: Optional[datetime] + + + class azure.mgmt.azurearcdata.models.DataControllerProperties(_Model): + basic_login_information: Optional[BasicLoginInformation] + cluster_id: Optional[str] + extension_id: Optional[str] + infrastructure: Optional[Union[str, Infrastructure]] + k8_s_raw: Optional[Any] + last_uploaded_date: Optional[datetime] + log_analytics_workspace_config: Optional[LogAnalyticsWorkspaceConfig] + logs_dashboard_credential: Optional[BasicLoginInformation] + metrics_dashboard_credential: Optional[BasicLoginInformation] + on_premise_property: Optional[OnPremiseProperty] + provisioning_state: Optional[str] + upload_service_principal: Optional[UploadServicePrincipal] + upload_watermark: Optional[UploadWatermark] + + @overload + def __init__( + self, + *, + basic_login_information: Optional[BasicLoginInformation] = ..., + cluster_id: Optional[str] = ..., + extension_id: Optional[str] = ..., + infrastructure: Optional[Union[str, Infrastructure]] = ..., + k8_s_raw: Optional[Any] = ..., + last_uploaded_date: Optional[datetime] = ..., + log_analytics_workspace_config: Optional[LogAnalyticsWorkspaceConfig] = ..., + logs_dashboard_credential: Optional[BasicLoginInformation] = ..., + metrics_dashboard_credential: Optional[BasicLoginInformation] = ..., + on_premise_property: Optional[OnPremiseProperty] = ..., + upload_service_principal: Optional[UploadServicePrincipal] = ..., + upload_watermark: Optional[UploadWatermark] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DataControllerResource(TrackedResource): + extended_location: Optional[ExtendedLocation] + id: str + location: str + name: str + properties: DataControllerProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: Optional[ExtendedLocation] = ..., + location: str, + properties: DataControllerProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DataControllerUpdate(_Model): + properties: Optional[DataControllerProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[DataControllerProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DatabaseAssessmentsItem(_Model): + applies_to_migration_target_platform: Optional[str] + feature_id: Optional[str] + issue_category: Optional[str] + more_information: Optional[str] + + @overload + def __init__( + self, + *, + applies_to_migration_target_platform: Optional[str] = ..., + feature_id: Optional[str] = ..., + issue_category: Optional[str] = ..., + more_information: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DatabaseCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "Default" + POINT_IN_TIME_RESTORE = "PointInTimeRestore" + + + class azure.mgmt.azurearcdata.models.DatabaseMigrationJobsItem(_Model): + additional_attributes: Optional[list[AdditionalMigrationJobAttributes]] + end_time: Optional[datetime] + initiated_from: Optional[Union[str, InitiatedFrom]] + last_error: Optional[str] + migration_mode: Optional[Union[str, MigrationMode]] + migration_tracking_id: Optional[str] + start_time: Optional[datetime] + status: Optional[Union[str, MigrationStatus]] + target_resource_id: Optional[str] + target_type: Optional[Union[str, TargetType]] + + @overload + def __init__( + self, + *, + additional_attributes: Optional[list[AdditionalMigrationJobAttributes]] = ..., + end_time: Optional[datetime] = ..., + initiated_from: Optional[Union[str, InitiatedFrom]] = ..., + last_error: Optional[str] = ..., + migration_mode: Optional[Union[str, MigrationMode]] = ..., + migration_tracking_id: Optional[str] = ..., + start_time: Optional[datetime] = ..., + status: Optional[Union[str, MigrationStatus]] = ..., + target_resource_id: Optional[str] = ..., + target_type: Optional[Union[str, TargetType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DatabaseState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COPYING = "Copying" + EMERGENCY = "Emergency" + OFFLINE = "Offline" + OFFLINE_SECONDARY = "OfflineSecondary" + ONLINE = "Online" + RECOVERING = "Recovering" + RECOVERY_PENDING = "RecoveryPending" + RESTORING = "Restoring" + SUSPECT = "Suspect" + + + class azure.mgmt.azurearcdata.models.Databases(_Model): + values_property: Optional[list[str]] + + @overload + def __init__( + self, + *, + values_property: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DbFailover(str, Enum, metaclass=CaseInsensitiveEnumMeta): + OFF = "OFF" + ON = "ON" + + + class azure.mgmt.azurearcdata.models.DefenderStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PROTECTED = "Protected" + UNKNOWN = "Unknown" + UNPROTECTED = "Unprotected" + + + class azure.mgmt.azurearcdata.models.DifferentialBackupHours(int, Enum, metaclass=CaseInsensitiveEnumMeta): + TWELVE = 12 + TWENTY_FOUR = 24 + + + class azure.mgmt.azurearcdata.models.DiscoverySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADS = "ADS" + AZURE_ARC = "Azure Arc" + AZURE_MIGRATE = "Azure Migrate" + DMS_CLI = "DMS-CLI" + DMS_PORTAL = "DMS-Portal" + DMS_PS = "DMS-PS" + DMS_SDK = "DMS-SDK" + IMPORT = "Import" + OTHER = "Other" + SSMA = "SSMA" + SSMS = "SSMS" + + + class azure.mgmt.azurearcdata.models.DiskSizes(_Model): + caching: Optional[str] + disk_type: Optional[str] + max_iops: Optional[float] + max_size_in_gib: Optional[float] + max_throughput_in_mbps: Optional[float] + redundancy: Optional[str] + size: Optional[str] + + @overload + def __init__( + self, + *, + caching: Optional[str] = ..., + disk_type: Optional[str] = ..., + max_iops: Optional[float] = ..., + max_size_in_gib: Optional[float] = ..., + max_throughput_in_mbps: Optional[float] = ..., + redundancy: Optional[str] = ..., + size: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration(_Model): + certificate_name: Optional[str] + + @overload + def __init__( + self, + *, + certificate_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration(_Model): + availability_group: Optional[str] + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] + certificate_configuration: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration] + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] + listener_url: Optional[str] + seeding_mode: Optional[Union[str, SeedingMode]] + + @overload + def __init__( + self, + *, + availability_group: Optional[str] = ..., + availability_mode: Optional[Union[str, ArcSqlServerAvailabilityMode]] = ..., + certificate_configuration: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration] = ..., + failover_mode: Optional[Union[str, ArcSqlServerFailoverMode]] = ..., + listener_url: Optional[str] = ..., + seeding_mode: Optional[Union[str, SeedingMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration(_Model): + availability_group_name: Optional[str] + primary_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration] + secondary_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration] + + @overload + def __init__( + self, + *, + availability_group_name: Optional[str] = ..., + primary_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration] = ..., + secondary_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.DtcSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "NONE" + PER_DB = "PER_DB" + + + class azure.mgmt.azurearcdata.models.EditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSINESS_INTELLIGENCE = "Business Intelligence" + DEVELOPER = "Developer" + ENTERPRISE = "Enterprise" + EVALUATION = "Evaluation" + EXPRESS = "Express" + STANDARD = "Standard" + STANDARD_DEVELOPER = "Standard Developer" + UNKNOWN = "Unknown" + WEB = "Web" + + + class azure.mgmt.azurearcdata.models.EncryptionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AES = "AES" + AES_RC4 = "AES, RC4" + NONE = "NONE" + NONE_AES = "NONE, AES" + NONE_AES_RC4 = "NONE, AES, RC4" + NONE_RC4 = "NONE, RC4" + NONE_RC4_AES = "NONE, RC4, AES" + RC4 = "RC4" + RC4_AES = "RC4, AES" + + + class azure.mgmt.azurearcdata.models.EntraAuthentication(_Model): + client_id: Optional[str] + identity_type: Optional[Union[str, IdentityType]] + + @overload + def __init__( + self, + *, + client_id: Optional[str] = ..., + identity_type: Optional[Union[str, IdentityType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.azurearcdata.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.azurearcdata.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.azurearcdata.models.ExecutionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RUNNING = "Running" + WAITING = "Waiting" + + + class azure.mgmt.azurearcdata.models.ExtendedLocation(_Model): + name: Optional[str] + type: Optional[Union[str, ExtendedLocationTypes]] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + type: Optional[Union[str, ExtendedLocationTypes]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM_LOCATION = "CustomLocation" + + + class azure.mgmt.azurearcdata.models.FailoverCluster(_Model): + host_ip_addresses: Optional[list[HostIPAddressInformation]] + host_names: Optional[list[str]] + id: Optional[str] + network_name: Optional[str] + sql_instance_ids: Optional[list[str]] + + + class azure.mgmt.azurearcdata.models.FailoverGroupPartnerSyncMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASYNC = "async" + SYNC = "sync" + + + class azure.mgmt.azurearcdata.models.FailoverGroupProperties(_Model): + partner_managed_instance_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + spec: FailoverGroupSpec + status: Optional[Any] + + @overload + def __init__( + self, + *, + partner_managed_instance_id: str, + spec: FailoverGroupSpec, + status: Optional[Any] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.FailoverGroupResource(ProxyResource): + id: str + name: str + properties: FailoverGroupProperties + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: FailoverGroupProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.FailoverGroupSpec(_Model): + partner_mi: Optional[str] + partner_mirroring_cert: Optional[str] + partner_mirroring_url: Optional[str] + partner_sync_mode: Optional[Union[str, FailoverGroupPartnerSyncMode]] + role: Union[str, InstanceFailoverGroupRole] + shared_name: Optional[str] + source_mi: Optional[str] + + @overload + def __init__( + self, + *, + partner_mi: Optional[str] = ..., + partner_mirroring_cert: Optional[str] = ..., + partner_mirroring_url: Optional[str] = ..., + partner_sync_mode: Optional[Union[str, FailoverGroupPartnerSyncMode]] = ..., + role: Union[str, InstanceFailoverGroupRole], + shared_name: Optional[str] = ..., + source_mi: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId(_Model): + force: Optional[bool] + managed_instance_id: Optional[str] + + @overload + def __init__( + self, + *, + force: Optional[bool] = ..., + managed_instance_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.FailureConditionLevel(int, Enum, metaclass=CaseInsensitiveEnumMeta): + FIVE = 5 + FOUR = 4 + ONE = 1 + THREE = 3 + TWO = 2 + + + class azure.mgmt.azurearcdata.models.HostIPAddressInformation(_Model): + ip_address: Optional[str] + subnet_mask: Optional[str] + + + class azure.mgmt.azurearcdata.models.HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AWS_KUBERNETES_SERVICE = "AWS Kubernetes Service" + AWS_VIRTUAL_MACHINE = "AWS Virtual Machine" + AWS_VM_WARE_VIRTUAL_MACHINE = "AWS VMWare Virtual Machine" + AZURE_KUBERNETES_SERVICE = "Azure Kubernetes Service" + AZURE_VIRTUAL_MACHINE = "Azure Virtual Machine" + AZURE_VM_WARE_VIRTUAL_MACHINE = "Azure VMWare Virtual Machine" + CONTAINER = "Container" + GCP_KUBERNETES_SERVICE = "GCP Kubernetes Service" + GCP_VIRTUAL_MACHINE = "GCP Virtual Machine" + GCP_VM_WARE_VIRTUAL_MACHINE = "GCP VMWare Virtual Machine" + HYPER_V_VIRTUAL_MACHINE = "Hyper-V Virtual Machine" + OTHER = "Other" + PHYSICAL_SERVER = "Physical Server" + VIRTUAL_MACHINE = "Virtual Machine" + + + class azure.mgmt.azurearcdata.models.IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM_ASSIGNED_MANAGED_IDENTITY = "SystemAssignedManagedIdentity" + USER_ASSIGNED_MANAGED_IDENTITY = "UserAssignedManagedIdentity" + + + class azure.mgmt.azurearcdata.models.ImpactedObjectsInfo(_Model): + feature_id: Optional[str] + issue_category: Optional[str] + number_impacted: Optional[int] + + @overload + def __init__( + self, + *, + feature_id: Optional[str] = ..., + issue_category: Optional[str] = ..., + number_impacted: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ImpactedObjectsSuitabilitySummary(_Model): + azure_sql_database: Optional[list[ImpactedObjectsInfo]] + azure_sql_managed_instance: Optional[list[ImpactedObjectsInfo]] + + + class azure.mgmt.azurearcdata.models.Infrastructure(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALIBABA = "alibaba" + AWS = "aws" + AZURE = "azure" + GCP = "gcp" + ONPREMISES = "onpremises" + OTHER = "other" + + + class azure.mgmt.azurearcdata.models.InitiatedFrom(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADS = "ADS" + AZURE_ARC = "Azure Arc" + DMS_CLI = "DMS-CLI" + DMS_PORTAL = "DMS-Portal" + DMS_PS = "DMS-PS" + DMS_SDK = "DMS-SDK" + OTHER = "Other" + SSMA = "SSMA" + SSMS = "SSMS" + + + class azure.mgmt.azurearcdata.models.InstanceFailoverGroupRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FORCE_PRIMARY_ALLOW_DATA_LOSS = "force-primary-allow-data-loss" + FORCE_SECONDARY = "force-secondary" + PRIMARY = "primary" + SECONDARY = "secondary" + + + class azure.mgmt.azurearcdata.models.JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NOT_STARTED = "NotStarted" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.azurearcdata.models.K8SActiveDirectory(_Model): + account_name: Optional[str] + connector: Optional[K8SActiveDirectoryConnector] + encryption_types: Optional[list[str]] + keytab_secret: Optional[str] + + @overload + def __init__( + self, + *, + account_name: Optional[str] = ..., + connector: Optional[K8SActiveDirectoryConnector] = ..., + encryption_types: Optional[list[str]] = ..., + keytab_secret: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SActiveDirectoryConnector(_Model): + name: Optional[str] + namespace: Optional[str] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + namespace: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SNetworkSettings(_Model): + forceencryption: Optional[int] + tlsciphers: Optional[str] + tlsprotocols: Optional[str] + + @overload + def __init__( + self, + *, + forceencryption: Optional[int] = ..., + tlsciphers: Optional[str] = ..., + tlsprotocols: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SResourceRequirements(_Model): + limits: Optional[dict[str, str]] + requests: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + limits: Optional[dict[str, str]] = ..., + requests: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SScheduling(_Model): + default: Optional[K8SSchedulingOptions] + + @overload + def __init__( + self, + *, + default: Optional[K8SSchedulingOptions] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SSchedulingOptions(_Model): + resources: Optional[K8SResourceRequirements] + + @overload + def __init__( + self, + *, + resources: Optional[K8SResourceRequirements] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SSecurity(_Model): + active_directory: Optional[K8SActiveDirectory] + admin_login_secret: Optional[str] + service_certificate_secret: Optional[str] + transparent_data_encryption: Optional[K8StransparentDataEncryption] + + @overload + def __init__( + self, + *, + active_directory: Optional[K8SActiveDirectory] = ..., + admin_login_secret: Optional[str] = ..., + service_certificate_secret: Optional[str] = ..., + transparent_data_encryption: Optional[K8StransparentDataEncryption] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8SSettings(_Model): + network: Optional[K8SNetworkSettings] + + @overload + def __init__( + self, + *, + network: Optional[K8SNetworkSettings] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.K8StransparentDataEncryption(_Model): + mode: Optional[str] + protector_secret: Optional[str] + + @overload + def __init__( + self, + *, + mode: Optional[str] = ..., + protector_secret: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.KeytabInformation(_Model): + keytab: Optional[str] + + @overload + def __init__( + self, + *, + keytab: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.LastExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + FAILED = "Failed" + FAULTED = "Faulted" + POSTPONED = "Postponed" + RESCHEDULED = "Rescheduled" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.azurearcdata.models.LicenseCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CORE = "Core" + + + class azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig(_Model): + primary_key: Optional[str] + workspace_id: Optional[str] + + @overload + def __init__( + self, + *, + primary_key: Optional[str] = ..., + workspace_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration(_Model): + availability_group: Optional[AvailabilityGroupCreateUpdateConfiguration] + distributed_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateConfiguration] + mi_link_configuration: Optional[MiLinkCreateUpdateConfiguration] + + @overload + def __init__( + self, + *, + availability_group: Optional[AvailabilityGroupCreateUpdateConfiguration] = ..., + distributed_availability_group: Optional[DistributedAvailabilityGroupCreateUpdateConfiguration] = ..., + mi_link_configuration: Optional[MiLinkCreateUpdateConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.MiLinkAssessmentCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOX_TO_MI_NETWORK_CONNECTIVITY = "BoxToMiNetworkConnectivity" + CERTIFICATES = "Certificates" + DAG_CROSS_VALIDATION = "DagCrossValidation" + MANAGED_INSTANCE = "ManagedInstance" + MANAGED_INSTANCE_CROSS_VALIDATION = "ManagedInstanceCrossValidation" + MANAGED_INSTANCE_DATABASE = "ManagedInstanceDatabase" + MI_TO_BOX_NETWORK_CONNECTIVITY = "MiToBoxNetworkConnectivity" + SQL_INSTANCE = "SqlInstance" + SQL_INSTANCE_AG = "SqlInstanceAg" + SQL_INSTANCE_DATABASE = "SqlInstanceDatabase" + + + class azure.mgmt.azurearcdata.models.MiLinkCreateUpdateConfiguration(_Model): + instance_availability_group_name: Optional[str] + + @overload + def __init__( + self, + *, + instance_availability_group_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.Migration(_Model): + assessment: Optional[MigrationAssessment] + target_resource_id: Optional[str] + target_selected_time: Optional[datetime] + + @overload + def __init__( + self, + *, + assessment: Optional[MigrationAssessment] = ..., + target_resource_id: Optional[str] = ..., + target_selected_time: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.MigrationAssessment(_Model): + assessment_upload_time: Optional[datetime] + assessment_viewed_time: Optional[datetime] + enabled: Optional[bool] + impacted_objects_summary: Optional[ImpactedObjectsSuitabilitySummary] + server_assessments: Optional[list[ServerAssessmentsItem]] + settings: Optional[MigrationAssessmentSettings] + sku_recommendation_results: Optional[SkuRecommendationResults] + target_recommendation_generation_time: Optional[datetime] + version: Optional[str] + + @overload + def __init__( + self, + *, + assessment_viewed_time: Optional[datetime] = ..., + enabled: Optional[bool] = ..., + impacted_objects_summary: Optional[ImpactedObjectsSuitabilitySummary] = ..., + settings: Optional[MigrationAssessmentSettings] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.MigrationAssessmentSettings(_Model): + comfort_factor: Optional[int] + cost_options: Optional[CostOptionSelectedValues] + currency: Optional[str] + discount_percentage: Optional[float] + lookback_period_in_days: Optional[int] + percentile: Optional[float] + strategy: Optional[str] + target_location: Optional[str] + + @overload + def __init__( + self, + *, + comfort_factor: Optional[int] = ..., + cost_options: Optional[CostOptionSelectedValues] = ..., + currency: Optional[str] = ..., + discount_percentage: Optional[float] = ..., + lookback_period_in_days: Optional[int] = ..., + percentile: Optional[float] = ..., + strategy: Optional[str] = ..., + target_location: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.MigrationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOGICAL = "Logical" + LOG_SHIPPING = "LogShipping" + MI_LINK = "MILink" + OTHER = "Other" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.MigrationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "Cancelled" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + IN_PROGRESS_WITH_WARNINGS = "InProgressWithWarnings" + NOT_STARTED = "NotStarted" + SUCCESSFUL = "Successful" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MIXED = "Mixed" + UNDEFINED = "Undefined" + WINDOWS = "Windows" + + + class azure.mgmt.azurearcdata.models.Monitoring(_Model): + enabled: Optional[bool] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.OnPremiseProperty(_Model): + id: str + public_signing_key: str + signing_certificate_thumbprint: Optional[str] + + @overload + def __init__( + self, + *, + id: str, + public_signing_key: str, + signing_certificate_thumbprint: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.Operation(_Model): + display: OperationDisplay + is_data_action: bool + name: str + origin: Optional[Union[str, OperationOrigin]] + properties: Optional[dict[str, Any]] + + @overload + def __init__( + self, + *, + display: OperationDisplay, + is_data_action: bool, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.OperationDisplay(_Model): + description: str + operation: str + provider: str + resource: str + + @overload + def __init__( + self, + *, + description: str, + operation: str, + provider: str, + resource: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + + + class azure.mgmt.azurearcdata.models.PostgresInstance(TrackedResource): + extended_location: Optional[ExtendedLocation] + id: str + location: str + name: str + properties: PostgresInstanceProperties + sku: Optional[PostgresInstanceSku] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: Optional[ExtendedLocation] = ..., + location: str, + properties: PostgresInstanceProperties, + sku: Optional[PostgresInstanceSku] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.PostgresInstanceProperties(_Model): + admin: Optional[str] + basic_login_information: Optional[BasicLoginInformation] + data_controller_id: Optional[str] + k8_s_raw: Optional[Any] + last_uploaded_date: Optional[datetime] + provisioning_state: Optional[str] + + @overload + def __init__( + self, + *, + admin: Optional[str] = ..., + basic_login_information: Optional[BasicLoginInformation] = ..., + data_controller_id: Optional[str] = ..., + k8_s_raw: Optional[Any] = ..., + last_uploaded_date: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.PostgresInstanceSku(CommonSku): + capacity: int + dev: bool + family: str + name: str + size: str + tier: Optional[Literal["Hyperscale"]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + dev: Optional[bool] = ..., + family: Optional[str] = ..., + name: str, + size: Optional[str] = ..., + tier: Optional[Literal[Hyperscale]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.PostgresInstanceUpdate(_Model): + properties: Optional[PostgresInstanceProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[PostgresInstanceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.PrimaryAllowConnections(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL = "ALL" + READ_WRITE = "READ_WRITE" + + + class azure.mgmt.azurearcdata.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.azurearcdata.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.azurearcdata.models.RecommendationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NOT_READY = "NotReady" + READY = "Ready" + READY_WITH_CONDITIONS = "ReadyWithConditions" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.RecoveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BULK_LOGGED = "Bulk-logged" + FULL = "Full" + SIMPLE = "Simple" + + + class azure.mgmt.azurearcdata.models.ReplicationPartnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SQLVM = "AzureSQLVM" + AZURE_SQL_MANAGED_INSTANCE = "AzureSQLManagedInstance" + SQL_SERVER = "SQLServer" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.azurearcdata.models.ResourceUpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SKIP_RESOURCE_UPDATE = "SkipResourceUpdate" + UPDATE_ALL_TARGET_RECOMMENDATION_DETAILS = "UpdateAllTargetRecommendationDetails" + + + class azure.mgmt.azurearcdata.models.Result(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + NOT_COMPLETED = "NotCompleted" + SKIPPED = "Skipped" + SUCCEEDED = "Succeeded" + TIMED_OUT = "TimedOut" + + + class azure.mgmt.azurearcdata.models.Role(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL = "ALL" + NONE = "NONE" + PARTNER = "PARTNER" + WITNESS = "WITNESS" + + + class azure.mgmt.azurearcdata.models.Schedule(_Model): + cron_trigger: Optional[CronTrigger] + enabled: Optional[bool] + + @overload + def __init__( + self, + *, + cron_trigger: Optional[CronTrigger] = ..., + enabled: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RESOURCE_GROUP = "ResourceGroup" + SUBSCRIPTION = "Subscription" + TENANT = "Tenant" + + + class azure.mgmt.azurearcdata.models.SecondaryAllowConnections(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALL = "ALL" + NO = "NO" + READ_ONLY = "READ_ONLY" + + + class azure.mgmt.azurearcdata.models.SeedingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTOMATIC = "AUTOMATIC" + MANUAL = "MANUAL" + + + class azure.mgmt.azurearcdata.models.SequencerAction(_Model): + action_id: Optional[str] + result: Optional[Union[str, Result]] + state: Optional[Union[str, SequencerState]] + + @overload + def __init__( + self, + *, + action_id: Optional[str] = ..., + result: Optional[Union[str, Result]] = ..., + state: Optional[Union[str, SequencerState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SequencerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + CREATING_SUCCESSORS = "CreatingSuccessors" + EXECUTING_ACTION = "ExecutingAction" + NOT_STARTED = "NotStarted" + WAITING_PREDECESSORS = "WaitingPredecessors" + + + class azure.mgmt.azurearcdata.models.ServerAssessmentsItem(_Model): + applies_to_migration_target_platform: Optional[str] + feature_id: Optional[str] + impacted_objects: Optional[list[ServerAssessmentsPropertiesItemsItem]] + issue_category: Optional[str] + more_information: Optional[str] + + @overload + def __init__( + self, + *, + applies_to_migration_target_platform: Optional[str] = ..., + feature_id: Optional[str] = ..., + impacted_objects: Optional[list[ServerAssessmentsPropertiesItemsItem]] = ..., + issue_category: Optional[str] = ..., + more_information: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ServerAssessmentsPropertiesItemsItem(_Model): + impact_detail: Optional[str] + name: Optional[str] + object_type: Optional[str] + + @overload + def __init__( + self, + *, + impact_detail: Optional[str] = ..., + name: Optional[str] = ..., + object_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.ServiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ENGINE = "Engine" + PBIRS = "PBIRS" + SSAS = "SSAS" + SSIS = "SSIS" + SSRS = "SSRS" + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResults(_Model): + azure_sql_database: Optional[SkuRecommendationResultsAzureSqlDatabase] + azure_sql_managed_instance: Optional[SkuRecommendationResultsAzureSqlManagedInstance] + azure_sql_virtual_machine: Optional[SkuRecommendationResultsAzureSqlVirtualMachine] + + @overload + def __init__( + self, + *, + azure_sql_database: Optional[SkuRecommendationResultsAzureSqlDatabase] = ..., + azure_sql_managed_instance: Optional[SkuRecommendationResultsAzureSqlManagedInstance] = ..., + azure_sql_virtual_machine: Optional[SkuRecommendationResultsAzureSqlVirtualMachine] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabase(_Model): + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] + monthly_cost_options: Optional[list[SkuRecommendationResultsMonthlyCostOptionItem]] + number_of_server_blocker_issues: Optional[int] + recommendation_status: Optional[Union[str, RecommendationStatus]] + target_sku: Optional[SkuRecommendationResultsAzureSqlDatabaseTargetSku] + + @overload + def __init__( + self, + *, + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] = ..., + number_of_server_blocker_issues: Optional[int] = ..., + recommendation_status: Optional[Union[str, RecommendationStatus]] = ..., + target_sku: Optional[SkuRecommendationResultsAzureSqlDatabaseTargetSku] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSku(_Model): + category: Optional[SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory] + compute_size: Optional[int] + max_storage_iops: Optional[float] + max_throughput_m_bps: Optional[float] + predicted_data_size_in_mb: Optional[float] + predicted_log_size_in_mb: Optional[float] + storage_max_size_in_mb: Optional[float] + + @overload + def __init__( + self, + *, + category: Optional[SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory] = ..., + compute_size: Optional[int] = ..., + max_storage_iops: Optional[float] = ..., + max_throughput_m_bps: Optional[float] = ..., + predicted_data_size_in_mb: Optional[float] = ..., + predicted_log_size_in_mb: Optional[float] = ..., + storage_max_size_in_mb: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory(_Model): + compute_tier: Optional[str] + hardware_type: Optional[str] + sql_purchasing_model: Optional[str] + sql_service_tier: Optional[str] + zone_redundancy_available: Optional[bool] + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = ..., + hardware_type: Optional[str] = ..., + sql_purchasing_model: Optional[str] = ..., + sql_service_tier: Optional[str] = ..., + zone_redundancy_available: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstance(_Model): + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] + monthly_cost_options: Optional[list[SkuRecommendationResultsMonthlyCostOptionItem]] + number_of_server_blocker_issues: Optional[int] + recommendation_status: Optional[Union[str, RecommendationStatus]] + target_sku: Optional[SkuRecommendationResultsAzureSqlManagedInstanceTargetSku] + + @overload + def __init__( + self, + *, + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] = ..., + number_of_server_blocker_issues: Optional[int] = ..., + recommendation_status: Optional[Union[str, RecommendationStatus]] = ..., + target_sku: Optional[SkuRecommendationResultsAzureSqlManagedInstanceTargetSku] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku(_Model): + category: Optional[SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory] + compute_size: Optional[int] + max_storage_iops: Optional[float] + max_throughput_m_bps: Optional[float] + predicted_data_size_in_mb: Optional[float] + predicted_log_size_in_mb: Optional[float] + storage_max_size_in_mb: Optional[float] + + @overload + def __init__( + self, + *, + category: Optional[SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory] = ..., + compute_size: Optional[int] = ..., + max_storage_iops: Optional[float] = ..., + max_throughput_m_bps: Optional[float] = ..., + predicted_data_size_in_mb: Optional[float] = ..., + predicted_log_size_in_mb: Optional[float] = ..., + storage_max_size_in_mb: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory(_Model): + compute_tier: Optional[str] + hardware_type: Optional[str] + sql_purchasing_model: Optional[str] + sql_service_tier: Optional[str] + zone_redundancy_available: Optional[bool] + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = ..., + hardware_type: Optional[str] = ..., + sql_purchasing_model: Optional[str] = ..., + sql_service_tier: Optional[str] = ..., + zone_redundancy_available: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachine(_Model): + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] + monthly_cost_options: Optional[list[SkuRecommendationResultsMonthlyCostOptionItem]] + number_of_server_blocker_issues: Optional[int] + recommendation_status: Optional[Union[str, RecommendationStatus]] + target_sku: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSku] + + @overload + def __init__( + self, + *, + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] = ..., + number_of_server_blocker_issues: Optional[int] = ..., + recommendation_status: Optional[Union[str, RecommendationStatus]] = ..., + target_sku: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSku] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku(_Model): + category: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory] + compute_size: Optional[int] + data_disk_sizes: Optional[list[DiskSizes]] + log_disk_sizes: Optional[list[DiskSizes]] + predicted_data_size_in_mb: Optional[float] + predicted_log_size_in_mb: Optional[float] + temp_db_disk_sizes: Optional[list[DiskSizes]] + virtual_machine_size: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize] + + @overload + def __init__( + self, + *, + category: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory] = ..., + compute_size: Optional[int] = ..., + data_disk_sizes: Optional[list[DiskSizes]] = ..., + log_disk_sizes: Optional[list[DiskSizes]] = ..., + predicted_data_size_in_mb: Optional[float] = ..., + predicted_log_size_in_mb: Optional[float] = ..., + temp_db_disk_sizes: Optional[list[DiskSizes]] = ..., + virtual_machine_size: Optional[SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory(_Model): + available_vm_skus: Optional[list[str]] + virtual_machine_family: Optional[str] + + @overload + def __init__( + self, + *, + available_vm_skus: Optional[list[str]] = ..., + virtual_machine_family: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize(_Model): + azure_sku_name: Optional[str] + compute_size: Optional[int] + max_network_interfaces: Optional[int] + size_name: Optional[str] + v_cpus_available: Optional[int] + virtual_machine_family: Optional[str] + + @overload + def __init__( + self, + *, + azure_sku_name: Optional[str] = ..., + compute_size: Optional[int] = ..., + max_network_interfaces: Optional[int] = ..., + size_name: Optional[str] = ..., + v_cpus_available: Optional[int] = ..., + virtual_machine_family: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost(_Model): + compute_cost: Optional[float] + iops_cost: Optional[float] + sql_license_cost: Optional[float] + storage_cost: Optional[float] + total_cost: Optional[float] + windows_license_cost: Optional[float] + + @overload + def __init__( + self, + *, + compute_cost: Optional[float] = ..., + iops_cost: Optional[float] = ..., + sql_license_cost: Optional[float] = ..., + storage_cost: Optional[float] = ..., + total_cost: Optional[float] = ..., + windows_license_cost: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem(_Model): + key_name: Optional[str] + key_value: Optional[CostTypeValues] + + @overload + def __init__( + self, + *, + key_name: Optional[str] = ..., + key_value: Optional[CostTypeValues] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationSummary(_Model): + impacted_objects_summary: Optional[list[ImpactedObjectsInfo]] + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] + monthly_cost_options: Optional[list[SkuRecommendationResultsMonthlyCostOptionItem]] + num_of_blocker_issues: Optional[int] + recommendation_status: Optional[Union[str, RecommendationStatus]] + target_sku: Optional[SkuRecommendationSummaryTargetSku] + + @overload + def __init__( + self, + *, + monthly_cost: Optional[SkuRecommendationResultsMonthlyCost] = ..., + num_of_blocker_issues: Optional[int] = ..., + recommendation_status: Optional[Union[str, RecommendationStatus]] = ..., + target_sku: Optional[SkuRecommendationSummaryTargetSku] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSku(_Model): + category: Optional[SkuRecommendationSummaryTargetSkuCategory] + compute_size: Optional[int] + max_storage_iops: Optional[float] + max_throughput_m_bps: Optional[float] + predicted_data_size_in_mb: Optional[float] + predicted_log_size_in_mb: Optional[float] + storage_max_size_in_mb: Optional[float] + + @overload + def __init__( + self, + *, + category: Optional[SkuRecommendationSummaryTargetSkuCategory] = ..., + compute_size: Optional[int] = ..., + max_storage_iops: Optional[float] = ..., + max_throughput_m_bps: Optional[float] = ..., + predicted_data_size_in_mb: Optional[float] = ..., + predicted_log_size_in_mb: Optional[float] = ..., + storage_max_size_in_mb: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSkuCategory(_Model): + compute_tier: Optional[str] + hardware_type: Optional[str] + sql_purchasing_model: Optional[str] + sql_service_tier: Optional[str] + zone_redundancy_available: Optional[bool] + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = ..., + hardware_type: Optional[str] = ..., + sql_purchasing_model: Optional[str] = ..., + sql_service_tier: Optional[str] = ..., + zone_redundancy_available: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlAvailabilityGroupDatabaseReplicaResourceProperties(_Model): + database_name: Optional[str] + database_state_description: Optional[str] + is_commit_participant: Optional[bool] + is_local: Optional[bool] + is_primary_replica: Optional[bool] + is_suspended: Optional[bool] + replica_name: Optional[str] + suspend_reason_description: Optional[str] + synchronization_health_description: Optional[str] + synchronization_state_description: Optional[str] + + @overload + def __init__( + self, + *, + database_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem(_Model): + ip_address: Optional[str] + mask: Optional[str] + + @overload + def __init__( + self, + *, + ip_address: Optional[str] = ..., + mask: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlAvailabilityGroupReplicaResourceProperties(_Model): + configure: Optional[AvailabilityGroupConfigure] + replica_id: Optional[str] + replica_name: Optional[str] + replica_resource_id: Optional[str] + state: Optional[AvailabilityGroupState] + + @overload + def __init__( + self, + *, + configure: Optional[AvailabilityGroupConfigure] = ..., + replica_name: Optional[str] = ..., + replica_resource_id: Optional[str] = ..., + state: Optional[AvailabilityGroupState] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlAvailabilityGroupStaticIPListenerProperties(_Model): + dns_name: Optional[str] + ip_v4_addresses_and_masks: Optional[list[SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem]] + ip_v6_addresses: Optional[list[str]] + port: Optional[int] + + @overload + def __init__( + self, + *, + dns_name: Optional[str] = ..., + ip_v4_addresses_and_masks: Optional[list[SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem]] = ..., + ip_v6_addresses: Optional[list[str]] = ..., + port: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstance(TrackedResource): + extended_location: Optional[ExtendedLocation] + id: str + location: str + name: str + properties: SqlManagedInstanceProperties + sku: Optional[SqlManagedInstanceSku] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: Optional[ExtendedLocation] = ..., + location: str, + properties: SqlManagedInstanceProperties, + sku: Optional[SqlManagedInstanceSku] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw(_Model): + spec: Optional[SqlManagedInstanceK8SSpec] + + @overload + def __init__( + self, + *, + spec: Optional[SqlManagedInstanceK8SSpec] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec(_Model): + replicas: Optional[int] + scheduling: Optional[K8SScheduling] + security: Optional[K8SSecurity] + settings: Optional[K8SSettings] + + @overload + def __init__( + self, + *, + replicas: Optional[int] = ..., + scheduling: Optional[K8SScheduling] = ..., + security: Optional[K8SSecurity] = ..., + settings: Optional[K8SSettings] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties(_Model): + active_directory_information: Optional[ActiveDirectoryInformation] + admin: Optional[str] + basic_login_information: Optional[BasicLoginInformation] + cluster_id: Optional[str] + data_controller_id: Optional[str] + end_time: Optional[str] + extension_id: Optional[str] + k8_s_raw: Optional[SqlManagedInstanceK8SRaw] + last_uploaded_date: Optional[datetime] + license_type: Optional[Union[str, ArcSqlManagedInstanceLicenseType]] + provisioning_state: Optional[str] + start_time: Optional[str] + + @overload + def __init__( + self, + *, + active_directory_information: Optional[ActiveDirectoryInformation] = ..., + admin: Optional[str] = ..., + basic_login_information: Optional[BasicLoginInformation] = ..., + cluster_id: Optional[str] = ..., + data_controller_id: Optional[str] = ..., + end_time: Optional[str] = ..., + extension_id: Optional[str] = ..., + k8_s_raw: Optional[SqlManagedInstanceK8SRaw] = ..., + last_uploaded_date: Optional[datetime] = ..., + license_type: Optional[Union[str, ArcSqlManagedInstanceLicenseType]] = ..., + start_time: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceSku(_Model): + capacity: Optional[int] + dev: Optional[bool] + family: Optional[str] + name: Literal["vCore"] + size: Optional[str] + tier: Optional[Union[str, SqlManagedInstanceSkuTier]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + dev: Optional[bool] = ..., + family: Optional[str] = ..., + size: Optional[str] = ..., + tier: Optional[Union[str, SqlManagedInstanceSkuTier]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BUSINESS_CRITICAL = "BusinessCritical" + GENERAL_PURPOSE = "GeneralPurpose" + + + class azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate(_Model): + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource(TrackedResource): + id: str + location: str + name: str + properties: SqlServerAvailabilityGroupResourceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: SqlServerAvailabilityGroupResourceProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourceProperties(_Model): + availability_group_id: Optional[str] + collection_timestamp: Optional[datetime] + databases: Optional[SqlServerAvailabilityGroupResourcePropertiesDatabases] + info: Optional[AvailabilityGroupInfo] + instance_name: Optional[str] + provisioning_state: Optional[str] + replicas: Optional[SqlServerAvailabilityGroupResourcePropertiesReplicas] + server_name: Optional[str] + vm_id: Optional[str] + + @overload + def __init__( + self, + *, + databases: Optional[SqlServerAvailabilityGroupResourcePropertiesDatabases] = ..., + info: Optional[AvailabilityGroupInfo] = ..., + replicas: Optional[SqlServerAvailabilityGroupResourcePropertiesReplicas] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesDatabases(_Model): + next_link: Optional[str] + value: Optional[list[SqlAvailabilityGroupDatabaseReplicaResourceProperties]] + + @overload + def __init__( + self, + *, + value: Optional[list[SqlAvailabilityGroupDatabaseReplicaResourceProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesReplicas(_Model): + next_link: Optional[str] + value: Optional[list[SqlAvailabilityGroupReplicaResourceProperties]] + + @overload + def __init__( + self, + *, + value: Optional[list[SqlAvailabilityGroupReplicaResourceProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate(_Model): + properties: Optional[SqlServerAvailabilityGroupResourceProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[SqlServerAvailabilityGroupResourceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerDatabaseResource(TrackedResource): + id: str + location: str + name: str + properties: SqlServerDatabaseResourceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: SqlServerDatabaseResourceProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerDatabaseResourceProperties(_Model): + backup_information: Optional[SqlServerDatabaseResourcePropertiesBackupInformation] + backup_policy: Optional[BackupPolicy] + collation_name: Optional[str] + compatibility_level: Optional[int] + create_mode: Optional[Union[str, DatabaseCreateMode]] + data_file_size_mb: Optional[float] + database_creation_date: Optional[datetime] + database_options: Optional[SqlServerDatabaseResourcePropertiesDatabaseOptions] + earliest_restore_date: Optional[datetime] + is_read_only: Optional[bool] + last_database_upload_time: Optional[datetime] + log_file_size_mb: Optional[float] + migration: Optional[DataBaseMigration] + provisioning_state: Optional[str] + recovery_mode: Optional[Union[str, RecoveryMode]] + restore_point_in_time: Optional[datetime] + size_mb: Optional[float] + source_database_id: Optional[str] + space_available_mb: Optional[float] + state: Optional[Union[str, DatabaseState]] + vm_id: Optional[str] + + @overload + def __init__( + self, + *, + backup_information: Optional[SqlServerDatabaseResourcePropertiesBackupInformation] = ..., + backup_policy: Optional[BackupPolicy] = ..., + collation_name: Optional[str] = ..., + compatibility_level: Optional[int] = ..., + create_mode: Optional[Union[str, DatabaseCreateMode]] = ..., + data_file_size_mb: Optional[float] = ..., + database_creation_date: Optional[datetime] = ..., + database_options: Optional[SqlServerDatabaseResourcePropertiesDatabaseOptions] = ..., + is_read_only: Optional[bool] = ..., + log_file_size_mb: Optional[float] = ..., + migration: Optional[DataBaseMigration] = ..., + recovery_mode: Optional[Union[str, RecoveryMode]] = ..., + restore_point_in_time: Optional[datetime] = ..., + size_mb: Optional[float] = ..., + source_database_id: Optional[str] = ..., + space_available_mb: Optional[float] = ..., + state: Optional[Union[str, DatabaseState]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesBackupInformation(_Model): + last_full_backup: Optional[datetime] + last_log_backup: Optional[datetime] + + @overload + def __init__( + self, + *, + last_full_backup: Optional[datetime] = ..., + last_log_backup: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesDatabaseOptions(_Model): + is_auto_close_on: Optional[bool] + is_auto_create_stats_on: Optional[bool] + is_auto_shrink_on: Optional[bool] + is_auto_update_stats_on: Optional[bool] + is_encrypted: Optional[bool] + is_hekaton_files_on: Optional[bool] + is_memory_optimization_enabled: Optional[bool] + is_remote_data_archive_enabled: Optional[bool] + is_trustworthy_on: Optional[bool] + number_of_hekaton_files: Optional[int] + + @overload + def __init__( + self, + *, + is_auto_close_on: Optional[bool] = ..., + is_auto_create_stats_on: Optional[bool] = ..., + is_auto_shrink_on: Optional[bool] = ..., + is_auto_update_stats_on: Optional[bool] = ..., + is_encrypted: Optional[bool] = ..., + is_hekaton_files_on: Optional[bool] = ..., + is_memory_optimization_enabled: Optional[bool] = ..., + is_remote_data_archive_enabled: Optional[bool] = ..., + is_trustworthy_on: Optional[bool] = ..., + number_of_hekaton_files: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate(_Model): + properties: Optional[SqlServerDatabaseResourceProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[SqlServerDatabaseResourceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerEsuLicense(TrackedResource): + id: str + location: str + name: str + properties: SqlServerEsuLicenseProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: SqlServerEsuLicenseProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerEsuLicenseProperties(_Model): + activated_at: Optional[datetime] + activation_state: Union[str, State] + billing_plan: Union[str, BillingPlan] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: Optional[str] + terminated_at: Optional[datetime] + unique_id: Optional[str] + version: Union[str, Version] + + @overload + def __init__( + self, + *, + activation_state: Union[str, State], + billing_plan: Union[str, BillingPlan], + physical_cores: int, + scope_type: Union[str, ScopeType], + version: Union[str, Version] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate(_Model): + properties: Optional[SqlServerEsuLicenseUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[SqlServerEsuLicenseUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdateProperties(_Model): + activated_at: Optional[datetime] + activation_state: Optional[Union[str, State]] + billing_plan: Optional[Union[str, BillingPlan]] + physical_cores: Optional[int] + scope_type: Optional[Union[str, ScopeType]] + tenant_id: Optional[str] + terminated_at: Optional[datetime] + unique_id: Optional[str] + version: Optional[Union[str, Version]] + + @overload + def __init__( + self, + *, + activation_state: Optional[Union[str, State]] = ..., + billing_plan: Optional[Union[str, BillingPlan]] = ..., + physical_cores: Optional[int] = ..., + scope_type: Optional[Union[str, ScopeType]] = ..., + version: Optional[Union[str, Version]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstance(TrackedResource): + id: str + location: str + name: str + properties: Optional[SqlServerInstanceProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[SqlServerInstanceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceBpaColumn(_Model): + name: Optional[str] + type: Optional[Union[str, SqlServerInstanceBpaColumnType]] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + type: Optional[Union[str, SqlServerInstanceBpaColumnType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceBpaColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOOL = "bool" + DATETIME = "datetime" + DOUBLE = "double" + GUID = "guid" + INT = "int" + LONG = "long" + STRING = "string" + TIMESPAN = "timespan" + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceBpaQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASIC = "Basic" + HISTORICAL_TRENDS = "HistoricalTrends" + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceBpaReportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSESSMENT_DATA_POINT = "AssessmentDataPoint" + ASSESSMENT_SUMMARY = "AssessmentSummary" + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest(_Model): + query_type: Optional[Union[str, SqlServerInstanceBpaQueryType]] + report_id: Optional[str] + report_type: Optional[Union[str, SqlServerInstanceBpaReportType]] + skip_token: Optional[str] + + @overload + def __init__( + self, + *, + query_type: Optional[Union[str, SqlServerInstanceBpaQueryType]] = ..., + report_id: Optional[str] = ..., + report_type: Optional[Union[str, SqlServerInstanceBpaReportType]] = ..., + skip_token: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJob(_Model): + background_job: Optional[BackgroundJob] + id: Optional[str] + instance_name: Optional[str] + job_exception: Optional[str] + job_status: Optional[Union[str, JobStatus]] + sequencer_actions: Optional[list[SequencerAction]] + + @overload + def __init__( + self, + *, + background_job: Optional[BackgroundJob] = ..., + id: Optional[str] = ..., + instance_name: Optional[str] = ..., + job_exception: Optional[str] = ..., + job_status: Optional[Union[str, JobStatus]] = ..., + sequencer_actions: Optional[list[SequencerAction]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJobStatus(_Model): + background_job: Optional[BackgroundJob] + id: Optional[str] + instance_name: Optional[str] + job_exception: Optional[str] + job_status: Optional[Union[str, JobStatus]] + sequencer_actions: Optional[list[SequencerAction]] + + @overload + def __init__( + self, + *, + background_job: Optional[BackgroundJob] = ..., + id: Optional[str] = ..., + instance_name: Optional[str] = ..., + job_exception: Optional[str] = ..., + job_status: Optional[Union[str, JobStatus]] = ..., + sequencer_actions: Optional[list[SequencerAction]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest(_Model): + feature_name: Optional[str] + job_type: Optional[str] + + @overload + def __init__( + self, + *, + feature_name: Optional[str] = ..., + job_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse(_Model): + jobs: Optional[list[SqlServerInstanceJob]] + + @overload + def __init__( + self, + *, + jobs: Optional[list[SqlServerInstanceJob]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest(_Model): + feature_name: Optional[str] + job_type: Optional[str] + + @overload + def __init__( + self, + *, + feature_name: Optional[str] = ..., + job_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse(_Model): + jobs_status: Optional[list[SqlServerInstanceJobStatus]] + + @overload + def __init__( + self, + *, + jobs_status: Optional[list[SqlServerInstanceJobStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessment(_Model): + additional_information: Optional[str] + category: Optional[Union[str, MiLinkAssessmentCategory]] + failing_dbs: Optional[list[str]] + information: Optional[str] + name: Optional[str] + status: Optional[Union[str, AssessmentStatus]] + + @overload + def __init__( + self, + *, + additional_information: Optional[str] = ..., + category: Optional[Union[str, MiLinkAssessmentCategory]] = ..., + failing_dbs: Optional[list[str]] = ..., + information: Optional[str] = ..., + name: Optional[str] = ..., + status: Optional[Union[str, AssessmentStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest(_Model): + assessment_categories: Optional[list[Union[str, MiLinkAssessmentCategory]]] + availability_group_name: str + azure_managed_instance_resource_id: str + azure_managed_instance_role: Optional[Union[str, AzureManagedInstanceRole]] + database_names: list[str] + distributed_availability_group_name: str + sql_server_ip_address: Optional[str] + + @overload + def __init__( + self, + *, + assessment_categories: Optional[list[Union[str, MiLinkAssessmentCategory]]] = ..., + availability_group_name: str, + azure_managed_instance_resource_id: str, + azure_managed_instance_role: Optional[Union[str, AzureManagedInstanceRole]] = ..., + database_names: list[str], + distributed_availability_group_name: str, + sql_server_ip_address: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse(_Model): + assessments: Optional[list[SqlServerInstanceManagedInstanceLinkAssessment]] + + @overload + def __init__( + self, + *, + assessments: Optional[list[SqlServerInstanceManagedInstanceLinkAssessment]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceMigrationReadinessReportResponse(_Model): + created_time: Optional[datetime] + is_compressed: Optional[bool] + report: Optional[str] + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceProperties(_Model): + always_on_role: Optional[Union[str, AlwaysOnRole]] + authentication: Optional[Authentication] + azure_defender_status: Optional[Union[str, DefenderStatus]] + azure_defender_status_last_updated: Optional[datetime] + backup_policy: Optional[BackupPolicy] + best_practices_assessment: Optional[BestPracticesAssessment] + client_connection: Optional[ClientConnection] + collation: Optional[str] + container_resource_id: Optional[str] + cores: Optional[str] + create_time: Optional[str] + current_version: Optional[str] + database_mirroring_endpoint: Optional[DBMEndpoint] + db_master_key_exists: Optional[bool] + discovery_source: Optional[Union[str, DiscoverySource]] + edition: Optional[Union[str, EditionType]] + failover_cluster: Optional[FailoverCluster] + host_type: Optional[Union[str, HostType]] + instance_name: Optional[str] + is_digi_cert_pki_cert_trust_configured: Optional[bool] + is_hadr_enabled: Optional[bool] + is_microsoft_pki_cert_trust_configured: Optional[bool] + last_inventory_upload_time: Optional[datetime] + last_usage_upload_time: Optional[datetime] + license_type: Optional[Union[str, ArcSqlServerLicenseType]] + max_server_memory_mb: Optional[int] + migration: Optional[Migration] + monitoring: Optional[Monitoring] + patch_level: Optional[str] + product_id: Optional[str] + provisioning_state: Optional[str] + service_type: Optional[Union[str, ServiceType]] + status: Optional[Union[str, ConnectionStatus]] + tcp_dynamic_ports: Optional[str] + tcp_static_ports: Optional[str] + trace_flags: Optional[list[int]] + upgrade_locked_until: Optional[datetime] + v_core: Optional[str] + version: Optional[Union[str, SqlVersion]] + vm_id: Optional[str] + + @overload + def __init__( + self, + *, + authentication: Optional[Authentication] = ..., + backup_policy: Optional[BackupPolicy] = ..., + best_practices_assessment: Optional[BestPracticesAssessment] = ..., + client_connection: Optional[ClientConnection] = ..., + cores: Optional[str] = ..., + database_mirroring_endpoint: Optional[DBMEndpoint] = ..., + discovery_source: Optional[Union[str, DiscoverySource]] = ..., + edition: Optional[Union[str, EditionType]] = ..., + failover_cluster: Optional[FailoverCluster] = ..., + host_type: Optional[Union[str, HostType]] = ..., + instance_name: Optional[str] = ..., + migration: Optional[Migration] = ..., + monitoring: Optional[Monitoring] = ..., + service_type: Optional[Union[str, ServiceType]] = ..., + upgrade_locked_until: Optional[datetime] = ..., + version: Optional[Union[str, SqlVersion]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse(_Model): + background_job: Optional[BackgroundJob] + id: Optional[str] + instance_name: Optional[str] + job_exception: Optional[str] + job_status: Optional[Union[str, JobStatus]] + sequencer_actions: Optional[list[SequencerAction]] + + @overload + def __init__( + self, + *, + background_job: Optional[BackgroundJob] = ..., + id: Optional[str] = ..., + instance_name: Optional[str] = ..., + job_exception: Optional[str] = ..., + job_status: Optional[Union[str, JobStatus]] = ..., + sequencer_actions: Optional[list[SequencerAction]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationAssessmentResponse(_Model): + background_job: Optional[BackgroundJob] + id: Optional[str] + instance_name: Optional[str] + job_exception: Optional[str] + job_status: Optional[Union[str, JobStatus]] + sequencer_actions: Optional[list[SequencerAction]] + + @overload + def __init__( + self, + *, + background_job: Optional[BackgroundJob] = ..., + id: Optional[str] = ..., + instance_name: Optional[str] = ..., + job_exception: Optional[str] = ..., + job_status: Optional[Union[str, JobStatus]] = ..., + sequencer_actions: Optional[list[SequencerAction]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationReadinessAssessmentResponse(_Model): + background_job: Optional[BackgroundJob] + id: Optional[str] + instance_name: Optional[str] + job_exception: Optional[str] + job_status: Optional[Union[str, JobStatus]] + sequencer_actions: Optional[list[SequencerAction]] + + @overload + def __init__( + self, + *, + background_job: Optional[BackgroundJob] = ..., + id: Optional[str] = ..., + instance_name: Optional[str] = ..., + job_exception: Optional[str] = ..., + job_status: Optional[Union[str, JobStatus]] = ..., + sequencer_actions: Optional[list[SequencerAction]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest(_Model): + include_file_level_requirements: Optional[bool] + lookback_period_in_days: Optional[int] + percentile: Optional[int] + resource_update_mode: Optional[Union[str, ResourceUpdateMode]] + target_location: Optional[str] + + @overload + def __init__( + self, + *, + include_file_level_requirements: Optional[bool] = ..., + lookback_period_in_days: Optional[int] = ..., + percentile: Optional[int] = ..., + resource_update_mode: Optional[Union[str, ResourceUpdateMode]] = ..., + target_location: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse(_Model): + job_status: Optional[Union[str, JobStatus]] + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReport(_Model): + created_time: Optional[datetime] + report_id: Optional[str] + sections: Optional[list[SqlServerInstanceTargetRecommendationReportSection]] + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSection(_Model): + data: Optional[str] + database_name: Optional[str] + is_compressed: Optional[bool] + type: Optional[Union[str, SqlServerInstanceTargetRecommendationReportSectionType]] + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_REQUIREMENTS_PER_DATABASE = "FileRequirementsPerDatabase" + REQUIREMENTS_PER_DATABASE = "RequirementsPerDatabase" + REQUIREMENTS_PER_INSTANCE = "RequirementsPerInstance" + SQL_DB_TARGET_RECOMMENDATION_PER_DATABASE = "SqlDbTargetRecommendationPerDatabase" + SQL_MI_TARGET_RECOMMENDATION_PER_INSTANCE = "SqlMiTargetRecommendationPerInstance" + SQL_VM_TARGET_RECOMMENDATION_PER_INSTANCE = "SqlVmTargetRecommendationPerInstance" + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest(_Model): + database_names: Optional[list[str]] + report_offset: Optional[int] + section_offset: Optional[int] + section_type: Optional[Union[str, SqlServerInstanceTargetRecommendationReportSectionType]] + + @overload + def __init__( + self, + *, + database_names: Optional[list[str]] = ..., + report_offset: Optional[int] = ..., + section_offset: Optional[int] = ..., + section_type: Optional[Union[str, SqlServerInstanceTargetRecommendationReportSectionType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse(_Model): + job_status: Optional[Union[str, JobStatus]] + next_report_offset: Optional[int] + next_section_offset: Optional[int] + reports: Optional[list[SqlServerInstanceTargetRecommendationReport]] + total_report_count: Optional[int] + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryColumn(_Model): + name: Optional[str] + type: Optional[Union[str, SqlServerInstanceTelemetryColumnType]] + + @overload + def __init__( + self, + *, + name: Optional[str] = ..., + type: Optional[Union[str, SqlServerInstanceTelemetryColumnType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BOOL = "bool" + DATETIME = "datetime" + DOUBLE = "double" + GUID = "guid" + INT = "int" + LONG = "long" + STRING = "string" + TIMESPAN = "timespan" + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest(_Model): + aggregation_type: Optional[Union[str, AggregationType]] + database_names: Optional[list[str]] + dataset_name: str + end_time: Optional[datetime] + interval: Optional[timedelta] + start_time: Optional[datetime] + + @overload + def __init__( + self, + *, + aggregation_type: Optional[Union[str, AggregationType]] = ..., + database_names: Optional[list[str]] = ..., + dataset_name: str, + end_time: Optional[datetime] = ..., + interval: Optional[timedelta] = ..., + start_time: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate(_Model): + properties: Optional[SqlServerInstanceUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[SqlServerInstanceUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerInstanceUpdateProperties(_Model): + always_on_role: Optional[Union[str, AlwaysOnRole]] + authentication: Optional[Authentication] + azure_defender_status: Optional[Union[str, DefenderStatus]] + azure_defender_status_last_updated: Optional[datetime] + backup_policy: Optional[BackupPolicy] + best_practices_assessment: Optional[BestPracticesAssessment] + client_connection: Optional[ClientConnection] + collation: Optional[str] + container_resource_id: Optional[str] + cores: Optional[str] + create_time: Optional[str] + current_version: Optional[str] + database_mirroring_endpoint: Optional[DBMEndpoint] + db_master_key_exists: Optional[bool] + discovery_source: Optional[Union[str, DiscoverySource]] + edition: Optional[Union[str, EditionType]] + failover_cluster: Optional[FailoverCluster] + host_type: Optional[Union[str, HostType]] + instance_name: Optional[str] + is_digi_cert_pki_cert_trust_configured: Optional[bool] + is_hadr_enabled: Optional[bool] + is_microsoft_pki_cert_trust_configured: Optional[bool] + last_inventory_upload_time: Optional[datetime] + last_usage_upload_time: Optional[datetime] + license_type: Optional[Union[str, ArcSqlServerLicenseType]] + max_server_memory_mb: Optional[int] + migration: Optional[Migration] + monitoring: Optional[Monitoring] + patch_level: Optional[str] + product_id: Optional[str] + provisioning_state: Optional[str] + service_type: Optional[Union[str, ServiceType]] + status: Optional[Union[str, ConnectionStatus]] + tcp_dynamic_ports: Optional[str] + tcp_static_ports: Optional[str] + trace_flags: Optional[list[int]] + upgrade_locked_until: Optional[datetime] + v_core: Optional[str] + version: Optional[Union[str, SqlVersion]] + vm_id: Optional[str] + + @overload + def __init__( + self, + *, + authentication: Optional[Authentication] = ..., + backup_policy: Optional[BackupPolicy] = ..., + best_practices_assessment: Optional[BestPracticesAssessment] = ..., + client_connection: Optional[ClientConnection] = ..., + cores: Optional[str] = ..., + database_mirroring_endpoint: Optional[DBMEndpoint] = ..., + discovery_source: Optional[Union[str, DiscoverySource]] = ..., + edition: Optional[Union[str, EditionType]] = ..., + failover_cluster: Optional[FailoverCluster] = ..., + host_type: Optional[Union[str, HostType]] = ..., + instance_name: Optional[str] = ..., + is_digi_cert_pki_cert_trust_configured: Optional[bool] = ..., + is_microsoft_pki_cert_trust_configured: Optional[bool] = ..., + max_server_memory_mb: Optional[int] = ..., + migration: Optional[Migration] = ..., + monitoring: Optional[Monitoring] = ..., + service_type: Optional[Union[str, ServiceType]] = ..., + upgrade_locked_until: Optional[datetime] = ..., + version: Optional[Union[str, SqlVersion]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerLicense(TrackedResource): + id: str + location: str + name: str + properties: SqlServerLicenseProperties + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: SqlServerLicenseProperties, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerLicenseProperties(_Model): + activation_state: Union[str, ActivationState] + billing_plan: Union[str, BillingPlan] + last_activated_at: Optional[datetime] + last_deactivated_at: Optional[datetime] + license_category: Union[str, LicenseCategory] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + activation_state: Union[str, ActivationState], + billing_plan: Union[str, BillingPlan], + license_category: Union[str, LicenseCategory], + physical_cores: int, + scope_type: Union[str, ScopeType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate(_Model): + properties: Optional[SqlServerLicenseUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[SqlServerLicenseUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlServerLicenseUpdateProperties(_Model): + activation_state: Optional[Union[str, ActivationState]] + billing_plan: Optional[Union[str, BillingPlan]] + last_activated_at: Optional[datetime] + last_deactivated_at: Optional[datetime] + license_category: Optional[Union[str, LicenseCategory]] + physical_cores: Optional[int] + scope_type: Optional[Union[str, ScopeType]] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + activation_state: Optional[Union[str, ActivationState]] = ..., + billing_plan: Optional[Union[str, BillingPlan]] = ..., + license_category: Optional[Union[str, LicenseCategory]] = ..., + physical_cores: Optional[int] = ..., + scope_type: Optional[Union[str, ScopeType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.SqlVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SQL_SERVER2012 = "SQL Server 2012" + SQL_SERVER2014 = "SQL Server 2014" + SQL_SERVER2016 = "SQL Server 2016" + SQL_SERVER2017 = "SQL Server 2017" + SQL_SERVER2019 = "SQL Server 2019" + SQL_SERVER2022 = "SQL Server 2022" + SQL_SERVER2025 = "SQL Server 2025" + UNKNOWN = "Unknown" + + + class azure.mgmt.azurearcdata.models.State(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + COMPLETED = "Completed" + DELETED = "Deleted" + DISABLED = "Disabled" + ENABLED = "Enabled" + FAULTED = "Faulted" + INACTIVE = "Inactive" + SUSPENDED = "Suspended" + TERMINATED = "Terminated" + + + class azure.mgmt.azurearcdata.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.azurearcdata.models.TargetReadiness(_Model): + azure_sql_database: Optional[SkuRecommendationSummary] + azure_sql_managed_instance: Optional[SkuRecommendationSummary] + azure_sql_virtual_machine: Optional[SkuRecommendationSummary] + + @overload + def __init__( + self, + *, + azure_sql_database: Optional[SkuRecommendationSummary] = ..., + azure_sql_managed_instance: Optional[SkuRecommendationSummary] = ..., + azure_sql_virtual_machine: Optional[SkuRecommendationSummary] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.TargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SQL_DATABASE = "AzureSqlDatabase" + AZURE_SQL_MANAGED_INSTANCE = "AzureSqlManagedInstance" + AZURE_SQL_VIRTUAL_MACHINE = "AzureSqlVirtualMachine" + + + class azure.mgmt.azurearcdata.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.azurearcdata.models.UploadServicePrincipal(_Model): + authority: Optional[str] + client_id: Optional[str] + client_secret: Optional[str] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + authority: Optional[str] = ..., + client_id: Optional[str] = ..., + client_secret: Optional[str] = ..., + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.UploadWatermark(_Model): + logs: Optional[datetime] + metrics: Optional[datetime] + usages: Optional[datetime] + + @overload + def __init__( + self, + *, + logs: Optional[datetime] = ..., + metrics: Optional[datetime] = ..., + usages: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.azurearcdata.models.Version(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SQL_SERVER2012 = "SQL Server 2012" + SQL_SERVER2014 = "SQL Server 2014" + SQL_SERVER2016 = "SQL Server 2016" + + +namespace azure.mgmt.azurearcdata.operations + + class azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ActiveDirectoryConnectorResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ActiveDirectoryConnectorResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ActiveDirectoryConnectorResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + **kwargs: Any + ) -> ActiveDirectoryConnectorResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> ItemPaged[ActiveDirectoryConnectorResource]: ... + + + class azure.mgmt.azurearcdata.operations.DataControllersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @overload + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @overload + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @overload + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @overload + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @overload + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[DataControllerResource]: ... + + @distributed_trace + def get_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + **kwargs: Any + ) -> DataControllerResource: ... + + @distributed_trace + def list_in_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[DataControllerResource]: ... + + @distributed_trace + def list_in_subscription(self, **kwargs: Any) -> ItemPaged[DataControllerResource]: ... + + + class azure.mgmt.azurearcdata.operations.FailoverGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverGroupResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverGroupResource]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[FailoverGroupResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + **kwargs: Any + ) -> FailoverGroupResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> ItemPaged[FailoverGroupResource]: ... + + + class azure.mgmt.azurearcdata.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.azurearcdata.operations.PostgresInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PostgresInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PostgresInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PostgresInstance]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + postgres_instance_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + postgres_instance_name: str, + **kwargs: Any + ) -> PostgresInstance: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[PostgresInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[PostgresInstance]: ... + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PostgresInstance: ... + + + class azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlManagedInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlManagedInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlManagedInstance]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_managed_instance_name: str, + **kwargs: Any + ) -> SqlManagedInstance: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[SqlManagedInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SqlManagedInstance]: ... + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlManagedInstance: ... + + + class azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_distributed_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + def begin_delete_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerAvailabilityGroupResource]: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def detail_view( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def failover( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def force_failover_allow_data_loss( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> ItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerAvailabilityGroupResource: ... + + + class azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerDatabaseResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerDatabaseResource]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerDatabaseResource]: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + **kwargs: Any + ) -> SqlServerDatabaseResource: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> ItemPaged[SqlServerDatabaseResource]: ... + + + class azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[SqlServerEsuLicense]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SqlServerEsuLicense]: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerEsuLicense: ... + + + class azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @overload + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceJobsResponse]: ... + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceJobsResponse]: ... + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceJobsResponse]: ... + + @distributed_trace + def begin_get_migration_readiness_report( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> LROPoller[SqlServerInstanceMigrationReadinessReportResponse]: ... + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[SqlServerInstanceTargetRecommendationReportsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[SqlServerInstanceTargetRecommendationReportsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceTargetRecommendationReportsResponse]: ... + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: ... + + @distributed_trace + def begin_run_best_practice_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> LROPoller[SqlServerInstanceRunBestPracticesAssessmentResponse]: ... + + @overload + def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @overload + def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @overload + def begin_run_managed_instance_link_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceManagedInstanceLinkAssessmentResponse]: ... + + @distributed_trace + def begin_run_migration_readiness_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> LROPoller[SqlServerInstanceRunMigrationReadinessAssessmentResponse]: ... + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[SqlServerInstanceRunTargetRecommendationJobRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[SqlServerInstanceRunTargetRecommendationJobRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstanceRunTargetRecommendationJobResponse]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SqlServerInstance]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[SqlServerAvailabilityGroupResource]: ... + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerInstanceJobsStatusResponse: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[SqlServerInstance]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SqlServerInstance]: ... + + @distributed_trace + def post_upgrade( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @distributed_trace + def pre_upgrade( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstance: ... + + @distributed_trace + def run_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstanceRunBestPracticesAssessmentResponse: ... + + @distributed_trace + def run_migration_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + **kwargs: Any + ) -> SqlServerInstanceRunMigrationAssessmentResponse: ... + + + class azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + sql_server_license_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + sql_server_license_name: str, + **kwargs: Any + ) -> SqlServerLicense: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[SqlServerLicense]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SqlServerLicense]: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SqlServerLicense: ... + + +namespace azure.mgmt.azurearcdata.types + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorDNSDetails(TypedDict, total=False): + key "domainName": str + key "nameserverIPAddresses": Required[list[str]] + key "preferK8sDnsForPtrLookups": bool + key "replicas": int + domain_name: str + nameserver_ip_addresses: list[str] + prefer_k8_s_dns_for_ptr_lookups: bool + replicas: int + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorDomainDetails(TypedDict, total=False): + key "domainControllers": ForwardRef('ActiveDirectoryDomainControllers', module='types') + key "netbiosDomainName": str + key "ouDistinguishedName": str + key "realm": Required[str] + key "serviceAccountProvisioning": Union[str, AccountProvisioningMode] + domain_controllers: ActiveDirectoryDomainControllers + netbios_domain_name: str + ou_distinguished_name: str + realm: str + service_account_provisioning: Union[str, AccountProvisioningMode] + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorProperties(TypedDict, total=False): + key "domainServiceAccountLoginInformation": ForwardRef('BasicLoginInformation', module='types') + key "provisioningState": str + key "spec": Required[ActiveDirectoryConnectorSpec] + key "status": ForwardRef('ActiveDirectoryConnectorStatus', module='types') + domain_service_account_login_information: BasicLoginInformation + provisioning_state: str + spec: ActiveDirectoryConnectorSpec + status: ActiveDirectoryConnectorStatus + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorResource(ProxyResource): + key "id": str + key "name": str + key "properties": Required[ActiveDirectoryConnectorProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ActiveDirectoryConnectorProperties + system_data: SystemData + type: str + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorSpec(TypedDict, total=False): + key "activeDirectory": Required[ActiveDirectoryConnectorDomainDetails] + key "dns": Required[ActiveDirectoryConnectorDNSDetails] + active_directory: ActiveDirectoryConnectorDomainDetails + dns: ActiveDirectoryConnectorDNSDetails + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorStatus(TypedDict, total=False): + key "lastUpdateTime": str + key "observedGeneration": int + key "state": str + last_update_time: str + observed_generation: int + state: str + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryDomainController(TypedDict, total=False): + key "hostname": Required[str] + hostname: str + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryDomainControllers(TypedDict, total=False): + key "primaryDomainController": ForwardRef('ActiveDirectoryDomainController', module='types') + primary_domain_controller: ActiveDirectoryDomainController + secondaryDomainControllers: list[ActiveDirectoryDomainController] + secondary_domain_controllers: list[ActiveDirectoryDomainController] + + + class azure.mgmt.azurearcdata.types.ActiveDirectoryInformation(TypedDict, total=False): + key "keytabInformation": ForwardRef('KeytabInformation', module='types') + keytab_information: KeytabInformation + + + class azure.mgmt.azurearcdata.types.AdditionalMigrationJobAttributes(TypedDict, total=False): + key "keyName": str + key "keyValue": str + key_name: str + key_value: str + + + class azure.mgmt.azurearcdata.types.Authentication(TypedDict, total=False): + key "mode": Union[str, Mode] + mode: Union[str, Mode] + sqlServerEntraIdentity: list[EntraAuthentication] + sql_server_entra_identity: list[EntraAuthentication] + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupConfigure(TypedDict, total=False): + key "availabilityMode": Union[str, ArcSqlServerAvailabilityMode] + key "availabilityModeDescription": str + key "backupPriority": int + key "certificateName": str + key "endpointAuthenticationMode": Union[str, ConnectionAuth] + key "endpointConnectLogin": str + key "endpointName": str + key "endpointUrl": str + key "failoverMode": Union[str, ArcSqlServerFailoverMode] + key "failoverModeDescription": str + key "primaryAllowConnections": Union[str, PrimaryAllowConnections] + key "primaryRoleAllowConnectionsDescription": str + key "readOnlyRoutingUrl": str + key "readWriteRoutingUrl": str + key "replicaCreateDate": str + key "replicaModifyDate": str + key "secondaryAllowConnections": Union[str, SecondaryAllowConnections] + key "secondaryRoleAllowConnectionsDescription": str + key "seedingMode": Union[str, SeedingMode] + key "seedingModeDescription": str + key "sessionTimeout": int + availability_mode: Union[str, ArcSqlServerAvailabilityMode] + availability_mode_description: str + backup_priority: int + certificate_name: str + endpoint_authentication_mode: Union[str, ConnectionAuth] + endpoint_connect_login: str + endpoint_name: str + endpoint_url: str + failover_mode: Union[str, ArcSqlServerFailoverMode] + failover_mode_description: str + primary_allow_connections: Union[str, PrimaryAllowConnections] + primary_role_allow_connections_description: str + read_only_routing_url: str + read_write_routing_url: str + replica_create_date: str + replica_modify_date: str + secondary_allow_connections: Union[str, SecondaryAllowConnections] + secondary_role_allow_connections_description: str + seeding_mode: Union[str, SeedingMode] + seeding_mode_description: str + session_timeout: int + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateConfiguration(TypedDict, total=False): + key "automatedBackupPreference": Union[str, AutomatedBackupPreference] + key "availabilityGroupName": str + key "clusterType": Union[str, ClusterType] + key "dbFailover": Union[str, DbFailover] + key "dtcSupport": Union[str, DtcSupport] + key "failureConditionLevel": Union[int, FailureConditionLevel] + key "healthCheckTimeout": int + key "listener": ForwardRef('SqlAvailabilityGroupStaticIPListenerProperties', module='types') + key "requiredSynchronizedSecondariesToCommit": int + automated_backup_preference: Union[str, AutomatedBackupPreference] + availability_group_name: str + cluster_type: Union[str, ClusterType] + databases: list[str] + db_failover: Union[str, DbFailover] + dtc_support: Union[str, DtcSupport] + failure_condition_level: Union[int, FailureConditionLevel] + health_check_timeout: int + listener: SqlAvailabilityGroupStaticIPListenerProperties + replicas: list[AvailabilityGroupCreateUpdateReplicaConfiguration] + required_synchronized_secondaries_to_commit: int + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateReplicaConfiguration(TypedDict, total=False): + key "availabilityMode": Union[str, ArcSqlServerAvailabilityMode] + key "backupPriority": int + key "certificateName": str + key "endpointAuthenticationMode": Union[str, ConnectionAuth] + key "endpointConnectLogin": str + key "endpointName": str + key "endpointUrl": str + key "failoverMode": Union[str, ArcSqlServerFailoverMode] + key "primaryRoleAllowConnections": Union[str, PrimaryAllowConnections] + key "secondaryRoleAllowConnections": Union[str, SecondaryAllowConnections] + key "secondaryRoleReadOnlyRoutingUrl": str + key "seedingMode": Union[str, SeedingMode] + key "serverInstance": str + key "sessionTimeout": int + availability_mode: Union[str, ArcSqlServerAvailabilityMode] + backup_priority: int + certificate_name: str + endpoint_authentication_mode: Union[str, ConnectionAuth] + endpoint_connect_login: str + endpoint_name: str + endpoint_url: str + failover_mode: Union[str, ArcSqlServerFailoverMode] + primaryRoleReadOnlyRoutingList: list[str] + primary_role_allow_connections: Union[str, PrimaryAllowConnections] + primary_role_read_only_routing_list: list[str] + secondary_role_allow_connections: Union[str, SecondaryAllowConnections] + secondary_role_read_only_routing_url: str + seeding_mode: Union[str, SeedingMode] + server_instance: str + session_timeout: int + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupInfo(TypedDict, total=False): + key "automatedBackupPreferenceDescription": str + key "basicFeatures": bool + key "clusterTypeDescription": str + key "dbFailover": bool + key "dtcSupport": bool + key "failureConditionLevel": int + key "healthCheckTimeout": int + key "isContained": bool + key "isDistributed": bool + key "listener": ForwardRef('SqlAvailabilityGroupStaticIPListenerProperties', module='types') + key "primaryRecoveryHealthDescription": str + key "primaryReplica": str + key "replicationPartnerType": Union[str, ReplicationPartnerType] + key "requiredSynchronizedSecondariesToCommit": int + key "secondaryRecoveryHealthDescription": str + key "synchronizationHealthDescription": str + key "version": int + automated_backup_preference_description: str + basic_features: bool + cluster_type_description: str + db_failover: bool + dtc_support: bool + failure_condition_level: int + health_check_timeout: int + is_contained: bool + is_distributed: bool + listener: SqlAvailabilityGroupStaticIPListenerProperties + primary_recovery_health_description: str + primary_replica: str + replication_partner_type: Union[str, ReplicationPartnerType] + required_synchronized_secondaries_to_commit: int + secondary_recovery_health_description: str + synchronization_health_description: str + version: int + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupRetrievalFilters(TypedDict, total=False): + key "availabilityGroupTypeFilter": Union[str, ArcSqlServerAvailabilityGroupTypeFilter] + key "replicationPartnerTypeFilter": Union[str, ReplicationPartnerType] + availability_group_type_filter: Union[str, ArcSqlServerAvailabilityGroupTypeFilter] + replication_partner_type_filter: Union[str, ReplicationPartnerType] + + + class azure.mgmt.azurearcdata.types.AvailabilityGroupState(TypedDict, total=False): + key "availabilityGroupReplicaRole": str + key "connectedStateDescription": str + key "lastConnectErrorDescription": str + key "lastConnectErrorTimestamp": str + key "operationalStateDescription": str + key "recoveryHealthDescription": str + key "synchronizationHealthDescription": str + availability_group_replica_role: str + connected_state_description: str + last_connect_error_description: str + last_connect_error_timestamp: str + operational_state_description: str + recovery_health_description: str + synchronization_health_description: str + + + class azure.mgmt.azurearcdata.types.BackgroundJob(TypedDict, total=False): + key "endTime": str + key "executionState": Union[str, ExecutionState] + key "lastExecutionStatus": Union[str, LastExecutionStatus] + key "lastExecutionTime": str + key "nextExecutionTime": str + key "startTime": str + key "state": Union[str, State] + end_time: str + execution_state: Union[str, ExecutionState] + last_execution_status: Union[str, LastExecutionStatus] + last_execution_time: str + next_execution_time: str + start_time: str + state: Union[str, State] + + + class azure.mgmt.azurearcdata.types.BackupPolicy(TypedDict, total=False): + key "differentialBackupHours": Union[int, DifferentialBackupHours] + key "fullBackupDays": int + key "retentionPeriodDays": int + key "transactionLogBackupMinutes": int + differential_backup_hours: Union[int, DifferentialBackupHours] + full_backup_days: int + retention_period_days: int + transaction_log_backup_minutes: int + + + class azure.mgmt.azurearcdata.types.BasicLoginInformation(TypedDict, total=False): + key "password": str + key "username": str + password: str + username: str + + + class azure.mgmt.azurearcdata.types.BestPracticesAssessment(TypedDict, total=False): + key "enabled": bool + key "schedule": ForwardRef('Schedule', module='types') + enabled: bool + schedule: Schedule + + + class azure.mgmt.azurearcdata.types.ClientConnection(TypedDict, total=False): + key "enabled": bool + enabled: bool + + + class azure.mgmt.azurearcdata.types.CommonSku(TypedDict, total=False): + key "capacity": int + key "dev": bool + key "family": str + key "name": Required[str] + key "size": str + capacity: int + dev: bool + family: str + name: str + size: str + + + class azure.mgmt.azurearcdata.types.CostOptionSelectedValues(TypedDict, total=False): + key "computeAndStorageCostOption": str + key "sqlLicenseCostOption": str + key "windowsLicenseCostOption": str + compute_and_storage_cost_option: str + sql_license_cost_option: str + windows_license_cost_option: str + + + class azure.mgmt.azurearcdata.types.CostTypeValues(TypedDict, total=False): + key "computeCost": float + key "iopsCost": float + key "storageCost": float + compute_cost: float + iops_cost: float + storage_cost: float + + + class azure.mgmt.azurearcdata.types.CronTrigger(TypedDict, total=False): + key "expression": str + key "startTime": str + key "timeZone": str + expression: str + start_time: str + time_zone: str + + + class azure.mgmt.azurearcdata.types.DBMEndpoint(TypedDict, total=False): + key "certificateExpiryDate": str + key "certificateName": str + key "connectionAuth": Union[str, ConnectionAuth] + key "encryptionAlgorithm": Union[str, EncryptionAlgorithm] + key "endpointName": str + key "ipAddress": str + key "isDynamicPort": bool + key "isEncryptionEnabled": bool + key "port": int + key "role": Union[str, Role] + certificate_expiry_date: str + certificate_name: str + connection_auth: Union[str, ConnectionAuth] + encryption_algorithm: Union[str, EncryptionAlgorithm] + endpoint_name: str + ip_address: str + is_dynamic_port: bool + is_encryption_enabled: bool + port: int + role: Union[str, Role] + + + class azure.mgmt.azurearcdata.types.DataBaseMigration(TypedDict, total=False): + key "assessment": ForwardRef('DataBaseMigrationAssessment', module='types') + assessment: DataBaseMigrationAssessment + jobs: list[DatabaseMigrationJobsItem] + + + class azure.mgmt.azurearcdata.types.DataBaseMigrationAssessment(TypedDict, total=False): + key "assessmentUploadTime": str + key "targetReadiness": ForwardRef('TargetReadiness', module='types') + key "targetRecommendationGenerationTime": str + assessment_upload_time: str + databaseAssessments: list[DatabaseAssessmentsItem] + database_assessments: list[DatabaseAssessmentsItem] + target_readiness: TargetReadiness + target_recommendation_generation_time: str + + + class azure.mgmt.azurearcdata.types.DataControllerProperties(TypedDict, total=False): + key "basicLoginInformation": ForwardRef('BasicLoginInformation', module='types') + key "clusterId": str + key "extensionId": str + key "infrastructure": Union[str, Infrastructure] + key "k8sRaw": Any + key "lastUploadedDate": str + key "logAnalyticsWorkspaceConfig": ForwardRef('LogAnalyticsWorkspaceConfig', module='types') + key "logsDashboardCredential": ForwardRef('BasicLoginInformation', module='types') + key "metricsDashboardCredential": ForwardRef('BasicLoginInformation', module='types') + key "onPremiseProperty": ForwardRef('OnPremiseProperty', module='types') + key "provisioningState": str + key "uploadServicePrincipal": ForwardRef('UploadServicePrincipal', module='types') + key "uploadWatermark": ForwardRef('UploadWatermark', module='types') + basic_login_information: BasicLoginInformation + cluster_id: str + extension_id: str + infrastructure: Union[str, Infrastructure] + k8_s_raw: Any + last_uploaded_date: str + log_analytics_workspace_config: LogAnalyticsWorkspaceConfig + logs_dashboard_credential: BasicLoginInformation + metrics_dashboard_credential: BasicLoginInformation + on_premise_property: OnPremiseProperty + provisioning_state: str + upload_service_principal: UploadServicePrincipal + upload_watermark: UploadWatermark + + + class azure.mgmt.azurearcdata.types.DataControllerResource(TrackedResource): + key "extendedLocation": ForwardRef('ExtendedLocation', module='types') + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[DataControllerProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: DataControllerProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.DataControllerUpdate(TypedDict, total=False): + key "properties": ForwardRef('DataControllerProperties', module='types') + properties: DataControllerProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.DatabaseAssessmentsItem(TypedDict, total=False): + key "appliesToMigrationTargetPlatform": str + key "featureId": str + key "issueCategory": str + key "moreInformation": str + applies_to_migration_target_platform: str + feature_id: str + issue_category: str + more_information: str + + + class azure.mgmt.azurearcdata.types.DatabaseMigrationJobsItem(TypedDict, total=False): + key "endTime": str + key "initiatedFrom": Union[str, InitiatedFrom] + key "lastError": str + key "migrationMode": Union[str, MigrationMode] + key "migrationTrackingId": str + key "startTime": str + key "status": Union[str, MigrationStatus] + key "targetResourceId": str + key "targetType": Union[str, TargetType] + additionalAttributes: list[AdditionalMigrationJobAttributes] + additional_attributes: list[AdditionalMigrationJobAttributes] + end_time: str + initiated_from: Union[str, InitiatedFrom] + last_error: str + migration_mode: Union[str, MigrationMode] + migration_tracking_id: str + start_time: str + status: Union[str, MigrationStatus] + target_resource_id: str + target_type: Union[str, TargetType] + + + class azure.mgmt.azurearcdata.types.Databases(TypedDict, total=False): + values: list[str] + values_property: list[str] + + + class azure.mgmt.azurearcdata.types.DiskSizes(TypedDict, total=False): + key "caching": str + key "diskType": str + key "maxIops": float + key "maxSizeInGib": float + key "maxThroughputInMbps": float + key "redundancy": str + key "size": str + caching: str + disk_type: str + max_iops: float + max_size_in_gib: float + max_throughput_in_mbps: float + redundancy: str + size: str + + + class azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration(TypedDict, total=False): + key "certificateName": str + certificate_name: str + + + class azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration(TypedDict, total=False): + key "availabilityGroup": str + key "availabilityMode": Union[str, ArcSqlServerAvailabilityMode] + key "certificateConfiguration": ForwardRef('DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration', module='types') + key "failoverMode": Union[str, ArcSqlServerFailoverMode] + key "listenerUrl": str + key "seedingMode": Union[str, SeedingMode] + availability_group: str + availability_mode: Union[str, ArcSqlServerAvailabilityMode] + certificate_configuration: DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration + failover_mode: Union[str, ArcSqlServerFailoverMode] + listener_url: str + seeding_mode: Union[str, SeedingMode] + + + class azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateConfiguration(TypedDict, total=False): + key "availabilityGroupName": str + key "primaryAvailabilityGroup": ForwardRef('DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration', module='types') + key "secondaryAvailabilityGroup": ForwardRef('DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration', module='types') + availability_group_name: str + primary_availability_group: DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration + secondary_availability_group: DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration + + + class azure.mgmt.azurearcdata.types.EntraAuthentication(TypedDict, total=False): + key "clientId": str + key "identityType": Union[str, IdentityType] + client_id: str + identity_type: Union[str, IdentityType] + + + class azure.mgmt.azurearcdata.types.ErrorAdditionalInfo(TypedDict, total=False): + key "info": Any + key "type": str + info: Any + type: str + + + class azure.mgmt.azurearcdata.types.ErrorDetail(TypedDict, total=False): + key "code": str + key "message": str + key "target": str + additionalInfo: list[ErrorAdditionalInfo] + additional_info: list[ErrorAdditionalInfo] + code: str + details: list[ErrorDetail] + message: str + target: str + + + class azure.mgmt.azurearcdata.types.ErrorResponse(TypedDict, total=False): + key "error": ForwardRef('ErrorDetail', module='types') + error: ErrorDetail + + + class azure.mgmt.azurearcdata.types.ExtendedLocation(TypedDict, total=False): + key "name": str + key "type": Union[str, ExtendedLocationTypes] + name: str + type: Union[str, ExtendedLocationTypes] + + + class azure.mgmt.azurearcdata.types.FailoverCluster(TypedDict, total=False): + key "id": str + key "networkName": str + hostIPAddresses: list[HostIPAddressInformation] + hostNames: list[str] + host_ip_addresses: list[HostIPAddressInformation] + host_names: list[str] + id: str + network_name: str + sqlInstanceIds: list[str] + sql_instance_ids: list[str] + + + class azure.mgmt.azurearcdata.types.FailoverGroupProperties(TypedDict, total=False): + key "partnerManagedInstanceId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "spec": Required[FailoverGroupSpec] + key "status": Any + partner_managed_instance_id: str + provisioning_state: Union[str, ProvisioningState] + spec: FailoverGroupSpec + status: Any + + + class azure.mgmt.azurearcdata.types.FailoverGroupResource(ProxyResource): + key "id": str + key "name": str + key "properties": Required[FailoverGroupProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: FailoverGroupProperties + system_data: SystemData + type: str + + + class azure.mgmt.azurearcdata.types.FailoverGroupSpec(TypedDict, total=False): + key "partnerMI": str + key "partnerMirroringCert": str + key "partnerMirroringURL": str + key "partnerSyncMode": Union[str, FailoverGroupPartnerSyncMode] + key "role": Required[Union[str, InstanceFailoverGroupRole]] + key "sharedName": str + key "sourceMI": str + partner_mi: str + partner_mirroring_cert: str + partner_mirroring_url: str + partner_sync_mode: Union[str, FailoverGroupPartnerSyncMode] + role: Union[str, InstanceFailoverGroupRole] + shared_name: str + source_mi: str + + + class azure.mgmt.azurearcdata.types.FailoverMiLinkResourceId(TypedDict, total=False): + key "force": bool + key "managedInstanceId": str + force: bool + managed_instance_id: str + + + class azure.mgmt.azurearcdata.types.HostIPAddressInformation(TypedDict, total=False): + key "ipAddress": str + key "subnetMask": str + ip_address: str + subnet_mask: str + + + class azure.mgmt.azurearcdata.types.ImpactedObjectsInfo(TypedDict, total=False): + key "featureId": str + key "issueCategory": str + key "numberImpacted": int + feature_id: str + issue_category: str + number_impacted: int + + + class azure.mgmt.azurearcdata.types.ImpactedObjectsSuitabilitySummary(TypedDict, total=False): + azureSqlDatabase: list[ImpactedObjectsInfo] + azureSqlManagedInstance: list[ImpactedObjectsInfo] + azure_sql_database: list[ImpactedObjectsInfo] + azure_sql_managed_instance: list[ImpactedObjectsInfo] + + + class azure.mgmt.azurearcdata.types.K8SActiveDirectory(TypedDict, total=False): + key "accountName": str + key "connector": ForwardRef('K8SActiveDirectoryConnector', module='types') + key "keytabSecret": str + account_name: str + connector: K8SActiveDirectoryConnector + encryptionTypes: list[str] + encryption_types: list[str] + keytab_secret: str + + + class azure.mgmt.azurearcdata.types.K8SActiveDirectoryConnector(TypedDict, total=False): + key "name": str + key "namespace": str + name: str + namespace: str + + + class azure.mgmt.azurearcdata.types.K8SNetworkSettings(TypedDict, total=False): + key "forceencryption": int + key "tlsciphers": str + key "tlsprotocols": str + forceencryption: int + tlsciphers: str + tlsprotocols: str + + + class azure.mgmt.azurearcdata.types.K8SResourceRequirements(TypedDict, total=False): + limits: dict[str, str] + requests: dict[str, str] + + + class azure.mgmt.azurearcdata.types.K8SScheduling(TypedDict, total=False): + key "default": ForwardRef('K8SSchedulingOptions', module='types') + default: K8SSchedulingOptions + + + class azure.mgmt.azurearcdata.types.K8SSchedulingOptions(TypedDict, total=False): + key "resources": ForwardRef('K8SResourceRequirements', module='types') + resources: K8SResourceRequirements + + + class azure.mgmt.azurearcdata.types.K8SSecurity(TypedDict, total=False): + key "activeDirectory": ForwardRef('K8SActiveDirectory', module='types') + key "adminLoginSecret": str + key "serviceCertificateSecret": str + key "transparentDataEncryption": ForwardRef('K8StransparentDataEncryption', module='types') + active_directory: K8SActiveDirectory + admin_login_secret: str + service_certificate_secret: str + transparent_data_encryption: K8StransparentDataEncryption + + + class azure.mgmt.azurearcdata.types.K8SSettings(TypedDict, total=False): + key "network": ForwardRef('K8SNetworkSettings', module='types') + network: K8SNetworkSettings + + + class azure.mgmt.azurearcdata.types.K8StransparentDataEncryption(TypedDict, total=False): + key "mode": str + key "protectorSecret": str + mode: str + protector_secret: str + + + class azure.mgmt.azurearcdata.types.KeytabInformation(TypedDict, total=False): + key "keytab": str + keytab: str + + + class azure.mgmt.azurearcdata.types.LogAnalyticsWorkspaceConfig(TypedDict, total=False): + key "primaryKey": str + key "workspaceId": str + primary_key: str + workspace_id: str + + + class azure.mgmt.azurearcdata.types.ManagedInstanceLinkCreateUpdateConfiguration(TypedDict, total=False): + key "availabilityGroup": ForwardRef('AvailabilityGroupCreateUpdateConfiguration', module='types') + key "distributedAvailabilityGroup": ForwardRef('DistributedAvailabilityGroupCreateUpdateConfiguration', module='types') + key "miLinkConfiguration": ForwardRef('MiLinkCreateUpdateConfiguration', module='types') + availability_group: AvailabilityGroupCreateUpdateConfiguration + distributed_availability_group: DistributedAvailabilityGroupCreateUpdateConfiguration + mi_link_configuration: MiLinkCreateUpdateConfiguration + + + class azure.mgmt.azurearcdata.types.MiLinkCreateUpdateConfiguration(TypedDict, total=False): + key "instanceAvailabilityGroupName": str + instance_availability_group_name: str + + + class azure.mgmt.azurearcdata.types.Migration(TypedDict, total=False): + key "assessment": ForwardRef('MigrationAssessment', module='types') + key "targetResourceId": str + key "targetSelectedTime": str + assessment: MigrationAssessment + target_resource_id: str + target_selected_time: str + + + class azure.mgmt.azurearcdata.types.MigrationAssessment(TypedDict, total=False): + key "assessmentUploadTime": str + key "assessmentViewedTime": str + key "enabled": bool + key "impactedObjectsSummary": ForwardRef('ImpactedObjectsSuitabilitySummary', module='types') + key "settings": ForwardRef('MigrationAssessmentSettings', module='types') + key "skuRecommendationResults": ForwardRef('SkuRecommendationResults', module='types') + key "targetRecommendationGenerationTime": str + key "version": str + assessment_upload_time: str + assessment_viewed_time: str + enabled: bool + impacted_objects_summary: ImpactedObjectsSuitabilitySummary + serverAssessments: list[ServerAssessmentsItem] + server_assessments: list[ServerAssessmentsItem] + settings: MigrationAssessmentSettings + sku_recommendation_results: SkuRecommendationResults + target_recommendation_generation_time: str + version: str + + + class azure.mgmt.azurearcdata.types.MigrationAssessmentSettings(TypedDict, total=False): + key "comfortFactor": int + key "costOptions": ForwardRef('CostOptionSelectedValues', module='types') + key "currency": str + key "discountPercentage": float + key "lookbackPeriodInDays": int + key "percentile": float + key "strategy": str + key "targetLocation": str + comfort_factor: int + cost_options: CostOptionSelectedValues + currency: str + discount_percentage: float + lookback_period_in_days: int + percentile: float + strategy: str + target_location: str + + + class azure.mgmt.azurearcdata.types.Monitoring(TypedDict, total=False): + key "enabled": bool + enabled: bool + + + class azure.mgmt.azurearcdata.types.OnPremiseProperty(TypedDict, total=False): + key "id": Required[str] + key "publicSigningKey": Required[str] + key "signingCertificateThumbprint": str + id: str + public_signing_key: str + signing_certificate_thumbprint: str + + + class azure.mgmt.azurearcdata.types.Operation(TypedDict, total=False): + key "display": Required[OperationDisplay] + key "isDataAction": Required[bool] + key "name": Required[str] + key "origin": Union[str, OperationOrigin] + display: OperationDisplay + is_data_action: bool + name: str + origin: Union[str, OperationOrigin] + properties: dict[str, Any] + + + class azure.mgmt.azurearcdata.types.OperationDisplay(TypedDict, total=False): + key "description": Required[str] + key "operation": Required[str] + key "provider": Required[str] + key "resource": Required[str] + description: str + operation: str + provider: str + resource: str + + + class azure.mgmt.azurearcdata.types.PostgresInstance(TrackedResource): + key "extendedLocation": ForwardRef('ExtendedLocation', module='types') + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[PostgresInstanceProperties] + key "sku": ForwardRef('PostgresInstanceSku', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: PostgresInstanceProperties + sku: PostgresInstanceSku + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.PostgresInstanceProperties(TypedDict, total=False): + key "admin": str + key "basicLoginInformation": ForwardRef('BasicLoginInformation', module='types') + key "dataControllerId": str + key "k8sRaw": Any + key "lastUploadedDate": str + key "provisioningState": str + admin: str + basic_login_information: BasicLoginInformation + data_controller_id: str + k8_s_raw: Any + last_uploaded_date: str + provisioning_state: str + + + class azure.mgmt.azurearcdata.types.PostgresInstanceSku(CommonSku): + key "capacity": int + key "dev": bool + key "family": str + key "name": Required[str] + key "size": str + key "tier": Literal["Hyperscale"] + capacity: int + dev: bool + family: str + name: str + size: str + tier: Literal[Hyperscale] + + + class azure.mgmt.azurearcdata.types.PostgresInstanceUpdate(TypedDict, total=False): + key "properties": ForwardRef('PostgresInstanceProperties', module='types') + properties: PostgresInstanceProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.azurearcdata.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.azurearcdata.types.Schedule(TypedDict, total=False): + key "cronTrigger": ForwardRef('CronTrigger', module='types') + key "enabled": bool + cron_trigger: CronTrigger + enabled: bool + + + class azure.mgmt.azurearcdata.types.SequencerAction(TypedDict, total=False): + key "actionId": str + key "result": Union[str, Result] + key "state": Union[str, SequencerState] + action_id: str + result: Union[str, Result] + state: Union[str, SequencerState] + + + class azure.mgmt.azurearcdata.types.ServerAssessmentsItem(TypedDict, total=False): + key "appliesToMigrationTargetPlatform": str + key "featureId": str + key "issueCategory": str + key "moreInformation": str + applies_to_migration_target_platform: str + feature_id: str + impactedObjects: list[ServerAssessmentsPropertiesItemsItem] + impacted_objects: list[ServerAssessmentsPropertiesItemsItem] + issue_category: str + more_information: str + + + class azure.mgmt.azurearcdata.types.ServerAssessmentsPropertiesItemsItem(TypedDict, total=False): + key "impactDetail": str + key "name": str + key "objectType": str + impact_detail: str + name: str + object_type: str + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResults(TypedDict, total=False): + key "azureSqlDatabase": ForwardRef('SkuRecommendationResultsAzureSqlDatabase', module='types') + key "azureSqlManagedInstance": ForwardRef('SkuRecommendationResultsAzureSqlManagedInstance', module='types') + key "azureSqlVirtualMachine": ForwardRef('SkuRecommendationResultsAzureSqlVirtualMachine', module='types') + azure_sql_database: SkuRecommendationResultsAzureSqlDatabase + azure_sql_managed_instance: SkuRecommendationResultsAzureSqlManagedInstance + azure_sql_virtual_machine: SkuRecommendationResultsAzureSqlVirtualMachine + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlDatabase(TypedDict, total=False): + key "monthlyCost": ForwardRef('SkuRecommendationResultsMonthlyCost', module='types') + key "numberOfServerBlockerIssues": int + key "recommendationStatus": Union[str, RecommendationStatus] + key "targetSku": ForwardRef('SkuRecommendationResultsAzureSqlDatabaseTargetSku', module='types') + monthlyCostOptions: list[SkuRecommendationResultsMonthlyCostOptionItem] + monthly_cost: SkuRecommendationResultsMonthlyCost + monthly_cost_options: list[SkuRecommendationResultsMonthlyCostOptionItem] + number_of_server_blocker_issues: int + recommendation_status: Union[str, RecommendationStatus] + target_sku: SkuRecommendationResultsAzureSqlDatabaseTargetSku + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlDatabaseTargetSku(TypedDict, total=False): + key "category": ForwardRef('SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory', module='types') + key "computeSize": int + key "maxStorageIops": float + key "maxThroughputMBps": float + key "predictedDataSizeInMb": float + key "predictedLogSizeInMb": float + key "storageMaxSizeInMb": float + category: SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory + compute_size: int + max_storage_iops: float + max_throughput_m_bps: float + predicted_data_size_in_mb: float + predicted_log_size_in_mb: float + storage_max_size_in_mb: float + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory(TypedDict, total=False): + key "computeTier": str + key "hardwareType": str + key "sqlPurchasingModel": str + key "sqlServiceTier": str + key "zoneRedundancyAvailable": bool + compute_tier: str + hardware_type: str + sql_purchasing_model: str + sql_service_tier: str + zone_redundancy_available: bool + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlManagedInstance(TypedDict, total=False): + key "monthlyCost": ForwardRef('SkuRecommendationResultsMonthlyCost', module='types') + key "numberOfServerBlockerIssues": int + key "recommendationStatus": Union[str, RecommendationStatus] + key "targetSku": ForwardRef('SkuRecommendationResultsAzureSqlManagedInstanceTargetSku', module='types') + monthlyCostOptions: list[SkuRecommendationResultsMonthlyCostOptionItem] + monthly_cost: SkuRecommendationResultsMonthlyCost + monthly_cost_options: list[SkuRecommendationResultsMonthlyCostOptionItem] + number_of_server_blocker_issues: int + recommendation_status: Union[str, RecommendationStatus] + target_sku: SkuRecommendationResultsAzureSqlManagedInstanceTargetSku + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku(TypedDict, total=False): + key "category": ForwardRef('SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory', module='types') + key "computeSize": int + key "maxStorageIops": float + key "maxThroughputMBps": float + key "predictedDataSizeInMb": float + key "predictedLogSizeInMb": float + key "storageMaxSizeInMb": float + category: SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory + compute_size: int + max_storage_iops: float + max_throughput_m_bps: float + predicted_data_size_in_mb: float + predicted_log_size_in_mb: float + storage_max_size_in_mb: float + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory(TypedDict, total=False): + key "computeTier": str + key "hardwareType": str + key "sqlPurchasingModel": str + key "sqlServiceTier": str + key "zoneRedundancyAvailable": bool + compute_tier: str + hardware_type: str + sql_purchasing_model: str + sql_service_tier: str + zone_redundancy_available: bool + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlVirtualMachine(TypedDict, total=False): + key "monthlyCost": ForwardRef('SkuRecommendationResultsMonthlyCost', module='types') + key "numberOfServerBlockerIssues": int + key "recommendationStatus": Union[str, RecommendationStatus] + key "targetSku": ForwardRef('SkuRecommendationResultsAzureSqlVirtualMachineTargetSku', module='types') + monthlyCostOptions: list[SkuRecommendationResultsMonthlyCostOptionItem] + monthly_cost: SkuRecommendationResultsMonthlyCost + monthly_cost_options: list[SkuRecommendationResultsMonthlyCostOptionItem] + number_of_server_blocker_issues: int + recommendation_status: Union[str, RecommendationStatus] + target_sku: SkuRecommendationResultsAzureSqlVirtualMachineTargetSku + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku(TypedDict, total=False): + key "category": ForwardRef('SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory', module='types') + key "computeSize": int + key "predictedDataSizeInMb": float + key "predictedLogSizeInMb": float + key "virtualMachineSize": ForwardRef('SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize', module='types') + category: SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory + compute_size: int + dataDiskSizes: list[DiskSizes] + data_disk_sizes: list[DiskSizes] + logDiskSizes: list[DiskSizes] + log_disk_sizes: list[DiskSizes] + predicted_data_size_in_mb: float + predicted_log_size_in_mb: float + tempDbDiskSizes: list[DiskSizes] + temp_db_disk_sizes: list[DiskSizes] + virtual_machine_size: SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory(TypedDict, total=False): + key "virtualMachineFamily": str + availableVmSkus: list[str] + available_vm_skus: list[str] + virtual_machine_family: str + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize(TypedDict, total=False): + key "azureSkuName": str + key "computeSize": int + key "maxNetworkInterfaces": int + key "sizeName": str + key "vCPUsAvailable": int + key "virtualMachineFamily": str + azure_sku_name: str + compute_size: int + max_network_interfaces: int + size_name: str + v_cpus_available: int + virtual_machine_family: str + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsMonthlyCost(TypedDict, total=False): + key "computeCost": float + key "iopsCost": float + key "sqlLicenseCost": float + key "storageCost": float + key "totalCost": float + key "windowsLicenseCost": float + compute_cost: float + iops_cost: float + sql_license_cost: float + storage_cost: float + total_cost: float + windows_license_cost: float + + + class azure.mgmt.azurearcdata.types.SkuRecommendationResultsMonthlyCostOptionItem(TypedDict, total=False): + key "keyName": str + key "keyValue": ForwardRef('CostTypeValues', module='types') + key_name: str + key_value: CostTypeValues + + + class azure.mgmt.azurearcdata.types.SkuRecommendationSummary(TypedDict, total=False): + key "monthlyCost": ForwardRef('SkuRecommendationResultsMonthlyCost', module='types') + key "numOfBlockerIssues": int + key "recommendationStatus": Union[str, RecommendationStatus] + key "targetSku": ForwardRef('SkuRecommendationSummaryTargetSku', module='types') + impactedObjectsSummary: list[ImpactedObjectsInfo] + impacted_objects_summary: list[ImpactedObjectsInfo] + monthlyCostOptions: list[SkuRecommendationResultsMonthlyCostOptionItem] + monthly_cost: SkuRecommendationResultsMonthlyCost + monthly_cost_options: list[SkuRecommendationResultsMonthlyCostOptionItem] + num_of_blocker_issues: int + recommendation_status: Union[str, RecommendationStatus] + target_sku: SkuRecommendationSummaryTargetSku + + + class azure.mgmt.azurearcdata.types.SkuRecommendationSummaryTargetSku(TypedDict, total=False): + key "category": ForwardRef('SkuRecommendationSummaryTargetSkuCategory', module='types') + key "computeSize": int + key "maxStorageIops": float + key "maxThroughputMBps": float + key "predictedDataSizeInMb": float + key "predictedLogSizeInMb": float + key "storageMaxSizeInMb": float + category: SkuRecommendationSummaryTargetSkuCategory + compute_size: int + max_storage_iops: float + max_throughput_m_bps: float + predicted_data_size_in_mb: float + predicted_log_size_in_mb: float + storage_max_size_in_mb: float + + + class azure.mgmt.azurearcdata.types.SkuRecommendationSummaryTargetSkuCategory(TypedDict, total=False): + key "computeTier": str + key "hardwareType": str + key "sqlPurchasingModel": str + key "sqlServiceTier": str + key "zoneRedundancyAvailable": bool + compute_tier: str + hardware_type: str + sql_purchasing_model: str + sql_service_tier: str + zone_redundancy_available: bool + + + class azure.mgmt.azurearcdata.types.SqlAvailabilityGroupDatabaseReplicaResourceProperties(TypedDict, total=False): + key "databaseName": str + key "databaseStateDescription": str + key "isCommitParticipant": bool + key "isLocal": bool + key "isPrimaryReplica": bool + key "isSuspended": bool + key "replicaName": str + key "suspendReasonDescription": str + key "synchronizationHealthDescription": str + key "synchronizationStateDescription": str + database_name: str + database_state_description: str + is_commit_participant: bool + is_local: bool + is_primary_replica: bool + is_suspended: bool + replica_name: str + suspend_reason_description: str + synchronization_health_description: str + synchronization_state_description: str + + + class azure.mgmt.azurearcdata.types.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem(TypedDict, total=False): + key "ipAddress": str + key "mask": str + ip_address: str + mask: str + + + class azure.mgmt.azurearcdata.types.SqlAvailabilityGroupReplicaResourceProperties(TypedDict, total=False): + key "configure": ForwardRef('AvailabilityGroupConfigure', module='types') + key "replicaId": str + key "replicaName": str + key "replicaResourceId": str + key "state": ForwardRef('AvailabilityGroupState', module='types') + configure: AvailabilityGroupConfigure + replica_id: str + replica_name: str + replica_resource_id: str + state: AvailabilityGroupState + + + class azure.mgmt.azurearcdata.types.SqlAvailabilityGroupStaticIPListenerProperties(TypedDict, total=False): + key "dnsName": str + key "port": int + dns_name: str + ipV4AddressesAndMasks: list[SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem] + ipV6Addresses: list[str] + ip_v4_addresses_and_masks: list[SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem] + ip_v6_addresses: list[str] + port: int + + + class azure.mgmt.azurearcdata.types.SqlManagedInstance(TrackedResource): + key "extendedLocation": ForwardRef('ExtendedLocation', module='types') + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[SqlManagedInstanceProperties] + key "sku": ForwardRef('SqlManagedInstanceSku', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: SqlManagedInstanceProperties + sku: SqlManagedInstanceSku + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlManagedInstanceK8SRaw(TypedDict, total=False): + key "spec": ForwardRef('SqlManagedInstanceK8SSpec', module='types') + spec: SqlManagedInstanceK8SSpec + + + class azure.mgmt.azurearcdata.types.SqlManagedInstanceK8SSpec(TypedDict, total=False): + key "replicas": int + key "scheduling": ForwardRef('K8SScheduling', module='types') + key "security": ForwardRef('K8SSecurity', module='types') + key "settings": ForwardRef('K8SSettings', module='types') + replicas: int + scheduling: K8SScheduling + security: K8SSecurity + settings: K8SSettings + + + class azure.mgmt.azurearcdata.types.SqlManagedInstanceProperties(TypedDict, total=False): + key "activeDirectoryInformation": ForwardRef('ActiveDirectoryInformation', module='types') + key "admin": str + key "basicLoginInformation": ForwardRef('BasicLoginInformation', module='types') + key "clusterId": str + key "dataControllerId": str + key "endTime": str + key "extensionId": str + key "k8sRaw": ForwardRef('SqlManagedInstanceK8SRaw', module='types') + key "lastUploadedDate": str + key "licenseType": Union[str, ArcSqlManagedInstanceLicenseType] + key "provisioningState": str + key "startTime": str + active_directory_information: ActiveDirectoryInformation + admin: str + basic_login_information: BasicLoginInformation + cluster_id: str + data_controller_id: str + end_time: str + extension_id: str + k8_s_raw: SqlManagedInstanceK8SRaw + last_uploaded_date: str + license_type: Union[str, ArcSqlManagedInstanceLicenseType] + provisioning_state: str + start_time: str + + + class azure.mgmt.azurearcdata.types.SqlManagedInstanceSku(TypedDict, total=False): + key "capacity": int + key "dev": bool + key "family": str + key "name": Required[Literal["vCore"]] + key "size": str + key "tier": Union[str, SqlManagedInstanceSkuTier] + capacity: int + dev: bool + family: str + name: Literal[vCore] + size: str + tier: Union[str, SqlManagedInstanceSkuTier] + + + class azure.mgmt.azurearcdata.types.SqlManagedInstanceUpdate(TypedDict, total=False): + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResource(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[SqlServerAvailabilityGroupResourceProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: SqlServerAvailabilityGroupResourceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResourceProperties(TypedDict, total=False): + key "availabilityGroupId": str + key "collectionTimestamp": str + key "databases": ForwardRef('SqlServerAvailabilityGroupResourcePropertiesDatabases', module='types') + key "info": ForwardRef('AvailabilityGroupInfo', module='types') + key "instanceName": str + key "provisioningState": str + key "replicas": ForwardRef('SqlServerAvailabilityGroupResourcePropertiesReplicas', module='types') + key "serverName": str + key "vmId": str + availability_group_id: str + collection_timestamp: str + databases: SqlServerAvailabilityGroupResourcePropertiesDatabases + info: AvailabilityGroupInfo + instance_name: str + provisioning_state: str + replicas: SqlServerAvailabilityGroupResourcePropertiesReplicas + server_name: str + vm_id: str + + + class azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResourcePropertiesDatabases(TypedDict, total=False): + key "nextLink": str + next_link: str + value: list[SqlAvailabilityGroupDatabaseReplicaResourceProperties] + + + class azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResourcePropertiesReplicas(TypedDict, total=False): + key "nextLink": str + next_link: str + value: list[SqlAvailabilityGroupReplicaResourceProperties] + + + class azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupUpdate(TypedDict, total=False): + key "properties": ForwardRef('SqlServerAvailabilityGroupResourceProperties', module='types') + properties: SqlServerAvailabilityGroupResourceProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerDatabaseResource(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[SqlServerDatabaseResourceProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: SqlServerDatabaseResourceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlServerDatabaseResourceProperties(TypedDict, total=False): + key "backupInformation": ForwardRef('SqlServerDatabaseResourcePropertiesBackupInformation', module='types') + key "backupPolicy": ForwardRef('BackupPolicy', module='types') + key "collationName": str + key "compatibilityLevel": int + key "createMode": Union[str, DatabaseCreateMode] + key "dataFileSizeMB": float + key "databaseCreationDate": str + key "databaseOptions": ForwardRef('SqlServerDatabaseResourcePropertiesDatabaseOptions', module='types') + key "earliestRestoreDate": str + key "isReadOnly": bool + key "lastDatabaseUploadTime": str + key "logFileSizeMB": float + key "migration": ForwardRef('DataBaseMigration', module='types') + key "provisioningState": str + key "recoveryMode": Union[str, RecoveryMode] + key "restorePointInTime": str + key "sizeMB": float + key "sourceDatabaseId": str + key "spaceAvailableMB": float + key "state": Union[str, DatabaseState] + key "vmId": str + backup_information: SqlServerDatabaseResourcePropertiesBackupInformation + backup_policy: BackupPolicy + collation_name: str + compatibility_level: int + create_mode: Union[str, DatabaseCreateMode] + data_file_size_mb: float + database_creation_date: str + database_options: SqlServerDatabaseResourcePropertiesDatabaseOptions + earliest_restore_date: str + is_read_only: bool + last_database_upload_time: str + log_file_size_mb: float + migration: DataBaseMigration + provisioning_state: str + recovery_mode: Union[str, RecoveryMode] + restore_point_in_time: str + size_mb: float + source_database_id: str + space_available_mb: float + state: Union[str, DatabaseState] + vm_id: str + + + class azure.mgmt.azurearcdata.types.SqlServerDatabaseResourcePropertiesBackupInformation(TypedDict, total=False): + key "lastFullBackup": str + key "lastLogBackup": str + last_full_backup: str + last_log_backup: str + + + class azure.mgmt.azurearcdata.types.SqlServerDatabaseResourcePropertiesDatabaseOptions(TypedDict, total=False): + key "isAutoCloseOn": bool + key "isAutoCreateStatsOn": bool + key "isAutoShrinkOn": bool + key "isAutoUpdateStatsOn": bool + key "isEncrypted": bool + key "isHekatonFilesOn": bool + key "isMemoryOptimizationEnabled": bool + key "isRemoteDataArchiveEnabled": bool + key "isTrustworthyOn": bool + key "numberOfHekatonFiles": int + is_auto_close_on: bool + is_auto_create_stats_on: bool + is_auto_shrink_on: bool + is_auto_update_stats_on: bool + is_encrypted: bool + is_hekaton_files_on: bool + is_memory_optimization_enabled: bool + is_remote_data_archive_enabled: bool + is_trustworthy_on: bool + number_of_hekaton_files: int + + + class azure.mgmt.azurearcdata.types.SqlServerDatabaseUpdate(TypedDict, total=False): + key "properties": ForwardRef('SqlServerDatabaseResourceProperties', module='types') + properties: SqlServerDatabaseResourceProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerEsuLicense(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[SqlServerEsuLicenseProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: SqlServerEsuLicenseProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlServerEsuLicenseProperties(TypedDict, total=False): + key "activatedAt": str + key "activationState": Required[Union[str, State]] + key "billingPlan": Required[Union[str, BillingPlan]] + key "physicalCores": Required[int] + key "scopeType": Required[Union[str, ScopeType]] + key "tenantId": str + key "terminatedAt": str + key "uniqueId": str + key "version": Required[Union[str, Version]] + activated_at: str + activation_state: Union[str, State] + billing_plan: Union[str, BillingPlan] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: str + terminated_at: str + unique_id: str + version: Union[str, Version] + + + class azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdate(TypedDict, total=False): + key "properties": ForwardRef('SqlServerEsuLicenseUpdateProperties', module='types') + properties: SqlServerEsuLicenseUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdateProperties(TypedDict, total=False): + key "activatedAt": str + key "activationState": Union[str, State] + key "billingPlan": Union[str, BillingPlan] + key "physicalCores": int + key "scopeType": Union[str, ScopeType] + key "tenantId": str + key "terminatedAt": str + key "uniqueId": str + key "version": Union[str, Version] + activated_at: str + activation_state: Union[str, State] + billing_plan: Union[str, BillingPlan] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: str + terminated_at: str + unique_id: str + version: Union[str, Version] + + + class azure.mgmt.azurearcdata.types.SqlServerInstance(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('SqlServerInstanceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: SqlServerInstanceProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceBpaColumn(TypedDict, total=False): + key "name": str + key "type": Union[str, SqlServerInstanceBpaColumnType] + name: str + type: Union[str, SqlServerInstanceBpaColumnType] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceBpaRequest(TypedDict, total=False): + key "queryType": Union[str, SqlServerInstanceBpaQueryType] + key "reportId": str + key "reportType": Union[str, SqlServerInstanceBpaReportType] + key "skipToken": str + query_type: Union[str, SqlServerInstanceBpaQueryType] + report_id: str + report_type: Union[str, SqlServerInstanceBpaReportType] + skip_token: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJob(TypedDict, total=False): + key "backgroundJob": ForwardRef('BackgroundJob', module='types') + key "id": str + key "instanceName": str + key "jobException": str + key "jobStatus": Union[str, JobStatus] + background_job: BackgroundJob + id: str + instance_name: str + job_exception: str + job_status: Union[str, JobStatus] + sequencerActions: list[SequencerAction] + sequencer_actions: list[SequencerAction] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJobStatus(TypedDict, total=False): + key "backgroundJob": ForwardRef('BackgroundJob', module='types') + key "id": str + key "instanceName": str + key "jobException": str + key "jobStatus": Union[str, JobStatus] + background_job: BackgroundJob + id: str + instance_name: str + job_exception: str + job_status: Union[str, JobStatus] + sequencerActions: list[SequencerAction] + sequencer_actions: list[SequencerAction] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJobsRequest(TypedDict, total=False): + key "featureName": str + key "jobType": str + feature_name: str + job_type: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJobsResponse(TypedDict, total=False): + jobs: list[SqlServerInstanceJob] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusRequest(TypedDict, total=False): + key "featureName": str + key "jobType": str + feature_name: str + job_type: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusResponse(TypedDict, total=False): + jobsStatus: list[SqlServerInstanceJobStatus] + jobs_status: list[SqlServerInstanceJobStatus] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessment(TypedDict, total=False): + key "additionalInformation": str + key "category": Union[str, MiLinkAssessmentCategory] + key "information": str + key "name": str + key "status": Union[str, AssessmentStatus] + additional_information: str + category: Union[str, MiLinkAssessmentCategory] + failingDbs: list[str] + failing_dbs: list[str] + information: str + name: str + status: Union[str, AssessmentStatus] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentRequest(TypedDict, total=False): + key "availabilityGroupName": Required[str] + key "azureManagedInstanceResourceId": Required[str] + key "azureManagedInstanceRole": Union[str, AzureManagedInstanceRole] + key "databaseNames": Required[list[str]] + key "distributedAvailabilityGroupName": Required[str] + key "sqlServerIpAddress": str + assessmentCategories: list[Union[str, MiLinkAssessmentCategory]] + assessment_categories: list[Union[str, MiLinkAssessmentCategory]] + availability_group_name: str + azure_managed_instance_resource_id: str + azure_managed_instance_role: Union[str, AzureManagedInstanceRole] + database_names: list[str] + distributed_availability_group_name: str + sql_server_ip_address: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentResponse(TypedDict, total=False): + assessments: list[SqlServerInstanceManagedInstanceLinkAssessment] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceMigrationReadinessReportResponse(TypedDict, total=False): + key "createdTime": str + key "isCompressed": bool + key "report": str + created_time: str + is_compressed: bool + report: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceProperties(TypedDict, total=False): + key "alwaysOnRole": Union[str, AlwaysOnRole] + key "authentication": ForwardRef('Authentication', module='types') + key "azureDefenderStatus": Union[str, DefenderStatus] + key "azureDefenderStatusLastUpdated": str + key "backupPolicy": ForwardRef('BackupPolicy', module='types') + key "bestPracticesAssessment": ForwardRef('BestPracticesAssessment', module='types') + key "clientConnection": ForwardRef('ClientConnection', module='types') + key "collation": str + key "containerResourceId": str + key "cores": str + key "createTime": str + key "currentVersion": str + key "databaseMirroringEndpoint": ForwardRef('DBMEndpoint', module='types') + key "dbMasterKeyExists": bool + key "discoverySource": Union[str, DiscoverySource] + key "edition": Union[str, EditionType] + key "failoverCluster": ForwardRef('FailoverCluster', module='types') + key "hostType": Union[str, HostType] + key "instanceName": str + key "isDigiCertPkiCertTrustConfigured": bool + key "isHadrEnabled": bool + key "isMicrosoftPkiCertTrustConfigured": bool + key "lastInventoryUploadTime": str + key "lastUsageUploadTime": str + key "licenseType": Union[str, ArcSqlServerLicenseType] + key "maxServerMemoryMB": int + key "migration": ForwardRef('Migration', module='types') + key "monitoring": ForwardRef('Monitoring', module='types') + key "patchLevel": str + key "productId": str + key "provisioningState": str + key "serviceType": Union[str, ServiceType] + key "status": Union[str, ConnectionStatus] + key "tcpDynamicPorts": str + key "tcpStaticPorts": str + key "upgradeLockedUntil": str + key "vCore": str + key "version": Union[str, SqlVersion] + key "vmId": str + always_on_role: Union[str, AlwaysOnRole] + authentication: Authentication + azure_defender_status: Union[str, DefenderStatus] + azure_defender_status_last_updated: str + backup_policy: BackupPolicy + best_practices_assessment: BestPracticesAssessment + client_connection: ClientConnection + collation: str + container_resource_id: str + cores: str + create_time: str + current_version: str + database_mirroring_endpoint: DBMEndpoint + db_master_key_exists: bool + discovery_source: Union[str, DiscoverySource] + edition: Union[str, EditionType] + failover_cluster: FailoverCluster + host_type: Union[str, HostType] + instance_name: str + is_digi_cert_pki_cert_trust_configured: bool + is_hadr_enabled: bool + is_microsoft_pki_cert_trust_configured: bool + last_inventory_upload_time: str + last_usage_upload_time: str + license_type: Union[str, ArcSqlServerLicenseType] + max_server_memory_mb: int + migration: Migration + monitoring: Monitoring + patch_level: str + product_id: str + provisioning_state: str + service_type: Union[str, ServiceType] + status: Union[str, ConnectionStatus] + tcp_dynamic_ports: str + tcp_static_ports: str + traceFlags: list[int] + trace_flags: list[int] + upgrade_locked_until: str + v_core: str + version: Union[str, SqlVersion] + vm_id: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceRunBestPracticesAssessmentResponse(TypedDict, total=False): + key "backgroundJob": ForwardRef('BackgroundJob', module='types') + key "id": str + key "instanceName": str + key "jobException": str + key "jobStatus": Union[str, JobStatus] + background_job: BackgroundJob + id: str + instance_name: str + job_exception: str + job_status: Union[str, JobStatus] + sequencerActions: list[SequencerAction] + sequencer_actions: list[SequencerAction] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceRunMigrationAssessmentResponse(TypedDict, total=False): + key "backgroundJob": ForwardRef('BackgroundJob', module='types') + key "id": str + key "instanceName": str + key "jobException": str + key "jobStatus": Union[str, JobStatus] + background_job: BackgroundJob + id: str + instance_name: str + job_exception: str + job_status: Union[str, JobStatus] + sequencerActions: list[SequencerAction] + sequencer_actions: list[SequencerAction] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceRunMigrationReadinessAssessmentResponse(TypedDict, total=False): + key "backgroundJob": ForwardRef('BackgroundJob', module='types') + key "id": str + key "instanceName": str + key "jobException": str + key "jobStatus": Union[str, JobStatus] + background_job: BackgroundJob + id: str + instance_name: str + job_exception: str + job_status: Union[str, JobStatus] + sequencerActions: list[SequencerAction] + sequencer_actions: list[SequencerAction] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobRequest(TypedDict, total=False): + key "includeFileLevelRequirements": bool + key "lookbackPeriodInDays": int + key "percentile": int + key "resourceUpdateMode": Union[str, ResourceUpdateMode] + key "targetLocation": str + include_file_level_requirements: bool + lookback_period_in_days: int + percentile: int + resource_update_mode: Union[str, ResourceUpdateMode] + target_location: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobResponse(TypedDict, total=False): + key "jobStatus": Union[str, JobStatus] + job_status: Union[str, JobStatus] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReport(TypedDict, total=False): + key "createdTime": str + key "reportId": str + created_time: str + report_id: str + sections: list[SqlServerInstanceTargetRecommendationReportSection] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportSection(TypedDict, total=False): + key "data": str + key "databaseName": str + key "isCompressed": bool + key "type": Union[str, SqlServerInstanceTargetRecommendationReportSectionType] + data: str + database_name: str + is_compressed: bool + type: Union[str, SqlServerInstanceTargetRecommendationReportSectionType] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsRequest(TypedDict, total=False): + key "reportOffset": int + key "sectionOffset": int + key "sectionType": Union[str, SqlServerInstanceTargetRecommendationReportSectionType] + databaseNames: list[str] + database_names: list[str] + report_offset: int + section_offset: int + section_type: Union[str, SqlServerInstanceTargetRecommendationReportSectionType] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsResponse(TypedDict, total=False): + key "jobStatus": Union[str, JobStatus] + key "nextReportOffset": int + key "nextSectionOffset": int + key "totalReportCount": int + job_status: Union[str, JobStatus] + next_report_offset: int + next_section_offset: int + reports: list[SqlServerInstanceTargetRecommendationReport] + total_report_count: int + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryColumn(TypedDict, total=False): + key "name": str + key "type": Union[str, SqlServerInstanceTelemetryColumnType] + name: str + type: Union[str, SqlServerInstanceTelemetryColumnType] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryRequest(TypedDict, total=False): + key "aggregationType": Union[str, AggregationType] + key "datasetName": Required[str] + key "endTime": str + key "interval": str + key "startTime": str + aggregation_type: Union[str, AggregationType] + databaseNames: list[str] + database_names: list[str] + dataset_name: str + end_time: str + interval: str + start_time: str + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceUpdate(TypedDict, total=False): + key "properties": ForwardRef('SqlServerInstanceUpdateProperties', module='types') + properties: SqlServerInstanceUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerInstanceUpdateProperties(TypedDict, total=False): + key "alwaysOnRole": Union[str, AlwaysOnRole] + key "authentication": ForwardRef('Authentication', module='types') + key "azureDefenderStatus": Union[str, DefenderStatus] + key "azureDefenderStatusLastUpdated": str + key "backupPolicy": ForwardRef('BackupPolicy', module='types') + key "bestPracticesAssessment": ForwardRef('BestPracticesAssessment', module='types') + key "clientConnection": ForwardRef('ClientConnection', module='types') + key "collation": str + key "containerResourceId": str + key "cores": str + key "createTime": str + key "currentVersion": str + key "databaseMirroringEndpoint": ForwardRef('DBMEndpoint', module='types') + key "dbMasterKeyExists": bool + key "discoverySource": Union[str, DiscoverySource] + key "edition": Union[str, EditionType] + key "failoverCluster": ForwardRef('FailoverCluster', module='types') + key "hostType": Union[str, HostType] + key "instanceName": str + key "isDigiCertPkiCertTrustConfigured": bool + key "isHadrEnabled": bool + key "isMicrosoftPkiCertTrustConfigured": bool + key "lastInventoryUploadTime": str + key "lastUsageUploadTime": str + key "licenseType": Union[str, ArcSqlServerLicenseType] + key "maxServerMemoryMB": int + key "migration": ForwardRef('Migration', module='types') + key "monitoring": ForwardRef('Monitoring', module='types') + key "patchLevel": str + key "productId": str + key "provisioningState": str + key "serviceType": Union[str, ServiceType] + key "status": Union[str, ConnectionStatus] + key "tcpDynamicPorts": str + key "tcpStaticPorts": str + key "upgradeLockedUntil": str + key "vCore": str + key "version": Union[str, SqlVersion] + key "vmId": str + always_on_role: Union[str, AlwaysOnRole] + authentication: Authentication + azure_defender_status: Union[str, DefenderStatus] + azure_defender_status_last_updated: str + backup_policy: BackupPolicy + best_practices_assessment: BestPracticesAssessment + client_connection: ClientConnection + collation: str + container_resource_id: str + cores: str + create_time: str + current_version: str + database_mirroring_endpoint: DBMEndpoint + db_master_key_exists: bool + discovery_source: Union[str, DiscoverySource] + edition: Union[str, EditionType] + failover_cluster: FailoverCluster + host_type: Union[str, HostType] + instance_name: str + is_digi_cert_pki_cert_trust_configured: bool + is_hadr_enabled: bool + is_microsoft_pki_cert_trust_configured: bool + last_inventory_upload_time: str + last_usage_upload_time: str + license_type: Union[str, ArcSqlServerLicenseType] + max_server_memory_mb: int + migration: Migration + monitoring: Monitoring + patch_level: str + product_id: str + provisioning_state: str + service_type: Union[str, ServiceType] + status: Union[str, ConnectionStatus] + tcp_dynamic_ports: str + tcp_static_ports: str + traceFlags: list[int] + trace_flags: list[int] + upgrade_locked_until: str + v_core: str + version: Union[str, SqlVersion] + vm_id: str + + + class azure.mgmt.azurearcdata.types.SqlServerLicense(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": Required[SqlServerLicenseProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: SqlServerLicenseProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.SqlServerLicenseProperties(TypedDict, total=False): + key "activationState": Required[Union[str, ActivationState]] + key "billingPlan": Required[Union[str, BillingPlan]] + key "lastActivatedAt": str + key "lastDeactivatedAt": str + key "licenseCategory": Required[Union[str, LicenseCategory]] + key "physicalCores": Required[int] + key "scopeType": Required[Union[str, ScopeType]] + key "tenantId": str + activation_state: Union[str, ActivationState] + billing_plan: Union[str, BillingPlan] + last_activated_at: str + last_deactivated_at: str + license_category: Union[str, LicenseCategory] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: str + + + class azure.mgmt.azurearcdata.types.SqlServerLicenseUpdate(TypedDict, total=False): + key "properties": ForwardRef('SqlServerLicenseUpdateProperties', module='types') + properties: SqlServerLicenseUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.azurearcdata.types.SqlServerLicenseUpdateProperties(TypedDict, total=False): + key "activationState": Union[str, ActivationState] + key "billingPlan": Union[str, BillingPlan] + key "lastActivatedAt": str + key "lastDeactivatedAt": str + key "licenseCategory": Union[str, LicenseCategory] + key "physicalCores": int + key "scopeType": Union[str, ScopeType] + key "tenantId": str + activation_state: Union[str, ActivationState] + billing_plan: Union[str, BillingPlan] + last_activated_at: str + last_deactivated_at: str + license_category: Union[str, LicenseCategory] + physical_cores: int + scope_type: Union[str, ScopeType] + tenant_id: str + + + class azure.mgmt.azurearcdata.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] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.azurearcdata.types.TargetReadiness(TypedDict, total=False): + key "azureSqlDatabase": ForwardRef('SkuRecommendationSummary', module='types') + key "azureSqlManagedInstance": ForwardRef('SkuRecommendationSummary', module='types') + key "azureSqlVirtualMachine": ForwardRef('SkuRecommendationSummary', module='types') + azure_sql_database: SkuRecommendationSummary + azure_sql_managed_instance: SkuRecommendationSummary + azure_sql_virtual_machine: SkuRecommendationSummary + + + class azure.mgmt.azurearcdata.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 + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.azurearcdata.types.UploadServicePrincipal(TypedDict, total=False): + key "authority": str + key "clientId": str + key "clientSecret": str + key "tenantId": str + authority: str + client_id: str + client_secret: str + tenant_id: str + + + class azure.mgmt.azurearcdata.types.UploadWatermark(TypedDict, total=False): + key "logs": str + key "metrics": str + key "usages": str + logs: str + metrics: str + usages: str + + +``` \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/api.metadata.yml b/sdk/azurearcdata/azure-mgmt-azurearcdata/api.metadata.yml new file mode 100644 index 000000000000..4b64c7228dd6 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: d782374d2d51faad8769adc9672e7785da64ff83fe55e2403c44aa15da5ecae4 +parserVersion: 0.3.28 +pythonVersion: 3.13.13 diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/apiview-properties.json b/sdk/azurearcdata/azure-mgmt-azurearcdata/apiview-properties.json index 613e037279f8..c15da2c37cac 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/apiview-properties.json +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/apiview-properties.json @@ -1,126 +1,390 @@ { - "CrossLanguagePackageId": null, + "CrossLanguagePackageId": "Microsoft.AzureArcData", "CrossLanguageDefinitionId": { - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorListResult": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties": null, - "azure.mgmt.azurearcdata.models.Resource": null, - "azure.mgmt.azurearcdata.models.ProxyResource": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers": null, - "azure.mgmt.azurearcdata.models.ActiveDirectoryInformation": null, - "azure.mgmt.azurearcdata.models.BasicLoginInformation": null, - "azure.mgmt.azurearcdata.models.CommonSku": null, - "azure.mgmt.azurearcdata.models.DataControllerProperties": null, - "azure.mgmt.azurearcdata.models.TrackedResource": null, - "azure.mgmt.azurearcdata.models.DataControllerResource": null, - "azure.mgmt.azurearcdata.models.DataControllerUpdate": null, - "azure.mgmt.azurearcdata.models.ErrorResponse": null, - "azure.mgmt.azurearcdata.models.ErrorResponseBody": null, - "azure.mgmt.azurearcdata.models.ExtendedLocation": null, - "azure.mgmt.azurearcdata.models.K8SResourceRequirements": null, - "azure.mgmt.azurearcdata.models.K8SScheduling": null, - "azure.mgmt.azurearcdata.models.K8SSchedulingOptions": null, - "azure.mgmt.azurearcdata.models.KeytabInformation": null, - "azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig": null, - "azure.mgmt.azurearcdata.models.OnPremiseProperty": null, - "azure.mgmt.azurearcdata.models.Operation": null, - "azure.mgmt.azurearcdata.models.OperationDisplay": null, - "azure.mgmt.azurearcdata.models.OperationListResult": null, - "azure.mgmt.azurearcdata.models.PageOfDataControllerResource": null, - "azure.mgmt.azurearcdata.models.PostgresInstance": null, - "azure.mgmt.azurearcdata.models.PostgresInstanceListResult": null, - "azure.mgmt.azurearcdata.models.PostgresInstanceProperties": null, - "azure.mgmt.azurearcdata.models.PostgresInstanceSku": null, - "azure.mgmt.azurearcdata.models.PostgresInstanceUpdate": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstance": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceListResult": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceSku": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate": null, - "azure.mgmt.azurearcdata.models.SqlServerInstance": null, - "azure.mgmt.azurearcdata.models.SqlServerInstanceListResult": null, - "azure.mgmt.azurearcdata.models.SqlServerInstanceProperties": null, - "azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate": null, - "azure.mgmt.azurearcdata.models.SystemData": null, - "azure.mgmt.azurearcdata.models.UploadServicePrincipal": null, - "azure.mgmt.azurearcdata.models.UploadWatermark": null, - "azure.mgmt.azurearcdata.models.OperationOrigin": null, - "azure.mgmt.azurearcdata.models.CreatedByType": null, - "azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType": null, - "azure.mgmt.azurearcdata.models.ExtendedLocationTypes": null, - "azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier": null, - "azure.mgmt.azurearcdata.models.SqlVersion": null, - "azure.mgmt.azurearcdata.models.EditionType": null, - "azure.mgmt.azurearcdata.models.ConnectionStatus": null, - "azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType": null, - "azure.mgmt.azurearcdata.models.DefenderStatus": null, - "azure.mgmt.azurearcdata.models.HostType": null, - "azure.mgmt.azurearcdata.models.Infrastructure": null, - "azure.mgmt.azurearcdata.models.AccountProvisioningMode": null, - "azure.mgmt.azurearcdata.operations.Operations.list": null, - "azure.mgmt.azurearcdata.aio.operations.Operations.list": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.list": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.list": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.get": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.get": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.update": null, - "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.update": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.list": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.list": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.get": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.get": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.update": null, - "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.update": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.list_in_subscription": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.list_in_subscription": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.list_in_group": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.list_in_group": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_put_data_controller": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_put_data_controller": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_delete_data_controller": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_delete_data_controller": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.get_data_controller": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.get_data_controller": null, - "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_patch_data_controller": null, - "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_patch_data_controller": null, - "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.list": null, - "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.list": null, - "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.begin_create": null, - "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.begin_create": null, - "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.begin_delete": null, - "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.begin_delete": null, - "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.get": null, - "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.get": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.list": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.list": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.list_by_resource_group": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.get": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.get": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.begin_create": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.begin_delete": null, - "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.update": null, - "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.update": null - } + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails": "Microsoft.AzureArcData.ActiveDirectoryConnectorDNSDetails", + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails": "Microsoft.AzureArcData.ActiveDirectoryConnectorDomainDetails", + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties": "Microsoft.AzureArcData.ActiveDirectoryConnectorProperties", + "azure.mgmt.azurearcdata.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.azurearcdata.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource": "Microsoft.AzureArcData.ActiveDirectoryConnectorResource", + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec": "Microsoft.AzureArcData.ActiveDirectoryConnectorSpec", + "azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus": "Microsoft.AzureArcData.ActiveDirectoryConnectorStatus", + "azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController": "Microsoft.AzureArcData.ActiveDirectoryDomainController", + "azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers": "Microsoft.AzureArcData.ActiveDirectoryDomainControllers", + "azure.mgmt.azurearcdata.models.ActiveDirectoryInformation": "Microsoft.AzureArcData.ActiveDirectoryInformation", + "azure.mgmt.azurearcdata.models.AdditionalMigrationJobAttributes": "Microsoft.AzureArcData.AdditionalMigrationJobAttributes", + "azure.mgmt.azurearcdata.models.Authentication": "Microsoft.AzureArcData.Authentication", + "azure.mgmt.azurearcdata.models.AvailabilityGroupConfigure": "Microsoft.AzureArcData.AvailabilityGroupConfigure", + "azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration": "Microsoft.AzureArcData.AvailabilityGroupCreateUpdateConfiguration", + "azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateReplicaConfiguration": "Microsoft.AzureArcData.AvailabilityGroupCreateUpdateReplicaConfiguration", + "azure.mgmt.azurearcdata.models.AvailabilityGroupInfo": "Microsoft.AzureArcData.AvailabilityGroupInfo", + "azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters": "Microsoft.AzureArcData.AvailabilityGroupRetrievalFilters", + "azure.mgmt.azurearcdata.models.AvailabilityGroupState": "Microsoft.AzureArcData.AvailabilityGroupState", + "azure.mgmt.azurearcdata.models.BackgroundJob": "Microsoft.AzureArcData.BackgroundJob", + "azure.mgmt.azurearcdata.models.BackupPolicy": "Microsoft.AzureArcData.BackupPolicy", + "azure.mgmt.azurearcdata.models.BasicLoginInformation": "Microsoft.AzureArcData.BasicLoginInformation", + "azure.mgmt.azurearcdata.models.BestPracticesAssessment": "Microsoft.AzureArcData.BestPracticesAssessment", + "azure.mgmt.azurearcdata.models.ClientConnection": "Microsoft.AzureArcData.ClientConnection", + "azure.mgmt.azurearcdata.models.CommonSku": "Microsoft.AzureArcData.CommonSku", + "azure.mgmt.azurearcdata.models.CostOptionSelectedValues": "Microsoft.AzureArcData.CostOptionSelectedValues", + "azure.mgmt.azurearcdata.models.CostTypeValues": "Microsoft.AzureArcData.CostTypeValues", + "azure.mgmt.azurearcdata.models.CronTrigger": "Microsoft.AzureArcData.CronTrigger", + "azure.mgmt.azurearcdata.models.DatabaseAssessmentsItem": "Microsoft.AzureArcData.DatabaseAssessmentsItem", + "azure.mgmt.azurearcdata.models.DataBaseMigration": "Microsoft.AzureArcData.DataBaseMigration", + "azure.mgmt.azurearcdata.models.DataBaseMigrationAssessment": "Microsoft.AzureArcData.DataBaseMigrationAssessment", + "azure.mgmt.azurearcdata.models.DatabaseMigrationJobsItem": "Microsoft.AzureArcData.DatabaseMigrationJobsItem", + "azure.mgmt.azurearcdata.models.Databases": "Microsoft.AzureArcData.databases", + "azure.mgmt.azurearcdata.models.DataControllerProperties": "Microsoft.AzureArcData.DataControllerProperties", + "azure.mgmt.azurearcdata.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.azurearcdata.models.DataControllerResource": "Microsoft.AzureArcData.DataControllerResource", + "azure.mgmt.azurearcdata.models.DataControllerUpdate": "Microsoft.AzureArcData.DataControllerUpdate", + "azure.mgmt.azurearcdata.models.DBMEndpoint": "Microsoft.AzureArcData.DBMEndpoint", + "azure.mgmt.azurearcdata.models.DiskSizes": "Microsoft.AzureArcData.DiskSizes", + "azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration": "Microsoft.AzureArcData.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration", + "azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration": "Microsoft.AzureArcData.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration", + "azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration": "Microsoft.AzureArcData.DistributedAvailabilityGroupCreateUpdateConfiguration", + "azure.mgmt.azurearcdata.models.EntraAuthentication": "Microsoft.AzureArcData.EntraAuthentication", + "azure.mgmt.azurearcdata.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.azurearcdata.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.azurearcdata.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.azurearcdata.models.ExtendedLocation": "Microsoft.AzureArcData.ExtendedLocation", + "azure.mgmt.azurearcdata.models.FailoverCluster": "Microsoft.AzureArcData.FailoverCluster", + "azure.mgmt.azurearcdata.models.FailoverGroupProperties": "Microsoft.AzureArcData.FailoverGroupProperties", + "azure.mgmt.azurearcdata.models.FailoverGroupResource": "Microsoft.AzureArcData.FailoverGroupResource", + "azure.mgmt.azurearcdata.models.FailoverGroupSpec": "Microsoft.AzureArcData.FailoverGroupSpec", + "azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId": "Microsoft.AzureArcData.FailoverMiLinkResourceId", + "azure.mgmt.azurearcdata.models.HostIPAddressInformation": "Microsoft.AzureArcData.hostIPAddressInformation", + "azure.mgmt.azurearcdata.models.ImpactedObjectsInfo": "Microsoft.AzureArcData.ImpactedObjectsInfo", + "azure.mgmt.azurearcdata.models.ImpactedObjectsSuitabilitySummary": "Microsoft.AzureArcData.ImpactedObjectsSuitabilitySummary", + "azure.mgmt.azurearcdata.models.K8SActiveDirectory": "Microsoft.AzureArcData.K8sActiveDirectory", + "azure.mgmt.azurearcdata.models.K8SActiveDirectoryConnector": "Microsoft.AzureArcData.K8sActiveDirectoryConnector", + "azure.mgmt.azurearcdata.models.K8SNetworkSettings": "Microsoft.AzureArcData.K8sNetworkSettings", + "azure.mgmt.azurearcdata.models.K8SResourceRequirements": "Microsoft.AzureArcData.K8sResourceRequirements", + "azure.mgmt.azurearcdata.models.K8SScheduling": "Microsoft.AzureArcData.K8sScheduling", + "azure.mgmt.azurearcdata.models.K8SSchedulingOptions": "Microsoft.AzureArcData.K8sSchedulingOptions", + "azure.mgmt.azurearcdata.models.K8SSecurity": "Microsoft.AzureArcData.K8sSecurity", + "azure.mgmt.azurearcdata.models.K8SSettings": "Microsoft.AzureArcData.K8sSettings", + "azure.mgmt.azurearcdata.models.K8StransparentDataEncryption": "Microsoft.AzureArcData.k8stransparentDataEncryption", + "azure.mgmt.azurearcdata.models.KeytabInformation": "Microsoft.AzureArcData.KeytabInformation", + "azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig": "Microsoft.AzureArcData.LogAnalyticsWorkspaceConfig", + "azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration": "Microsoft.AzureArcData.ManagedInstanceLinkCreateUpdateConfiguration", + "azure.mgmt.azurearcdata.models.Migration": "Microsoft.AzureArcData.Migration", + "azure.mgmt.azurearcdata.models.MigrationAssessment": "Microsoft.AzureArcData.MigrationAssessment", + "azure.mgmt.azurearcdata.models.MigrationAssessmentSettings": "Microsoft.AzureArcData.MigrationAssessmentSettings", + "azure.mgmt.azurearcdata.models.MiLinkCreateUpdateConfiguration": "Microsoft.AzureArcData.MiLinkCreateUpdateConfiguration", + "azure.mgmt.azurearcdata.models.Monitoring": "Microsoft.AzureArcData.Monitoring", + "azure.mgmt.azurearcdata.models.OnPremiseProperty": "Microsoft.AzureArcData.OnPremiseProperty", + "azure.mgmt.azurearcdata.models.Operation": "Microsoft.AzureArcData.Operation", + "azure.mgmt.azurearcdata.models.OperationDisplay": "Microsoft.AzureArcData.OperationDisplay", + "azure.mgmt.azurearcdata.models.PostgresInstance": "Microsoft.AzureArcData.PostgresInstance", + "azure.mgmt.azurearcdata.models.PostgresInstanceProperties": "Microsoft.AzureArcData.PostgresInstanceProperties", + "azure.mgmt.azurearcdata.models.PostgresInstanceSku": "Microsoft.AzureArcData.PostgresInstanceSku", + "azure.mgmt.azurearcdata.models.PostgresInstanceUpdate": "Microsoft.AzureArcData.PostgresInstanceUpdate", + "azure.mgmt.azurearcdata.models.Schedule": "Microsoft.AzureArcData.Schedule", + "azure.mgmt.azurearcdata.models.SequencerAction": "Microsoft.AzureArcData.SequencerAction", + "azure.mgmt.azurearcdata.models.ServerAssessmentsItem": "Microsoft.AzureArcData.ServerAssessmentsItem", + "azure.mgmt.azurearcdata.models.ServerAssessmentsPropertiesItemsItem": "Microsoft.AzureArcData.ServerAssessmentsPropertiesItemsItem", + "azure.mgmt.azurearcdata.models.SkuRecommendationResults": "Microsoft.AzureArcData.SkuRecommendationResults", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabase": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlDatabase", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSku": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlDatabaseTargetSku", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstance": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlManagedInstance", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachine": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlVirtualMachine", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize": "Microsoft.AzureArcData.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost": "Microsoft.AzureArcData.SkuRecommendationResultsMonthlyCost", + "azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem": "Microsoft.AzureArcData.SkuRecommendationResultsMonthlyCostOptionItem", + "azure.mgmt.azurearcdata.models.SkuRecommendationSummary": "Microsoft.AzureArcData.SkuRecommendationSummary", + "azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSku": "Microsoft.AzureArcData.SkuRecommendationSummaryTargetSku", + "azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSkuCategory": "Microsoft.AzureArcData.SkuRecommendationSummaryTargetSkuCategory", + "azure.mgmt.azurearcdata.models.SqlAvailabilityGroupDatabaseReplicaResourceProperties": "Microsoft.AzureArcData.SqlAvailabilityGroupDatabaseReplicaResourceProperties", + "azure.mgmt.azurearcdata.models.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem": "Microsoft.AzureArcData.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem", + "azure.mgmt.azurearcdata.models.SqlAvailabilityGroupReplicaResourceProperties": "Microsoft.AzureArcData.SqlAvailabilityGroupReplicaResourceProperties", + "azure.mgmt.azurearcdata.models.SqlAvailabilityGroupStaticIPListenerProperties": "Microsoft.AzureArcData.SqlAvailabilityGroupStaticIPListenerProperties", + "azure.mgmt.azurearcdata.models.SqlManagedInstance": "Microsoft.AzureArcData.SqlManagedInstance", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw": "Microsoft.AzureArcData.SqlManagedInstanceK8sRaw", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec": "Microsoft.AzureArcData.SqlManagedInstanceK8sSpec", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties": "Microsoft.AzureArcData.SqlManagedInstanceProperties", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceSku": "Microsoft.AzureArcData.SqlManagedInstanceSku", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate": "Microsoft.AzureArcData.SqlManagedInstanceUpdate", + "azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResource", + "azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourceProperties": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResourceProperties", + "azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesDatabases": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResourcePropertiesDatabases", + "azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesReplicas": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResourcePropertiesReplicas", + "azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate": "Microsoft.AzureArcData.SqlServerAvailabilityGroupUpdate", + "azure.mgmt.azurearcdata.models.SqlServerDatabaseResource": "Microsoft.AzureArcData.SqlServerDatabaseResource", + "azure.mgmt.azurearcdata.models.SqlServerDatabaseResourceProperties": "Microsoft.AzureArcData.SqlServerDatabaseResourceProperties", + "azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesBackupInformation": "Microsoft.AzureArcData.SqlServerDatabaseResourcePropertiesBackupInformation", + "azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesDatabaseOptions": "Microsoft.AzureArcData.SqlServerDatabaseResourcePropertiesDatabaseOptions", + "azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate": "Microsoft.AzureArcData.SqlServerDatabaseUpdate", + "azure.mgmt.azurearcdata.models.SqlServerEsuLicense": "Microsoft.AzureArcData.SqlServerEsuLicense", + "azure.mgmt.azurearcdata.models.SqlServerEsuLicenseProperties": "Microsoft.AzureArcData.SqlServerEsuLicenseProperties", + "azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate": "Microsoft.AzureArcData.SqlServerEsuLicenseUpdate", + "azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdateProperties": "Microsoft.AzureArcData.SqlServerEsuLicenseUpdateProperties", + "azure.mgmt.azurearcdata.models.SqlServerInstance": "Microsoft.AzureArcData.SqlServerInstance", + "azure.mgmt.azurearcdata.models.SqlServerInstanceBpaColumn": "Microsoft.AzureArcData.SqlServerInstanceBpaColumn", + "azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest": "Microsoft.AzureArcData.SqlServerInstanceBpaRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJob": "Microsoft.AzureArcData.SqlServerInstanceJob", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest": "Microsoft.AzureArcData.SqlServerInstanceJobsRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse": "Microsoft.AzureArcData.SqlServerInstanceJobsResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest": "Microsoft.AzureArcData.SqlServerInstanceJobsStatusRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse": "Microsoft.AzureArcData.SqlServerInstanceJobsStatusResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceJobStatus": "Microsoft.AzureArcData.SqlServerInstanceJobStatus", + "azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessment": "Microsoft.AzureArcData.SqlServerInstanceManagedInstanceLinkAssessment", + "azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest": "Microsoft.AzureArcData.SqlServerInstanceManagedInstanceLinkAssessmentRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse": "Microsoft.AzureArcData.SqlServerInstanceManagedInstanceLinkAssessmentResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceMigrationReadinessReportResponse": "Microsoft.AzureArcData.SqlServerInstanceMigrationReadinessReportResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceProperties": "Microsoft.AzureArcData.SqlServerInstanceProperties", + "azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse": "Microsoft.AzureArcData.SqlServerInstanceRunBestPracticesAssessmentResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationAssessmentResponse": "Microsoft.AzureArcData.SqlServerInstanceRunMigrationAssessmentResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationReadinessAssessmentResponse": "Microsoft.AzureArcData.SqlServerInstanceRunMigrationReadinessAssessmentResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest": "Microsoft.AzureArcData.SqlServerInstanceRunTargetRecommendationJobRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse": "Microsoft.AzureArcData.SqlServerInstanceRunTargetRecommendationJobResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReport": "Microsoft.AzureArcData.SqlServerInstanceTargetRecommendationReport", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSection": "Microsoft.AzureArcData.SqlServerInstanceTargetRecommendationReportSection", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest": "Microsoft.AzureArcData.SqlServerInstanceTargetRecommendationReportsRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse": "Microsoft.AzureArcData.SqlServerInstanceTargetRecommendationReportsResponse", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryColumn": "Microsoft.AzureArcData.SqlServerInstanceTelemetryColumn", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest": "Microsoft.AzureArcData.SqlServerInstanceTelemetryRequest", + "azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate": "Microsoft.AzureArcData.SqlServerInstanceUpdate", + "azure.mgmt.azurearcdata.models.SqlServerInstanceUpdateProperties": "Microsoft.AzureArcData.SqlServerInstanceUpdateProperties", + "azure.mgmt.azurearcdata.models.SqlServerLicense": "Microsoft.AzureArcData.SqlServerLicense", + "azure.mgmt.azurearcdata.models.SqlServerLicenseProperties": "Microsoft.AzureArcData.SqlServerLicenseProperties", + "azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate": "Microsoft.AzureArcData.SqlServerLicenseUpdate", + "azure.mgmt.azurearcdata.models.SqlServerLicenseUpdateProperties": "Microsoft.AzureArcData.SqlServerLicenseUpdateProperties", + "azure.mgmt.azurearcdata.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.azurearcdata.models.TargetReadiness": "Microsoft.AzureArcData.TargetReadiness", + "azure.mgmt.azurearcdata.models.UploadServicePrincipal": "Microsoft.AzureArcData.UploadServicePrincipal", + "azure.mgmt.azurearcdata.models.UploadWatermark": "Microsoft.AzureArcData.UploadWatermark", + "azure.mgmt.azurearcdata.models.OperationOrigin": "Microsoft.AzureArcData.OperationOrigin", + "azure.mgmt.azurearcdata.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType": "Microsoft.AzureArcData.ArcSqlManagedInstanceLicenseType", + "azure.mgmt.azurearcdata.models.ExtendedLocationTypes": "Microsoft.AzureArcData.ExtendedLocationTypes", + "azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier": "Microsoft.AzureArcData.SqlManagedInstanceSkuTier", + "azure.mgmt.azurearcdata.models.SqlVersion": "Microsoft.AzureArcData.SqlVersion", + "azure.mgmt.azurearcdata.models.EditionType": "Microsoft.AzureArcData.EditionType", + "azure.mgmt.azurearcdata.models.ConnectionStatus": "Microsoft.AzureArcData.ConnectionStatus", + "azure.mgmt.azurearcdata.models.DiscoverySource": "Microsoft.AzureArcData.DiscoverySource", + "azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType": "Microsoft.AzureArcData.ArcSqlServerLicenseType", + "azure.mgmt.azurearcdata.models.DefenderStatus": "Microsoft.AzureArcData.DefenderStatus", + "azure.mgmt.azurearcdata.models.HostType": "Microsoft.AzureArcData.HostType", + "azure.mgmt.azurearcdata.models.AlwaysOnRole": "Microsoft.AzureArcData.AlwaysOnRole", + "azure.mgmt.azurearcdata.models.Role": "Microsoft.AzureArcData.Role", + "azure.mgmt.azurearcdata.models.EncryptionAlgorithm": "Microsoft.AzureArcData.EncryptionAlgorithm", + "azure.mgmt.azurearcdata.models.ConnectionAuth": "Microsoft.AzureArcData.ConnectionAuth", + "azure.mgmt.azurearcdata.models.DifferentialBackupHours": "Microsoft.AzureArcData.DifferentialBackupHours", + "azure.mgmt.azurearcdata.models.RecommendationStatus": "Microsoft.AzureArcData.RecommendationStatus", + "azure.mgmt.azurearcdata.models.ServiceType": "Microsoft.AzureArcData.ServiceType", + "azure.mgmt.azurearcdata.models.Mode": "Microsoft.AzureArcData.Mode", + "azure.mgmt.azurearcdata.models.IdentityType": "Microsoft.AzureArcData.IdentityType", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryColumnType": "Microsoft.AzureArcData.SqlServerInstanceTelemetryColumnType", + "azure.mgmt.azurearcdata.models.AggregationType": "Microsoft.AzureArcData.AggregationType", + "azure.mgmt.azurearcdata.models.SqlServerInstanceBpaColumnType": "Microsoft.AzureArcData.SqlServerInstanceBpaColumnType", + "azure.mgmt.azurearcdata.models.SqlServerInstanceBpaReportType": "Microsoft.AzureArcData.SqlServerInstanceBpaReportType", + "azure.mgmt.azurearcdata.models.SqlServerInstanceBpaQueryType": "Microsoft.AzureArcData.SqlServerInstanceBpaQueryType", + "azure.mgmt.azurearcdata.models.JobStatus": "Microsoft.AzureArcData.JobStatus", + "azure.mgmt.azurearcdata.models.State": "Microsoft.AzureArcData.State", + "azure.mgmt.azurearcdata.models.ExecutionState": "Microsoft.AzureArcData.ExecutionState", + "azure.mgmt.azurearcdata.models.LastExecutionStatus": "Microsoft.AzureArcData.LastExecutionStatus", + "azure.mgmt.azurearcdata.models.SequencerState": "Microsoft.AzureArcData.SequencerState", + "azure.mgmt.azurearcdata.models.Result": "Microsoft.AzureArcData.Result", + "azure.mgmt.azurearcdata.models.ResourceUpdateMode": "Microsoft.AzureArcData.ResourceUpdateMode", + "azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSectionType": "Microsoft.AzureArcData.SqlServerInstanceTargetRecommendationReportSectionType", + "azure.mgmt.azurearcdata.models.MiLinkAssessmentCategory": "Microsoft.AzureArcData.MiLinkAssessmentCategory", + "azure.mgmt.azurearcdata.models.AssessmentStatus": "Microsoft.AzureArcData.AssessmentStatus", + "azure.mgmt.azurearcdata.models.AzureManagedInstanceRole": "Microsoft.AzureArcData.AzureManagedInstanceRole", + "azure.mgmt.azurearcdata.models.ReplicationPartnerType": "Microsoft.AzureArcData.ReplicationPartnerType", + "azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityMode": "Microsoft.AzureArcData.ArcSqlServerAvailabilityMode", + "azure.mgmt.azurearcdata.models.ArcSqlServerFailoverMode": "Microsoft.AzureArcData.ArcSqlServerFailoverMode", + "azure.mgmt.azurearcdata.models.PrimaryAllowConnections": "Microsoft.AzureArcData.PrimaryAllowConnections", + "azure.mgmt.azurearcdata.models.SecondaryAllowConnections": "Microsoft.AzureArcData.SecondaryAllowConnections", + "azure.mgmt.azurearcdata.models.SeedingMode": "Microsoft.AzureArcData.SeedingMode", + "azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityGroupTypeFilter": "Microsoft.AzureArcData.ArcSqlServerAvailabilityGroupTypeFilter", + "azure.mgmt.azurearcdata.models.BillingPlan": "Microsoft.AzureArcData.BillingPlan", + "azure.mgmt.azurearcdata.models.LicenseCategory": "Microsoft.AzureArcData.LicenseCategory", + "azure.mgmt.azurearcdata.models.ActivationState": "Microsoft.AzureArcData.ActivationState", + "azure.mgmt.azurearcdata.models.ScopeType": "Microsoft.AzureArcData.ScopeType", + "azure.mgmt.azurearcdata.models.Version": "Microsoft.AzureArcData.Version", + "azure.mgmt.azurearcdata.models.ProvisioningState": "Microsoft.AzureArcData.ProvisioningState", + "azure.mgmt.azurearcdata.models.FailoverGroupPartnerSyncMode": "Microsoft.AzureArcData.FailoverGroupPartnerSyncMode", + "azure.mgmt.azurearcdata.models.InstanceFailoverGroupRole": "Microsoft.AzureArcData.InstanceFailoverGroupRole", + "azure.mgmt.azurearcdata.models.AutomatedBackupPreference": "Microsoft.AzureArcData.AutomatedBackupPreference", + "azure.mgmt.azurearcdata.models.FailureConditionLevel": "Microsoft.AzureArcData.FailureConditionLevel", + "azure.mgmt.azurearcdata.models.DbFailover": "Microsoft.AzureArcData.DbFailover", + "azure.mgmt.azurearcdata.models.DtcSupport": "Microsoft.AzureArcData.DtcSupport", + "azure.mgmt.azurearcdata.models.ClusterType": "Microsoft.AzureArcData.ClusterType", + "azure.mgmt.azurearcdata.models.Infrastructure": "Microsoft.AzureArcData.Infrastructure", + "azure.mgmt.azurearcdata.models.AccountProvisioningMode": "Microsoft.AzureArcData.AccountProvisioningMode", + "azure.mgmt.azurearcdata.models.DatabaseState": "Microsoft.AzureArcData.DatabaseState", + "azure.mgmt.azurearcdata.models.RecoveryMode": "Microsoft.AzureArcData.RecoveryMode", + "azure.mgmt.azurearcdata.models.DatabaseCreateMode": "Microsoft.AzureArcData.DatabaseCreateMode", + "azure.mgmt.azurearcdata.models.MigrationMode": "Microsoft.AzureArcData.MigrationMode", + "azure.mgmt.azurearcdata.models.InitiatedFrom": "Microsoft.AzureArcData.initiatedFrom", + "azure.mgmt.azurearcdata.models.MigrationStatus": "Microsoft.AzureArcData.MigrationStatus", + "azure.mgmt.azurearcdata.models.TargetType": "Microsoft.AzureArcData.TargetType", + "azure.mgmt.azurearcdata.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.azurearcdata.aio.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.get": "Microsoft.AzureArcData.SqlManagedInstances.get", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.get": "Microsoft.AzureArcData.SqlManagedInstances.get", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.begin_create": "Microsoft.AzureArcData.SqlManagedInstances.create", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.begin_create": "Microsoft.AzureArcData.SqlManagedInstances.create", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.update": "Microsoft.AzureArcData.SqlManagedInstances.update", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.update": "Microsoft.AzureArcData.SqlManagedInstances.update", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.begin_delete": "Microsoft.AzureArcData.SqlManagedInstances.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.begin_delete": "Microsoft.AzureArcData.SqlManagedInstances.delete", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlManagedInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlManagedInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations.list": "Microsoft.AzureArcData.SqlManagedInstances.list", + "azure.mgmt.azurearcdata.aio.operations.SqlManagedInstancesOperations.list": "Microsoft.AzureArcData.SqlManagedInstances.list", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.get": "Microsoft.AzureArcData.SqlServerInstances.get", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.get": "Microsoft.AzureArcData.SqlServerInstances.get", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_create": "Microsoft.AzureArcData.SqlServerInstances.create", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_create": "Microsoft.AzureArcData.SqlServerInstances.create", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_update": "Microsoft.AzureArcData.SqlServerInstances.update", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_update": "Microsoft.AzureArcData.SqlServerInstances.update", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_delete": "Microsoft.AzureArcData.SqlServerInstances.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_delete": "Microsoft.AzureArcData.SqlServerInstances.delete", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.list": "Microsoft.AzureArcData.SqlServerInstances.list", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.list": "Microsoft.AzureArcData.SqlServerInstances.list", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_get_telemetry": "Microsoft.AzureArcData.SqlServerInstances.getTelemetry", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_get_telemetry": "Microsoft.AzureArcData.SqlServerInstances.getTelemetry", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_get_best_practices_assessment": "Microsoft.AzureArcData.SqlServerInstances.getBestPracticesAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_get_best_practices_assessment": "Microsoft.AzureArcData.SqlServerInstances.getBestPracticesAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.run_migration_assessment": "Microsoft.AzureArcData.SqlServerInstances.runMigrationAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.run_migration_assessment": "Microsoft.AzureArcData.SqlServerInstances.runMigrationAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_run_target_recommendation_job": "Microsoft.AzureArcData.SqlServerInstances.runTargetRecommendationJob", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_run_target_recommendation_job": "Microsoft.AzureArcData.SqlServerInstances.runTargetRecommendationJob", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_get_target_recommendation_reports": "Microsoft.AzureArcData.SqlServerInstances.getTargetRecommendationReports", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_get_target_recommendation_reports": "Microsoft.AzureArcData.SqlServerInstances.getTargetRecommendationReports", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_get_migration_readiness_report": "Microsoft.AzureArcData.SqlServerInstances.getMigrationReadinessReport", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_get_migration_readiness_report": "Microsoft.AzureArcData.SqlServerInstances.getMigrationReadinessReport", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.run_best_practices_assessment": "Microsoft.AzureArcData.SqlServerInstances.runBestPracticesAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.run_best_practices_assessment": "Microsoft.AzureArcData.SqlServerInstances.runBestPracticesAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_run_best_practice_assessment": "Microsoft.AzureArcData.SqlServerInstances.runBestPracticeAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_run_best_practice_assessment": "Microsoft.AzureArcData.SqlServerInstances.runBestPracticeAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_run_migration_readiness_assessment": "Microsoft.AzureArcData.SqlServerInstances.runMigrationReadinessAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_run_migration_readiness_assessment": "Microsoft.AzureArcData.SqlServerInstances.runMigrationReadinessAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.get_jobs_status": "Microsoft.AzureArcData.SqlServerInstances.getJobsStatus", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.get_jobs_status": "Microsoft.AzureArcData.SqlServerInstances.getJobsStatus", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_get_jobs": "Microsoft.AzureArcData.SqlServerInstances.getJobs", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_get_jobs": "Microsoft.AzureArcData.SqlServerInstances.getJobs", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.pre_upgrade": "Microsoft.AzureArcData.SqlServerInstances.preUpgrade", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.pre_upgrade": "Microsoft.AzureArcData.SqlServerInstances.preUpgrade", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.post_upgrade": "Microsoft.AzureArcData.SqlServerInstances.postUpgrade", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.post_upgrade": "Microsoft.AzureArcData.SqlServerInstances.postUpgrade", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.begin_run_managed_instance_link_assessment": "Microsoft.AzureArcData.SqlServerInstances.runManagedInstanceLinkAssessment", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.begin_run_managed_instance_link_assessment": "Microsoft.AzureArcData.SqlServerInstances.runManagedInstanceLinkAssessment", + "azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations.get_all_availability_groups": "Microsoft.AzureArcData.SqlServerInstances.getAllAvailabilityGroups", + "azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations.get_all_availability_groups": "Microsoft.AzureArcData.SqlServerInstances.getAllAvailabilityGroups", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.get": "Microsoft.AzureArcData.SqlServerLicenses.get", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.get": "Microsoft.AzureArcData.SqlServerLicenses.get", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.create": "Microsoft.AzureArcData.SqlServerLicenses.create", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.create": "Microsoft.AzureArcData.SqlServerLicenses.create", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.update": "Microsoft.AzureArcData.SqlServerLicenses.update", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.update": "Microsoft.AzureArcData.SqlServerLicenses.update", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.delete": "Microsoft.AzureArcData.SqlServerLicenses.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.delete": "Microsoft.AzureArcData.SqlServerLicenses.delete", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerLicenses.listByResourceGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerLicenses.listByResourceGroup", + "azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations.list": "Microsoft.AzureArcData.SqlServerLicenses.list", + "azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations.list": "Microsoft.AzureArcData.SqlServerLicenses.list", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.get": "Microsoft.AzureArcData.PostgresInstances.get", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.get": "Microsoft.AzureArcData.PostgresInstances.get", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.begin_create": "Microsoft.AzureArcData.PostgresInstances.create", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.begin_create": "Microsoft.AzureArcData.PostgresInstances.create", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.update": "Microsoft.AzureArcData.PostgresInstances.update", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.update": "Microsoft.AzureArcData.PostgresInstances.update", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.begin_delete": "Microsoft.AzureArcData.PostgresInstances.delete", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.begin_delete": "Microsoft.AzureArcData.PostgresInstances.delete", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.PostgresInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.list_by_resource_group": "Microsoft.AzureArcData.PostgresInstances.listByResourceGroup", + "azure.mgmt.azurearcdata.operations.PostgresInstancesOperations.list": "Microsoft.AzureArcData.PostgresInstances.list", + "azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations.list": "Microsoft.AzureArcData.PostgresInstances.list", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.get": "Microsoft.AzureArcData.SqlServerEsuLicenses.get", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.get": "Microsoft.AzureArcData.SqlServerEsuLicenses.get", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.create": "Microsoft.AzureArcData.SqlServerEsuLicenses.create", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.create": "Microsoft.AzureArcData.SqlServerEsuLicenses.create", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.update": "Microsoft.AzureArcData.SqlServerEsuLicenses.update", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.update": "Microsoft.AzureArcData.SqlServerEsuLicenses.update", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.delete": "Microsoft.AzureArcData.SqlServerEsuLicenses.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.delete": "Microsoft.AzureArcData.SqlServerEsuLicenses.delete", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerEsuLicenses.listByResourceGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.list_by_resource_group": "Microsoft.AzureArcData.SqlServerEsuLicenses.listByResourceGroup", + "azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations.list": "Microsoft.AzureArcData.SqlServerEsuLicenses.list", + "azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations.list": "Microsoft.AzureArcData.SqlServerEsuLicenses.list", + "azure.mgmt.azurearcdata.operations.FailoverGroupsOperations.get": "Microsoft.AzureArcData.FailoverGroupResources.get", + "azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations.get": "Microsoft.AzureArcData.FailoverGroupResources.get", + "azure.mgmt.azurearcdata.operations.FailoverGroupsOperations.begin_create": "Microsoft.AzureArcData.FailoverGroupResources.create", + "azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations.begin_create": "Microsoft.AzureArcData.FailoverGroupResources.create", + "azure.mgmt.azurearcdata.operations.FailoverGroupsOperations.begin_delete": "Microsoft.AzureArcData.FailoverGroupResources.delete", + "azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations.begin_delete": "Microsoft.AzureArcData.FailoverGroupResources.delete", + "azure.mgmt.azurearcdata.operations.FailoverGroupsOperations.list": "Microsoft.AzureArcData.FailoverGroupResources.list", + "azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations.list": "Microsoft.AzureArcData.FailoverGroupResources.list", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_create_availability_group": "Microsoft.AzureArcData.SqlServerInstances.createAvailabilityGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_create_availability_group": "Microsoft.AzureArcData.SqlServerInstances.createAvailabilityGroup", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_create_distributed_availability_group": "Microsoft.AzureArcData.SqlServerInstances.createDistributedAvailabilityGroup", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_create_distributed_availability_group": "Microsoft.AzureArcData.SqlServerInstances.createDistributedAvailabilityGroup", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_create_managed_instance_link": "Microsoft.AzureArcData.SqlServerInstances.createManagedInstanceLink", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_create_managed_instance_link": "Microsoft.AzureArcData.SqlServerInstances.createManagedInstanceLink", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.get": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.get", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.get": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.get", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.create": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.create", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.create": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.create", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_update": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.update", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_update": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.update", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_delete": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_delete": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.delete", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.list": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.list", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.list": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.list", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.detail_view": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.detailView", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.detail_view": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.detailView", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.failover": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.failover", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.failover": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.failover", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.force_failover_allow_data_loss": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.forceFailoverAllowDataLoss", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.force_failover_allow_data_loss": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.forceFailoverAllowDataLoss", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.add_databases": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.addDatabases", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.add_databases": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.addDatabases", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_failover_mi_link": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.failoverMiLink", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_failover_mi_link": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.failoverMiLink", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.begin_delete_mi_link": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.deleteMiLink", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.begin_delete_mi_link": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.deleteMiLink", + "azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations.remove_databases": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.removeDatabases", + "azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations.remove_databases": "Microsoft.AzureArcData.SqlServerAvailabilityGroupResources.removeDatabases", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.get_data_controller": "Microsoft.AzureArcData.DataControllerResources.getDataController", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.get_data_controller": "Microsoft.AzureArcData.DataControllerResources.getDataController", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_put_data_controller": "Microsoft.AzureArcData.DataControllerResources.putDataController", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_put_data_controller": "Microsoft.AzureArcData.DataControllerResources.putDataController", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_patch_data_controller": "Microsoft.AzureArcData.DataControllerResources.patchDataController", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_patch_data_controller": "Microsoft.AzureArcData.DataControllerResources.patchDataController", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.begin_delete_data_controller": "Microsoft.AzureArcData.DataControllerResources.deleteDataController", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.begin_delete_data_controller": "Microsoft.AzureArcData.DataControllerResources.deleteDataController", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.list_in_group": "Microsoft.AzureArcData.DataControllerResources.listInGroup", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.list_in_group": "Microsoft.AzureArcData.DataControllerResources.listInGroup", + "azure.mgmt.azurearcdata.operations.DataControllersOperations.list_in_subscription": "Microsoft.AzureArcData.DataControllerResources.listInSubscription", + "azure.mgmt.azurearcdata.aio.operations.DataControllersOperations.list_in_subscription": "Microsoft.AzureArcData.DataControllerResources.listInSubscription", + "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.get": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.get", + "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.get": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.get", + "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.begin_create": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.create", + "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.begin_create": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.create", + "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.begin_delete": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.delete", + "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.begin_delete": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.delete", + "azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations.list": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.list", + "azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations.list": "Microsoft.AzureArcData.ActiveDirectoryConnectorResources.list", + "azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations.get": "Microsoft.AzureArcData.SqlServerDatabaseResources.get", + "azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations.get": "Microsoft.AzureArcData.SqlServerDatabaseResources.get", + "azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations.create": "Microsoft.AzureArcData.SqlServerDatabaseResources.create", + "azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations.create": "Microsoft.AzureArcData.SqlServerDatabaseResources.create", + "azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations.begin_update": "Microsoft.AzureArcData.SqlServerDatabaseResources.update", + "azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations.begin_update": "Microsoft.AzureArcData.SqlServerDatabaseResources.update", + "azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations.begin_delete": "Microsoft.AzureArcData.SqlServerDatabaseResources.delete", + "azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations.begin_delete": "Microsoft.AzureArcData.SqlServerDatabaseResources.delete", + "azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations.list": "Microsoft.AzureArcData.SqlServerDatabaseResources.list", + "azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations.list": "Microsoft.AzureArcData.SqlServerDatabaseResources.list" + }, + "CrossLanguageVersion": "7d893ba19c68" } \ No newline at end of file diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py index ebf96b3e77ec..0186c5457363 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._azure_arc_data_management_client import AzureArcDataManagementClient # type: ignore +from ._client import AzureArcDataManagementClient # type: ignore from ._version import VERSION __version__ = VERSION diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_client.py similarity index 67% rename from sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py rename to sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_client.py index 58e30bb670c5..1615a25dd27e 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_client.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- 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 @@ -17,24 +17,33 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models from ._configuration import AzureArcDataManagementClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( ActiveDirectoryConnectorsOperations, DataControllersOperations, + FailoverGroupsOperations, Operations, PostgresInstancesOperations, SqlManagedInstancesOperations, + SqlServerAvailabilityGroupsOperations, + SqlServerDatabasesOperations, + SqlServerEsuLicensesOperations, SqlServerInstancesOperations, + SqlServerLicensesOperations, ) +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 AzureArcDataManagementClient: +class AzureArcDataManagementClient: # pylint: disable=too-many-instance-attributes """The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. @@ -45,24 +54,38 @@ class AzureArcDataManagementClient: azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations :ivar sql_server_instances: SqlServerInstancesOperations operations :vartype sql_server_instances: azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations + :ivar sql_server_licenses: SqlServerLicensesOperations operations + :vartype sql_server_licenses: azure.mgmt.azurearcdata.operations.SqlServerLicensesOperations + :ivar postgres_instances: PostgresInstancesOperations operations + :vartype postgres_instances: azure.mgmt.azurearcdata.operations.PostgresInstancesOperations + :ivar sql_server_esu_licenses: SqlServerEsuLicensesOperations operations + :vartype sql_server_esu_licenses: + azure.mgmt.azurearcdata.operations.SqlServerEsuLicensesOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.azurearcdata.operations.FailoverGroupsOperations + :ivar sql_server_availability_groups: SqlServerAvailabilityGroupsOperations operations + :vartype sql_server_availability_groups: + azure.mgmt.azurearcdata.operations.SqlServerAvailabilityGroupsOperations :ivar data_controllers: DataControllersOperations operations :vartype data_controllers: azure.mgmt.azurearcdata.operations.DataControllersOperations :ivar active_directory_connectors: ActiveDirectoryConnectorsOperations operations :vartype active_directory_connectors: azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations - :ivar postgres_instances: PostgresInstancesOperations operations - :vartype postgres_instances: azure.mgmt.azurearcdata.operations.PostgresInstancesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar sql_server_databases: SqlServerDatabasesOperations operations + :vartype sql_server_databases: azure.mgmt.azurearcdata.operations.SqlServerDatabasesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-03-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. @@ -77,6 +100,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: @@ -85,6 +109,7 @@ def __init__( self._config = AzureArcDataManagementClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -108,11 +133,10 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.sql_managed_instances = SqlManagedInstancesOperations( @@ -121,23 +145,36 @@ def __init__( self.sql_server_instances = SqlServerInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.sql_server_licenses = SqlServerLicensesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.postgres_instances = PostgresInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.sql_server_esu_licenses = SqlServerEsuLicensesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sql_server_availability_groups = SqlServerAvailabilityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.data_controllers = DataControllersOperations( self._client, self._config, self._serialize, self._deserialize ) self.active_directory_connectors = ActiveDirectoryConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.postgres_instances = PostgresInstancesOperations( + self.sql_server_databases = SqlServerDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -150,7 +187,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py index 8c7443c2f9be..a4bcfe8d4988 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -24,15 +24,19 @@ class AzureArcDataManagementClientConfiguration: # pylint: disable=too-many-ins Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-03-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 """ @@ -40,10 +44,11 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2022-03-01-preview") + api_version: str = kwargs.pop("api_version", "2026-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_patch.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_patch.py index 5755fd181b3f..87676c65a8f0 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_patch.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_patch.py @@ -1,16 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - - +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/__init__.py index 0af9b28f6607..8026245c2abc 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/__init__.py @@ -1,6 +1,6 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/model_base.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/model_base.py new file mode 100644 index 000000000000..a79d3782e99c --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/model_base.py @@ -0,0 +1,1788 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +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"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + 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": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return 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 + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "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 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: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D'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 + :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 + :rtype: ~typing.ItemsView + """ + return self._data.items() + + 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. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + 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. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + 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. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + 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 + :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. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + 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 + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + 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: dict[str, typing.Any] = {} + if args: + if isinstance(args[0], ET.Element): + 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()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + 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__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + 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()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._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) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + 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, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._deserializer = deserializer + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + 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, _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: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # 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 + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + 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, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + deserializer=deserializer, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: 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, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # 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( + element_name, + model_meta.get("prefix"), + _model_ns, + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # 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") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + _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)) + return wrapped_element + if isinstance(o, list): + 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( + v, + exclude_readonly, + { + "name": k, + "ns": _dict_ns, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # 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": _items_ns, + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + 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_ns + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + 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: + _safe_register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/serialization.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/serialization.py index 6da830e0cf4a..75906e2eb77f 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/serialization.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_utils/serialization.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -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] @@ -516,6 +520,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 +1113,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 +1440,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 +1456,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 +1472,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 +1482,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 +2021,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/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py index 2eda20789583..8f2350dd3b0c 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_version.py @@ -2,8 +2,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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b2" +VERSION = "2.0.0" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py index c24b5c678748..c4a80f30b8e4 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._azure_arc_data_management_client import AzureArcDataManagementClient # type: ignore +from ._client import AzureArcDataManagementClient # type: ignore try: from ._patch import __all__ as _patch_all diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_client.py similarity index 68% rename from sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py rename to sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_client.py index a6123cd4d0e7..34a6377a22aa 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_azure_arc_data_management_client.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_client.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- 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 @@ -17,24 +17,33 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models from .._utils.serialization import Deserializer, Serializer from ._configuration import AzureArcDataManagementClientConfiguration from .operations import ( ActiveDirectoryConnectorsOperations, DataControllersOperations, + FailoverGroupsOperations, Operations, PostgresInstancesOperations, SqlManagedInstancesOperations, + SqlServerAvailabilityGroupsOperations, + SqlServerDatabasesOperations, + SqlServerEsuLicensesOperations, SqlServerInstancesOperations, + SqlServerLicensesOperations, ) +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 AzureArcDataManagementClient: +class AzureArcDataManagementClient: # pylint: disable=too-many-instance-attributes """The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. @@ -46,24 +55,40 @@ class AzureArcDataManagementClient: :ivar sql_server_instances: SqlServerInstancesOperations operations :vartype sql_server_instances: azure.mgmt.azurearcdata.aio.operations.SqlServerInstancesOperations + :ivar sql_server_licenses: SqlServerLicensesOperations operations + :vartype sql_server_licenses: + azure.mgmt.azurearcdata.aio.operations.SqlServerLicensesOperations + :ivar postgres_instances: PostgresInstancesOperations operations + :vartype postgres_instances: azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations + :ivar sql_server_esu_licenses: SqlServerEsuLicensesOperations operations + :vartype sql_server_esu_licenses: + azure.mgmt.azurearcdata.aio.operations.SqlServerEsuLicensesOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.azurearcdata.aio.operations.FailoverGroupsOperations + :ivar sql_server_availability_groups: SqlServerAvailabilityGroupsOperations operations + :vartype sql_server_availability_groups: + azure.mgmt.azurearcdata.aio.operations.SqlServerAvailabilityGroupsOperations :ivar data_controllers: DataControllersOperations operations :vartype data_controllers: azure.mgmt.azurearcdata.aio.operations.DataControllersOperations :ivar active_directory_connectors: ActiveDirectoryConnectorsOperations operations :vartype active_directory_connectors: azure.mgmt.azurearcdata.aio.operations.ActiveDirectoryConnectorsOperations - :ivar postgres_instances: PostgresInstancesOperations operations - :vartype postgres_instances: azure.mgmt.azurearcdata.aio.operations.PostgresInstancesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar sql_server_databases: SqlServerDatabasesOperations operations + :vartype sql_server_databases: + azure.mgmt.azurearcdata.aio.operations.SqlServerDatabasesOperations + :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 Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-03-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. @@ -78,6 +103,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: @@ -86,6 +112,7 @@ def __init__( self._config = AzureArcDataManagementClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -110,12 +137,11 @@ def __init__( self._config.http_logging_policy, ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, base_url), policies=_policies, **kwargs + base_url=cast(str, _endpoint), policies=_policies, **kwargs ) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.sql_managed_instances = SqlManagedInstancesOperations( @@ -124,17 +150,30 @@ def __init__( self.sql_server_instances = SqlServerInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.sql_server_licenses = SqlServerLicensesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.postgres_instances = PostgresInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.sql_server_esu_licenses = SqlServerEsuLicensesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sql_server_availability_groups = SqlServerAvailabilityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.data_controllers = DataControllersOperations( self._client, self._config, self._serialize, self._deserialize ) self.active_directory_connectors = ActiveDirectoryConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.postgres_instances = PostgresInstancesOperations( + self.sql_server_databases = SqlServerDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -142,7 +181,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -155,7 +194,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py index 05e3e4842473..fe16a3bac008 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -24,15 +24,19 @@ class AzureArcDataManagementClientConfiguration: # pylint: disable=too-many-ins Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :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 Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2026-03-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 """ @@ -40,10 +44,11 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2022-03-01-preview") + api_version: str = kwargs.pop("api_version", "2026-03-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +57,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_patch.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_patch.py index 5755fd181b3f..87676c65a8f0 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_patch.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/_patch.py @@ -1,16 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - - +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py index 237cd4378c1f..7a8d371b1591 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,11 +13,16 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._sql_managed_instances_operations import SqlManagedInstancesOperations # type: ignore -from ._sql_server_instances_operations import SqlServerInstancesOperations # type: ignore -from ._data_controllers_operations import DataControllersOperations # type: ignore -from ._active_directory_connectors_operations import ActiveDirectoryConnectorsOperations # type: ignore -from ._postgres_instances_operations import PostgresInstancesOperations # type: ignore +from ._operations import SqlManagedInstancesOperations # type: ignore +from ._operations import SqlServerInstancesOperations # type: ignore +from ._operations import SqlServerLicensesOperations # type: ignore +from ._operations import PostgresInstancesOperations # type: ignore +from ._operations import SqlServerEsuLicensesOperations # type: ignore +from ._operations import FailoverGroupsOperations # type: ignore +from ._operations import SqlServerAvailabilityGroupsOperations # type: ignore +from ._operations import DataControllersOperations # type: ignore +from ._operations import ActiveDirectoryConnectorsOperations # type: ignore +from ._operations import SqlServerDatabasesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -27,9 +32,14 @@ "Operations", "SqlManagedInstancesOperations", "SqlServerInstancesOperations", + "SqlServerLicensesOperations", + "PostgresInstancesOperations", + "SqlServerEsuLicensesOperations", + "FailoverGroupsOperations", + "SqlServerAvailabilityGroupsOperations", "DataControllersOperations", "ActiveDirectoryConnectorsOperations", - "PostgresInstancesOperations", + "SqlServerDatabasesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_active_directory_connectors_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_active_directory_connectors_operations.py deleted file mode 100644 index 9d187ffb8d12..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_active_directory_connectors_operations.py +++ /dev/null @@ -1,551 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._active_directory_connectors_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._configuration import AzureArcDataManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ActiveDirectoryConnectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s - :attr:`active_directory_connectors` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ActiveDirectoryConnectorResource"]: - """List the active directory connectors associated with the given data controller. - - List the active directory connectors associated with the given data controller. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: An iterator like instance of either ActiveDirectoryConnectorResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActiveDirectoryConnectorListResult] = 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_list_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ActiveDirectoryConnectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_initial( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: Union[_models.ActiveDirectoryConnectorResource, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(active_directory_connector_resource, (IOBase, bytes)): - _content = active_directory_connector_resource - else: - _json = self._serialize.body(active_directory_connector_resource, "ActiveDirectoryConnectorResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: _models.ActiveDirectoryConnectorResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Required. - :type active_directory_connector_resource: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource - :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 either ActiveDirectoryConnectorResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Required. - :type active_directory_connector_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 either ActiveDirectoryConnectorResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: Union[_models.ActiveDirectoryConnectorResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Is either a ActiveDirectoryConnectorResource - type or a IO[bytes] type. Required. - :type active_directory_connector_resource: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ActiveDirectoryConnectorResource or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConnectorResource] = 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_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - active_directory_connector_resource=active_directory_connector_resource, - api_version=api_version, - 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): - deserialized = self._deserialize("ActiveDirectoryConnectorResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ActiveDirectoryConnectorResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ActiveDirectoryConnectorResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **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_async - async def get( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any - ) -> _models.ActiveDirectoryConnectorResource: - """Retrieves an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :return: ActiveDirectoryConnectorResource or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActiveDirectoryConnectorResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ActiveDirectoryConnectorResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py deleted file mode 100644 index 177b1916f77e..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_data_controllers_operations.py +++ /dev/null @@ -1,807 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._data_controllers_operations import ( - build_delete_data_controller_request, - build_get_data_controller_request, - build_list_in_group_request, - build_list_in_subscription_request, - build_patch_data_controller_request, - build_put_data_controller_request, -) -from .._configuration import AzureArcDataManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DataControllersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s - :attr:`data_controllers` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list_in_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.DataControllerResource"]: - """List dataController resources in the subscription. - - List dataController resources in the subscription. - - :return: An iterator like instance of either DataControllerResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PageOfDataControllerResource] = 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_list_in_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PageOfDataControllerResource", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_in_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DataControllerResource"]: - """List dataController resources in the resource group. - - List dataController resources in the resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either DataControllerResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PageOfDataControllerResource] = 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_list_in_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PageOfDataControllerResource", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _put_data_controller_initial( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerResource, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(data_controller_resource, (IOBase, bytes)): - _content = data_controller_resource - else: - _json = self._serialize.body(data_controller_resource, "DataControllerResource") - - _request = build_put_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: _models.DataControllerResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource - :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 either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Required. - :type data_controller_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 either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Is either a DataControllerResource type or a IO[bytes] - type. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataControllerResource] = 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._put_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - data_controller_resource=data_controller_resource, - api_version=api_version, - 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): - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DataControllerResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DataControllerResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_data_controller_initial( - self, resource_group_name: str, data_controller_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_data_controller( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **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_async - async def get_data_controller( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> _models.DataControllerResource: - """Retrieves a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: DataControllerResource or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.DataControllerResource - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataControllerResource] = kwargs.pop("cls", None) - - _request = build_get_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _patch_data_controller_initial( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerUpdate, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(data_controller_resource, (IOBase, bytes)): - _content = data_controller_resource - else: - _json = self._serialize.body(data_controller_resource, "DataControllerUpdate") - - _request = build_patch_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: _models.DataControllerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate - :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 either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Required. - :type data_controller_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 either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Is either a - DataControllerUpdate type or a IO[bytes] type. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either DataControllerResource or the result - of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataControllerResource] = 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._patch_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - data_controller_resource=data_controller_resource, - api_version=api_version, - 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): - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DataControllerResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DataControllerResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py index 9776d8ebde79..2366d4642799 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_operations.py @@ -1,12 +1,15 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -17,17 +20,104 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict 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 ...operations._operations import build_list_request +from ...operations._operations import ( + build_active_directory_connectors_create_request, + build_active_directory_connectors_delete_request, + build_active_directory_connectors_get_request, + build_active_directory_connectors_list_request, + build_data_controllers_delete_data_controller_request, + build_data_controllers_get_data_controller_request, + build_data_controllers_list_in_group_request, + build_data_controllers_list_in_subscription_request, + build_data_controllers_patch_data_controller_request, + build_data_controllers_put_data_controller_request, + build_failover_groups_create_request, + build_failover_groups_delete_request, + build_failover_groups_get_request, + build_failover_groups_list_request, + build_operations_list_request, + build_postgres_instances_create_request, + build_postgres_instances_delete_request, + build_postgres_instances_get_request, + build_postgres_instances_list_by_resource_group_request, + build_postgres_instances_list_request, + build_postgres_instances_update_request, + build_sql_managed_instances_create_request, + build_sql_managed_instances_delete_request, + build_sql_managed_instances_get_request, + build_sql_managed_instances_list_by_resource_group_request, + build_sql_managed_instances_list_request, + build_sql_managed_instances_update_request, + build_sql_server_availability_groups_add_databases_request, + build_sql_server_availability_groups_create_availability_group_request, + build_sql_server_availability_groups_create_distributed_availability_group_request, + build_sql_server_availability_groups_create_managed_instance_link_request, + build_sql_server_availability_groups_create_request, + build_sql_server_availability_groups_delete_mi_link_request, + build_sql_server_availability_groups_delete_request, + build_sql_server_availability_groups_detail_view_request, + build_sql_server_availability_groups_failover_mi_link_request, + build_sql_server_availability_groups_failover_request, + build_sql_server_availability_groups_force_failover_allow_data_loss_request, + build_sql_server_availability_groups_get_request, + build_sql_server_availability_groups_list_request, + build_sql_server_availability_groups_remove_databases_request, + build_sql_server_availability_groups_update_request, + build_sql_server_databases_create_request, + build_sql_server_databases_delete_request, + build_sql_server_databases_get_request, + build_sql_server_databases_list_request, + build_sql_server_databases_update_request, + build_sql_server_esu_licenses_create_request, + build_sql_server_esu_licenses_delete_request, + build_sql_server_esu_licenses_get_request, + build_sql_server_esu_licenses_list_by_resource_group_request, + build_sql_server_esu_licenses_list_request, + build_sql_server_esu_licenses_update_request, + build_sql_server_instances_create_request, + build_sql_server_instances_delete_request, + build_sql_server_instances_get_all_availability_groups_request, + build_sql_server_instances_get_best_practices_assessment_request, + build_sql_server_instances_get_jobs_request, + build_sql_server_instances_get_jobs_status_request, + build_sql_server_instances_get_migration_readiness_report_request, + build_sql_server_instances_get_request, + build_sql_server_instances_get_target_recommendation_reports_request, + build_sql_server_instances_get_telemetry_request, + build_sql_server_instances_list_by_resource_group_request, + build_sql_server_instances_list_request, + build_sql_server_instances_post_upgrade_request, + build_sql_server_instances_pre_upgrade_request, + build_sql_server_instances_run_best_practice_assessment_request, + build_sql_server_instances_run_best_practices_assessment_request, + build_sql_server_instances_run_managed_instance_link_assessment_request, + build_sql_server_instances_run_migration_assessment_request, + build_sql_server_instances_run_migration_readiness_assessment_request, + build_sql_server_instances_run_target_recommendation_job_request, + build_sql_server_instances_update_request, + build_sql_server_licenses_create_request, + build_sql_server_licenses_delete_request, + build_sql_server_licenses_get_request, + build_sql_server_licenses_list_by_resource_group_request, + build_sql_server_licenses_list_request, + build_sql_server_licenses_update_request, +) from .._configuration import AzureArcDataManagementClientConfiguration T = TypeVar("T") @@ -45,8 +135,6 @@ class Operations: :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") @@ -60,15 +148,734 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """Lists all of the available Azure Data Services on Azure Arc API operations. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = 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_operations_list_request( + 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.Operation], + 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 SqlManagedInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_managed_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_managed_instance_name: str, **kwargs: Any + ) -> _models.SqlManagedInstance: + """Retrieves a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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.SqlManagedInstance] = kwargs.pop("cls", None) + + _request = build_sql_managed_instances_get_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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.SqlManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: Union[_models.SqlManagedInstance, _types.SqlManagedInstance, 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(sql_managed_instance, (IOBase, bytes)): + _content = sql_managed_instance + else: + _content = json.dumps(sql_managed_instance, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_managed_instances_create_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: _models.SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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 SqlManagedInstance. The SqlManagedInstance + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: _types.SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.types.SqlManagedInstance + :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 SqlManagedInstance. The SqlManagedInstance + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: 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 SqlManagedInstance. The SqlManagedInstance + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: Union[_models.SqlManagedInstance, _types.SqlManagedInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Is either a + SqlManagedInstance type or a IO[bytes] type. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance or + ~azure.mgmt.azurearcdata.types.SqlManagedInstance or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlManagedInstance. The SqlManagedInstance + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :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.SqlManagedInstance] = 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_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + sql_managed_instance=sql_managed_instance, + 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.SqlManagedInstance, 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.SqlManagedInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlManagedInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: _models.SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: _types.SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlManagedInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: 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: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: Union[_models.SqlManagedInstanceUpdate, _types.SqlManagedInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Is either a SqlManagedInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate or + ~azure.mgmt.azurearcdata.types.SqlManagedInstanceUpdate or IO[bytes] + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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.SqlManagedInstance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_managed_instances_update_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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 = 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.SqlManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, sql_managed_instance_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_sql_managed_instances_delete_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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 [200, 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["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, sql_managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_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, + sql_managed_instance_name=sql_managed_instance_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.SqlManagedInstance"]: + """List sqlManagedInstance resources in the resource group. + + Gets all sqlManagedInstances 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 SqlManagedInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SqlManagedInstance]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -81,12 +888,19 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_sql_managed_instances_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, ) - _request.url = self._client.format_url(_request.url) + 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 @@ -99,18 +913,11568 @@ 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, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + 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 = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlManagedInstance], + 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(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlManagedInstance"]: + """List sqlManagedInstance resources in the subscription. + + List sqlManagedInstance resources in the subscription. + + :return: An iterator like instance of SqlManagedInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlManagedInstance]] = 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_sql_managed_instances_list_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.SqlManagedInstance], + 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 SqlServerInstancesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_server_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstance: + """Retrieves a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: Union[_models.SqlServerInstance, _types.SqlServerInstance, 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(sql_server_instance, (IOBase, bytes)): + _content = sql_server_instance + else: + _content = json.dumps(sql_server_instance, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: _models.SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: _types.SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.types.SqlServerInstance + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: 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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: Union[_models.SqlServerInstance, _types.SqlServerInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Is either a + SqlServerInstance type or a IO[bytes] type. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance or + ~azure.mgmt.azurearcdata.types.SqlServerInstance or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :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.SqlServerInstance] = 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_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance=sql_server_instance, + 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.SqlServerInstance, 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.SqlServerInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: Union[_models.SqlServerInstanceUpdate, _types.SqlServerInstanceUpdate, 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(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: _models.SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: _types.SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerInstanceUpdate + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: 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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: Union[_models.SqlServerInstanceUpdate, _types.SqlServerInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Is either a SqlServerInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :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.SqlServerInstance] = 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, + sql_server_instance_name=sql_server_instance_name, + parameters=parameters, + 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.SqlServerInstance, 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.SqlServerInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [200, 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["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, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_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, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance"]: + """List sqlServerInstance resources in the resource group. + + Gets all sqlServerInstances 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 SqlServerInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerInstance]] = 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_sql_server_instances_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.SqlServerInstance], + 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(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlServerInstance"]: + """List sqlServerInstance resources in the subscription. + + List sqlServerInstance resources in the subscription. + + :return: An iterator like instance of SqlServerInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerInstance]] = 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_sql_server_instances_list_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.SqlServerInstance], + 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) + + async def _get_telemetry_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: Union[ + _models.SqlServerInstanceTelemetryRequest, _types.SqlServerInstanceTelemetryRequest, 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(sql_server_instance_telemetry_request, (IOBase, bytes)): + _content = sql_server_instance_telemetry_request + else: + _content = json.dumps(sql_server_instance_telemetry_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_get_telemetry_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: _models.SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: _types.SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: 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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: Union[ + _models.SqlServerInstanceTelemetryRequest, _types.SqlServerInstanceTelemetryRequest, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Is either a SqlServerInstanceTelemetryRequest type or a IO[bytes] type. + Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryRequest or IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :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[List[List[str]]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_instance_telemetry_request, (IOBase, bytes)): + _content = sql_server_instance_telemetry_request + else: + _content = json.dumps(sql_server_instance_telemetry_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_telemetry_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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[List[str]], + deserialized.get("rows", []), + ) + 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 + + 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._get_telemetry_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_telemetry_request=sql_server_instance_telemetry_request, + 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): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + 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[AsyncItemPaged[List[str]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncItemPaged[List[str]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_best_practices_assessment_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: Union[ + _models.SqlServerInstanceBpaRequest, _types.SqlServerInstanceBpaRequest, 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(sql_server_instance_bpa_request, (IOBase, bytes)): + _content = sql_server_instance_bpa_request + else: + _content = json.dumps(sql_server_instance_bpa_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_get_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: _models.SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: _types.SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceBpaRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: 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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: Union[ + _models.SqlServerInstanceBpaRequest, _types.SqlServerInstanceBpaRequest, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[AsyncItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Is either a SqlServerInstanceBpaRequest type or a IO[bytes] type. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceBpaRequest or IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of list of list of str + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.core.async_paging.AsyncItemPaged[list[str]]] + :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[List[List[str]]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_instance_bpa_request, (IOBase, bytes)): + _content = sql_server_instance_bpa_request + else: + _content = json.dumps(sql_server_instance_bpa_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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[List[str]], + deserialized.get("rows", []), + ) + 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 + + 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._get_best_practices_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_bpa_request=sql_server_instance_bpa_request, + 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): + async def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return await get_next(next_link) + + return AsyncItemPaged(internal_get_next, extract_data) + + 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[AsyncItemPaged[List[str]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[AsyncItemPaged[List[str]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def run_migration_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstanceRunMigrationAssessmentResponse: + """Runs migration assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstanceRunMigrationAssessmentResponse. The + SqlServerInstanceRunMigrationAssessmentResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationAssessmentResponse + :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.SqlServerInstanceRunMigrationAssessmentResponse] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_run_migration_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstanceRunMigrationAssessmentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _run_target_recommendation_job_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + Union[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest, + _types.SqlServerInstanceRunTargetRecommendationJobRequest, + IO[bytes], + ] + ] = None, + **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)) + content_type = content_type if sql_server_instance_run_target_recommendation_job_request else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = ( + content_type or "application/json" if sql_server_instance_run_target_recommendation_job_request else None + ) + _content = None + if isinstance(sql_server_instance_run_target_recommendation_job_request, (IOBase, bytes)): + _content = sql_server_instance_run_target_recommendation_job_request + else: + if sql_server_instance_run_target_recommendation_job_request is not None: + _content = json.dumps(sql_server_instance_run_target_recommendation_job_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_run_target_recommendation_job_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest + :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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + _types.SqlServerInstanceRunTargetRecommendationJobRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobRequest + :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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: 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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + Union[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest, + _types.SqlServerInstanceRunTargetRecommendationJobRequest, + IO[bytes], + ] + ] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Is either a + SqlServerInstanceRunTargetRecommendationJobRequest type or a IO[bytes] type. Default value is + None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :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)) + content_type = content_type if sql_server_instance_run_target_recommendation_job_request else None + cls: ClsType[_models.SqlServerInstanceRunTargetRecommendationJobResponse] = 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._run_target_recommendation_job_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_run_target_recommendation_job_request=sql_server_instance_run_target_recommendation_job_request, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceRunTargetRecommendationJobResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceRunTargetRecommendationJobResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_target_recommendation_reports_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + Union[ + _models.SqlServerInstanceTargetRecommendationReportsRequest, + _types.SqlServerInstanceTargetRecommendationReportsRequest, + IO[bytes], + ] + ] = None, + **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)) + content_type = content_type if sql_server_instance_target_recommendation_reports_request else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = ( + content_type or "application/json" if sql_server_instance_target_recommendation_reports_request else None + ) + _content = None + if isinstance(sql_server_instance_target_recommendation_reports_request, (IOBase, bytes)): + _content = sql_server_instance_target_recommendation_reports_request + else: + if sql_server_instance_target_recommendation_reports_request is not None: + _content = json.dumps(sql_server_instance_target_recommendation_reports_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_target_recommendation_reports_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + _models.SqlServerInstanceTargetRecommendationReportsRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest + :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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + _types.SqlServerInstanceTargetRecommendationReportsRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsRequest + :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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: 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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + Union[ + _models.SqlServerInstanceTargetRecommendationReportsRequest, + _types.SqlServerInstanceTargetRecommendationReportsRequest, + IO[bytes], + ] + ] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Is either a + SqlServerInstanceTargetRecommendationReportsRequest type or a IO[bytes] type. Default value is + None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :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)) + content_type = content_type if sql_server_instance_target_recommendation_reports_request else None + cls: ClsType[_models.SqlServerInstanceTargetRecommendationReportsResponse] = 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._get_target_recommendation_reports_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_target_recommendation_reports_request=sql_server_instance_target_recommendation_reports_request, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceTargetRecommendationReportsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceTargetRecommendationReportsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _get_migration_readiness_report_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_get_migration_readiness_report_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_get_migration_readiness_report( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceMigrationReadinessReportResponse]: + """Retrieves the migration readiness report for the SQL Server instance. The report contains an + assessment of the instance's readiness for migration to Azure SQL targets. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceMigrationReadinessReportResponse. The + SqlServerInstanceMigrationReadinessReportResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceMigrationReadinessReportResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceMigrationReadinessReportResponse] = 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._get_migration_readiness_report_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceMigrationReadinessReportResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceMigrationReadinessReportResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceMigrationReadinessReportResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def run_best_practices_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstanceRunBestPracticesAssessmentResponse: + """The request to run SQL best practices assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstanceRunBestPracticesAssessmentResponse. The + SqlServerInstanceRunBestPracticesAssessmentResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse + :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.SqlServerInstanceRunBestPracticesAssessmentResponse] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_run_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstanceRunBestPracticesAssessmentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _run_best_practice_assessment_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_run_best_practice_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_run_best_practice_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunBestPracticesAssessmentResponse]: + """The request to run SQL best practices assessment asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceRunBestPracticesAssessmentResponse. The + SqlServerInstanceRunBestPracticesAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceRunBestPracticesAssessmentResponse] = 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._run_best_practice_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceRunBestPracticesAssessmentResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceRunBestPracticesAssessmentResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceRunBestPracticesAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _run_migration_readiness_assessment_initial( # pylint: disable=name-too-long + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_run_migration_readiness_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_run_migration_readiness_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse]: + """The request to run migration readiness assessment asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceRunMigrationReadinessAssessmentResponse. The + SqlServerInstanceRunMigrationReadinessAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationReadinessAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse] = 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._run_migration_readiness_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize( + _models.SqlServerInstanceRunMigrationReadinessAssessmentResponse, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceRunMigrationReadinessAssessmentResponse + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[_models.SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[_types.SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: 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: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[ + Union[_models.SqlServerInstanceJobsStatusRequest, _types.SqlServerInstanceJobsStatusRequest, IO[bytes]] + ] = None, + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Is either a SqlServerInstanceJobsStatusRequest type or a IO[bytes] + type. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusRequest or IO[bytes] + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :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)) + content_type = content_type if sql_server_instance_jobs_status_request else None + cls: ClsType[_models.SqlServerInstanceJobsStatusResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if sql_server_instance_jobs_status_request else None + _content = None + if isinstance(sql_server_instance_jobs_status_request, (IOBase, bytes)): + _content = sql_server_instance_jobs_status_request + else: + if sql_server_instance_jobs_status_request is not None: + _content = json.dumps(sql_server_instance_jobs_status_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_jobs_status_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 = 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.SqlServerInstanceJobsStatusResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _get_jobs_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[ + Union[_models.SqlServerInstanceJobsRequest, _types.SqlServerInstanceJobsRequest, IO[bytes]] + ] = None, + **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)) + content_type = content_type if sql_server_instance_jobs_request else None + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if sql_server_instance_jobs_request else None + _content = None + if isinstance(sql_server_instance_jobs_request, (IOBase, bytes)): + _content = sql_server_instance_jobs_request + else: + if sql_server_instance_jobs_request is not None: + _content = json.dumps(sql_server_instance_jobs_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_jobs_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[_models.SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest + :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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[_types.SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsRequest + :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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: 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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[ + Union[_models.SqlServerInstanceJobsRequest, _types.SqlServerInstanceJobsRequest, IO[bytes]] + ] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Is either a SqlServerInstanceJobsRequest type or a IO[bytes] type. Default + value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :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)) + content_type = content_type if sql_server_instance_jobs_request else None + cls: ClsType[_models.SqlServerInstanceJobsResponse] = 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._get_jobs_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_jobs_request=sql_server_instance_jobs_request, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceJobsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceJobsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceJobsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def pre_upgrade( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstance: + """Request Upgrade Permission before upgrading. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_pre_upgrade_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def post_upgrade( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstance: + """Clean up after upgrading. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_post_upgrade_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _run_managed_instance_link_assessment_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: Union[ + _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + 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(sql_server_instance_managed_instance_link_assessment_request, (IOBase, bytes)): + _content = sql_server_instance_managed_instance_link_assessment_request + else: + _content = json.dumps(sql_server_instance_managed_instance_link_assessment_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_run_managed_instance_link_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest + :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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentRequest + :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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: 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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: Union[ + _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Is either a + SqlServerInstanceManagedInstanceLinkAssessmentRequest type or a IO[bytes] type. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :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.SqlServerInstanceManagedInstanceLinkAssessmentResponse] = 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._run_managed_instance_link_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_managed_instance_link_assessment_request=sql_server_instance_managed_instance_link_assessment_request, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerInstanceManagedInstanceLinkAssessmentResponse + ].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[_models.AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[_types.AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.types.AvailabilityGroupRetrievalFilters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: 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 iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[ + Union[_models.AvailabilityGroupRetrievalFilters, _types.AvailabilityGroupRetrievalFilters, IO[bytes]] + ] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Is either a AvailabilityGroupRetrievalFilters type + or a IO[bytes] type. Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters or + ~azure.mgmt.azurearcdata.types.AvailabilityGroupRetrievalFilters or IO[bytes] + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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)) + content_type = content_type if availability_group_retrieval_filters else None + cls: ClsType[List[_models.SqlServerAvailabilityGroupResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" if availability_group_retrieval_filters else None + _content = None + if isinstance(availability_group_retrieval_filters, (IOBase, bytes)): + _content = availability_group_retrieval_filters + else: + if availability_group_retrieval_filters is not None: + _content = json.dumps(availability_group_retrieval_filters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_all_availability_groups_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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.SqlServerAvailabilityGroupResource], + 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 SqlServerLicensesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_server_licenses` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_license_name: str, **kwargs: Any + ) -> _models.SqlServerLicense: + """Retrieves a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + _request = build_sql_server_licenses_get_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: _models.SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: _types.SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.types.SqlServerLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: 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: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: Union[_models.SqlServerLicense, _types.SqlServerLicense, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Is either a + SqlServerLicense type or a IO[bytes] type. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.models.SqlServerLicense or + ~azure.mgmt.azurearcdata.types.SqlServerLicense or IO[bytes] + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_license, (IOBase, bytes)): + _content = sql_server_license + else: + _content = json.dumps(sql_server_license, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_licenses_create_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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 = 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, 201]: + 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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: _models.SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: _types.SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: 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: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: Union[_models.SqlServerLicenseUpdate, _types.SqlServerLicenseUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Is either a SqlServerLicenseUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerLicenseUpdate or IO[bytes] + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_licenses_update_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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 = 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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, sql_server_license_name: str, **kwargs: Any) -> None: + """Deletes a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :return: None + :rtype: None + :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[None] = kwargs.pop("cls", None) + + _request = build_sql_server_licenses_delete_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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) + + _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, 204]: + 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 cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerLicense"]: + """List sqlServerLicense resources in the resource group. + + Gets all sqlServerLicenses 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 SqlServerLicense + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerLicense]] = 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_sql_server_licenses_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.SqlServerLicense], + 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(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlServerLicense"]: + """List sqlServerLicense resources in the subscription. + + List sqlServerLicense resources in the subscription. + + :return: An iterator like instance of SqlServerLicense + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerLicense]] = 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_sql_server_licenses_list_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.SqlServerLicense], + 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 PostgresInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`postgres_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, postgres_instance_name: str, **kwargs: Any + ) -> _models.PostgresInstance: + """Retrieves a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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.PostgresInstance] = kwargs.pop("cls", None) + + _request = build_postgres_instances_get_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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.PostgresInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: Union[_models.PostgresInstance, _types.PostgresInstance, 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_postgres_instances_create_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: _models.PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Required. + :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: _types.PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Required. + :type resource: ~azure.mgmt.azurearcdata.types.PostgresInstance + :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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. 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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: Union[_models.PostgresInstance, _types.PostgresInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Is either a PostgresInstance type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance or + ~azure.mgmt.azurearcdata.types.PostgresInstance or IO[bytes] + :return: An instance of AsyncLROPoller that returns PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :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.PostgresInstance] = 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_initial( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_name, + resource=resource, + 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.PostgresInstance, 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.PostgresInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PostgresInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: _models.PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: _types.PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.PostgresInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: 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: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: Union[_models.PostgresInstanceUpdate, _types.PostgresInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Is either a PostgresInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate or + ~azure.mgmt.azurearcdata.types.PostgresInstanceUpdate or IO[bytes] + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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.PostgresInstance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_postgres_instances_update_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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 = 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.PostgresInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, postgres_instance_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_postgres_instances_delete_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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 [200, 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["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, postgres_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_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, + postgres_instance_name=postgres_instance_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.PostgresInstance"]: + """List postgres Instance resources in the resource group. + + Get a postgres Instances list by Resource group name. + + :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 PostgresInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PostgresInstance]] = 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_postgres_instances_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.PostgresInstance], + 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(self, **kwargs: Any) -> AsyncItemPaged["_models.PostgresInstance"]: + """List postgres Instance resources in the subscription. + + List postgres Instance resources in the subscription. + + :return: An iterator like instance of PostgresInstance + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PostgresInstance]] = 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_postgres_instances_list_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.PostgresInstance], + 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 SqlServerEsuLicensesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_server_esu_licenses` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_esu_license_name: str, **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Retrieves a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + _request = build_sql_server_esu_licenses_get_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: _models.SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: _types.SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.types.SqlServerEsuLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: 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: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: Union[_models.SqlServerEsuLicense, _types.SqlServerEsuLicense, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Is either a + SqlServerEsuLicense type or a IO[bytes] type. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense or + ~azure.mgmt.azurearcdata.types.SqlServerEsuLicense or IO[bytes] + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_esu_license, (IOBase, bytes)): + _content = sql_server_esu_license + else: + _content = json.dumps(sql_server_esu_license, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_esu_licenses_create_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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 = 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, 201]: + 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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: _models.SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: _types.SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: 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: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: Union[_models.SqlServerEsuLicenseUpdate, _types.SqlServerEsuLicenseUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Is either a SqlServerEsuLicenseUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdate or IO[bytes] + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_esu_licenses_update_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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 = 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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, sql_server_esu_license_name: str, **kwargs: Any) -> None: + """Deletes a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :return: None + :rtype: None + :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[None] = kwargs.pop("cls", None) + + _request = build_sql_server_esu_licenses_delete_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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) + + _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, 204]: + 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 cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerEsuLicense"]: + """List sqlServerEsuLicense resources in the resource group. + + Gets all sqlServerEsuLicenses 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 SqlServerEsuLicense + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerEsuLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerEsuLicense]] = 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_sql_server_esu_licenses_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.SqlServerEsuLicense], + 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(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlServerEsuLicense"]: + """List sqlServerEsuLicense resources in the subscription. + + List sqlServerEsuLicense resources in the subscription. + + :return: An iterator like instance of SqlServerEsuLicense + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerEsuLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerEsuLicense]] = 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_sql_server_esu_licenses_list_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.SqlServerEsuLicense], + 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 FailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`failover_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: AzureArcDataManagementClientConfiguration = ( + 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, sql_managed_instance_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.FailoverGroupResource: + """Retrieves a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :return: FailoverGroupResource. The FailoverGroupResource is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.FailoverGroupResource + :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.FailoverGroupResource] = kwargs.pop("cls", None) + + _request = build_failover_groups_get_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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.FailoverGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: Union[_models.FailoverGroupResource, _types.FailoverGroupResource, 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(failover_group_resource, (IOBase, bytes)): + _content = failover_group_resource + else: + _content = json.dumps(failover_group_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_create_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: _models.FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.models.FailoverGroupResource + :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 FailoverGroupResource. The + FailoverGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: _types.FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.types.FailoverGroupResource + :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 FailoverGroupResource. The + FailoverGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_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 FailoverGroupResource. The + FailoverGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: Union[_models.FailoverGroupResource, _types.FailoverGroupResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Is either a FailoverGroupResource type or a IO[bytes] + type. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.models.FailoverGroupResource or + ~azure.mgmt.azurearcdata.types.FailoverGroupResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns FailoverGroupResource. The + FailoverGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :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.FailoverGroupResource] = 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_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_group_name, + failover_group_resource=failover_group_resource, + 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.FailoverGroupResource, 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.FailoverGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, sql_managed_instance_name: str, failover_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_failover_groups_delete_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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 [200, 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["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, sql_managed_instance_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_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, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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( + self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FailoverGroupResource"]: + """List the failover groups associated with the given sql managed instance. + + List the failover groups associated with the given sql managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :return: An iterator like instance of FailoverGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverGroupResource]] = 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_failover_groups_list_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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.FailoverGroupResource], + 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 SqlServerAvailabilityGroupsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_server_availability_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: AzureArcDataManagementClientConfiguration = ( + 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") + + async def _create_availability_group_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: Union[ + _models.AvailabilityGroupCreateUpdateConfiguration, + _types.AvailabilityGroupCreateUpdateConfiguration, + 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(create_ag_configuration, (IOBase, bytes)): + _content = create_ag_configuration + else: + _content = json.dumps(create_ag_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_availability_group_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: _models.AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: _types.AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: Union[ + _models.AvailabilityGroupCreateUpdateConfiguration, + _types.AvailabilityGroupCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Is either a AvailabilityGroupCreateUpdateConfiguration type or a IO[bytes] type. + Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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_availability_group_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_ag_configuration=create_ag_configuration, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _create_distributed_availability_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: Union[ + _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + 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(create_dag_configuration, (IOBase, bytes)): + _content = create_dag_configuration + else: + _content = json.dumps(create_dag_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_distributed_availability_group_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: Union[ + _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Is either a DistributedAvailabilityGroupCreateUpdateConfiguration type or a IO[bytes] + type. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateConfiguration or + IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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_distributed_availability_group_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_dag_configuration=create_dag_configuration, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _create_managed_instance_link_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: Union[ + _models.ManagedInstanceLinkCreateUpdateConfiguration, + _types.ManagedInstanceLinkCreateUpdateConfiguration, + 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(create_managed_instance_link_configuration, (IOBase, bytes)): + _content = create_managed_instance_link_configuration + else: + _content = json.dumps(create_managed_instance_link_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_managed_instance_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: _models.ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: _types.ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.types.ManagedInstanceLinkCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: Union[ + _models.ManagedInstanceLinkCreateUpdateConfiguration, + _types.ManagedInstanceLinkCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Is either a ManagedInstanceLinkCreateUpdateConfiguration type or a + IO[bytes] type. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.ManagedInstanceLinkCreateUpdateConfiguration or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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_managed_instance_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_managed_instance_link_configuration=create_managed_instance_link_configuration, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Retrieves an Arc Sql Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: _models.SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: _types.SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: Union[ + _models.SqlServerAvailabilityGroupResource, _types.SqlServerAvailabilityGroupResource, IO[bytes] + ], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Is either a SqlServerAvailabilityGroupResource type or a IO[bytes] type. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource or + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResource or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_availability_group_resource, (IOBase, bytes)): + _content = sql_server_availability_group_resource + else: + _content = json.dumps(sql_server_availability_group_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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, 201]: + 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: Union[ + _models.SqlServerAvailabilityGroupUpdate, _types.SqlServerAvailabilityGroupUpdate, 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(sql_server_availability_group_update, (IOBase, bytes)): + _content = sql_server_availability_group_update + else: + _content = json.dumps(sql_server_availability_group_update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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["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 + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: _models.SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: _types.SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupUpdate + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: Union[ + _models.SqlServerAvailabilityGroupUpdate, _types.SqlServerAvailabilityGroupUpdate, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Is either a SqlServerAvailabilityGroupUpdate type or a IO[bytes] type. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_group_name, + sql_server_availability_group_update=sql_server_availability_group_update, + 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.SqlServerAvailabilityGroupResource, 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, sql_server_instance_name: str, availability_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_sql_server_availability_groups_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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["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, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an Arc Sql Server availability group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_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, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """List the availability group associated with the given Arc Sql Server. + + List the availability group associated with the given Arc Sql Server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerAvailabilityGroupResource]] = 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_sql_server_availability_groups_list_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerAvailabilityGroupResource], + 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_async + async def detail_view( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Retrieves detailed properties of the Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_detail_view_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def failover( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request manual failover of the availability group to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_failover_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def force_failover_allow_data_loss( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request forced failover of the availability group to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _models.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _types.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.types.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: 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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Union[_models.Databases, _types.Databases, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. Is + either a Databases type or a IO[bytes] type. Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases or + ~azure.mgmt.azurearcdata.types.Databases or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(databases, (IOBase, bytes)): + _content = databases + else: + _content = json.dumps(databases, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_add_databases_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _failover_mi_link_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: Union[ + _models.FailoverMiLinkResourceId, _types.FailoverMiLinkResourceId, 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(managed_instance_resource_id, (IOBase, bytes)): + _content = managed_instance_resource_id + else: + _content = json.dumps(managed_instance_resource_id, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_failover_mi_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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["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 + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: _models.FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: _types.FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.types.FailoverMiLinkResourceId + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: Union[ + _models.FailoverMiLinkResourceId, _types.FailoverMiLinkResourceId, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Is either a FailoverMiLinkResourceId type or a IO[bytes] type. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId or + ~azure.mgmt.azurearcdata.types.FailoverMiLinkResourceId or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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._failover_mi_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_group_name, + managed_instance_resource_id=managed_instance_resource_id, + 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_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_mi_link_initial( + self, resource_group_name: str, sql_server_instance_name: str, availability_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_sql_server_availability_groups_delete_mi_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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]: + 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 = {} + 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_mi_link( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the MI Link between an Azure Arc-enabled SQL Server and an Azure SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_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_mi_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _models.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _types.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.types.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: 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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Union[_models.Databases, _types.Databases, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Is either a Databases type or a IO[bytes] type. Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases or + ~azure.mgmt.azurearcdata.types.Databases or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(databases, (IOBase, bytes)): + _content = databases + else: + _content = json.dumps(databases, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_remove_databases_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DataControllersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`data_controllers` 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: AzureArcDataManagementClientConfiguration = ( + 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_data_controller( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> _models.DataControllerResource: + """Retrieves a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :return: DataControllerResource. The DataControllerResource is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.DataControllerResource + :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.DataControllerResource] = kwargs.pop("cls", None) + + _request = build_data_controllers_get_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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.DataControllerResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _put_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerResource, _types.DataControllerResource, 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(data_controller_resource, (IOBase, bytes)): + _content = data_controller_resource + else: + _content = json.dumps(data_controller_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_controllers_put_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _models.DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _types.DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.types.DataControllerResource + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerResource, _types.DataControllerResource, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Is either a DataControllerResource type or a IO[bytes] + type. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource or + ~azure.mgmt.azurearcdata.types.DataControllerResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :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.DataControllerResource] = 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._put_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + 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.DataControllerResource, 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.DataControllerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DataControllerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _patch_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerUpdate, _types.DataControllerUpdate, 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(data_controller_resource, (IOBase, bytes)): + _content = data_controller_resource + else: + _content = json.dumps(data_controller_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_controllers_patch_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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["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_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _models.DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _types.DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.types.DataControllerUpdate + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerUpdate, _types.DataControllerUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Is either a + DataControllerUpdate type or a IO[bytes] type. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate or + ~azure.mgmt.azurearcdata.types.DataControllerUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :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.DataControllerResource] = 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._patch_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + 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.DataControllerResource, 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.DataControllerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DataControllerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_data_controller_initial( + self, resource_group_name: str, data_controller_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_data_controllers_delete_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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 [200, 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["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_data_controller( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_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_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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_in_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DataControllerResource"]: + """List dataController resources in the resource group. + + List dataController resources in the 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 DataControllerResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataControllerResource]] = 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_data_controllers_list_in_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.DataControllerResource], + 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_in_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.DataControllerResource"]: + """List dataController resources in the subscription. + + List dataController resources in the subscription. + + :return: An iterator like instance of DataControllerResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataControllerResource]] = 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_data_controllers_list_in_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.DataControllerResource], + 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 ActiveDirectoryConnectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`active_directory_connectors` 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: AzureArcDataManagementClientConfiguration = ( + 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, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any + ) -> _models.ActiveDirectoryConnectorResource: + """Retrieves an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :return: ActiveDirectoryConnectorResource. The ActiveDirectoryConnectorResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource + :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.ActiveDirectoryConnectorResource] = kwargs.pop("cls", None) + + _request = build_active_directory_connectors_get_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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.ActiveDirectoryConnectorResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: Union[ + _models.ActiveDirectoryConnectorResource, _types.ActiveDirectoryConnectorResource, 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(active_directory_connector_resource, (IOBase, bytes)): + _content = active_directory_connector_resource + else: + _content = json.dumps(active_directory_connector_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_active_directory_connectors_create_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: _models.ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource + :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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: _types.ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorResource + :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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: Union[ + _models.ActiveDirectoryConnectorResource, _types.ActiveDirectoryConnectorResource, IO[bytes] + ], + **kwargs: Any + ) -> AsyncLROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Is either a ActiveDirectoryConnectorResource + type or a IO[bytes] type. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource or + ~azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorResource or IO[bytes] + :return: An instance of AsyncLROPoller that returns ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :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.ActiveDirectoryConnectorResource] = 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_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_name, + active_directory_connector_resource=active_directory_connector_resource, + 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.ActiveDirectoryConnectorResource, 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.ActiveDirectoryConnectorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ActiveDirectoryConnectorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, data_controller_name: str, active_directory_connector_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_active_directory_connectors_delete_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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 [200, 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["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, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_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, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ActiveDirectoryConnectorResource"]: + """List the active directory connectors associated with the given data controller. + + List the active directory connectors associated with the given data controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :return: An iterator like instance of ActiveDirectoryConnectorResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ActiveDirectoryConnectorResource]] = 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_active_directory_connectors_list_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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.ActiveDirectoryConnectorResource], + 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 SqlServerDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s + :attr:`sql_server_databases` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_instance_name: str, database_name: str, **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Retrieves an Arc Sql Server database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :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.SqlServerDatabaseResource] = kwargs.pop("cls", None) + + _request = build_sql_server_databases_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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.SqlServerDatabaseResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: _models.SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: _types.SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.types.SqlServerDatabaseResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_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: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: Union[ + _models.SqlServerDatabaseResource, _types.SqlServerDatabaseResource, IO[bytes] + ], + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Is either a + SqlServerDatabaseResource type or a IO[bytes] type. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + or ~azure.mgmt.azurearcdata.types.SqlServerDatabaseResource or IO[bytes] + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :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.SqlServerDatabaseResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_database_resource, (IOBase, bytes)): + _content = sql_server_database_resource + else: + _content = json.dumps(sql_server_database_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_databases_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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 = 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, 201]: + 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.SqlServerDatabaseResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: Union[_models.SqlServerDatabaseUpdate, _types.SqlServerDatabaseUpdate, 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(sql_server_database_update, (IOBase, bytes)): + _content = sql_server_database_update + else: + _content = json.dumps(sql_server_database_update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_databases_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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["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 + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: _models.SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate + :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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: _types.SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.types.SqlServerDatabaseUpdate + :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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: 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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: Union[_models.SqlServerDatabaseUpdate, _types.SqlServerDatabaseUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Is either a + SqlServerDatabaseUpdate type or a IO[bytes] type. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerDatabaseUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :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.SqlServerDatabaseResource] = 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, + sql_server_instance_name=sql_server_instance_name, + database_name=database_name, + sql_server_database_update=sql_server_database_update, + 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.SqlServerDatabaseResource, 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.SqlServerDatabaseResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlServerDatabaseResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, sql_server_instance_name: str, database_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_sql_server_databases_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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["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, sql_server_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an Arc Sql Server database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_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, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlServerDatabaseResource"]: + """List the databases associated with the given Arc Sql Server. + + List the databases associated with the given Arc Sql Server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An iterator like instance of SqlServerDatabaseResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerDatabaseResource]] = 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_sql_server_databases_list_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerDatabaseResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -123,9 +12487,9 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_patch.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_patch.py index 5755fd181b3f..87676c65a8f0 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_patch.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_patch.py @@ -1,16 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - - +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_postgres_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_postgres_instances_operations.py deleted file mode 100644 index ec45bea74e64..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_postgres_instances_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._postgres_instances_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) -from .._configuration import AzureArcDataManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class PostgresInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s - :attr:`postgres_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> AsyncItemPaged["_models.PostgresInstance"]: - """List postgres Instance resources in the subscription. - - List postgres Instance resources in the subscription. - - :return: An iterator like instance of either PostgresInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PostgresInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PostgresInstance"]: - """List postgres Instance resources in the resource group. - - Get a postgres Instances list by Resource group name. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either PostgresInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PostgresInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, postgres_instance_name: str, **kwargs: Any - ) -> _models.PostgresInstance: - """Retrieves a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: Union[_models.PostgresInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "PostgresInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: _models.PostgresInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. Required. - :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. 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 either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: Union[_models.PostgresInstance, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. Is either a PostgresInstance type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance or IO[bytes] - :return: An instance of AsyncLROPoller that returns either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PostgresInstance] = 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_initial( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - resource=resource, - api_version=api_version, - 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): - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PostgresInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PostgresInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, postgres_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, postgres_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - postgres_instance_name=postgres_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **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 - - @overload - async def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: _models.PostgresInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Required. - :type parameters: 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: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: Union[_models.PostgresInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Is either a PostgresInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate or IO[bytes] - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PostgresInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PostgresInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py deleted file mode 100644 index 41826420bdfc..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_managed_instances_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_managed_instances_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) -from .._configuration import AzureArcDataManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlManagedInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s - :attr:`sql_managed_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlManagedInstance"]: - """List sqlManagedInstance resources in the subscription. - - List sqlManagedInstance resources in the subscription. - - :return: An iterator like instance of either SqlManagedInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SqlManagedInstance"]: - """List sqlManagedInstance resources in the resource group. - - Gets all sqlManagedInstances in a resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either SqlManagedInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any - ) -> _models.SqlManagedInstance: - """Retrieves a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: Union[_models.SqlManagedInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(sql_managed_instance, (IOBase, bytes)): - _content = sql_managed_instance - else: - _json = self._serialize.body(sql_managed_instance, "SqlManagedInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: _models.SqlManagedInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. - :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. - :type sql_managed_instance: 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 either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: Union[_models.SqlManagedInstance, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Is either a - SqlManagedInstance type or a IO[bytes] type. Required. - :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlManagedInstance] = 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_initial( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - sql_managed_instance=sql_managed_instance, - api_version=api_version, - 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): - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SqlManagedInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SqlManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, sql_managed_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - sql_managed_instance_name=sql_managed_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **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 - - @overload - async def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: _models.SqlManagedInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Required. - :type parameters: 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: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: Union[_models.SqlManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Is either a SqlManagedInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate or IO[bytes] - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlManagedInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SqlManagedInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py deleted file mode 100644 index 9379fc77b085..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/aio/operations/_sql_server_instances_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_server_instances_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) -from .._configuration import AzureArcDataManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlServerInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.aio.AzureArcDataManagementClient`'s - :attr:`sql_server_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> AsyncItemPaged["_models.SqlServerInstance"]: - """List sqlServerInstance resources in the subscription. - - List sqlServerInstance resources in the subscription. - - :return: An iterator like instance of either SqlServerInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlServerInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SqlServerInstance"]: - """List sqlServerInstance resources in the resource group. - - Gets all sqlServerInstances in a resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either SqlServerInstance or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlServerInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any - ) -> _models.SqlServerInstance: - """Retrieves a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: Union[_models.SqlServerInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(sql_server_instance, (IOBase, bytes)): - _content = sql_server_instance - else: - _json = self._serialize.body(sql_server_instance, "SqlServerInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: _models.SqlServerInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Required. - :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Required. - :type sql_server_instance: 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 either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: Union[_models.SqlServerInstance, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Is either a - SqlServerInstance type or a IO[bytes] type. Required. - :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlServerInstance] = 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_initial( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - sql_server_instance=sql_server_instance, - api_version=api_version, - 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): - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SqlServerInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SqlServerInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, sql_server_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - sql_server_instance_name=sql_server_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **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 - - @overload - async def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: _models.SqlServerInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Required. - :type parameters: 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: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: Union[_models.SqlServerInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Is either a SqlServerInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate or IO[bytes] - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlServerInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SqlServerInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py index 689f1d4e23bb..dbb98567b73e 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,10 +13,9 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore +from ._models import ( # type: ignore ActiveDirectoryConnectorDNSDetails, ActiveDirectoryConnectorDomainDetails, - ActiveDirectoryConnectorListResult, ActiveDirectoryConnectorProperties, ActiveDirectoryConnectorResource, ActiveDirectoryConnectorSpec, @@ -24,62 +23,224 @@ ActiveDirectoryDomainController, ActiveDirectoryDomainControllers, ActiveDirectoryInformation, + AdditionalMigrationJobAttributes, + Authentication, + AvailabilityGroupConfigure, + AvailabilityGroupCreateUpdateConfiguration, + AvailabilityGroupCreateUpdateReplicaConfiguration, + AvailabilityGroupInfo, + AvailabilityGroupRetrievalFilters, + AvailabilityGroupState, + BackgroundJob, + BackupPolicy, BasicLoginInformation, + BestPracticesAssessment, + ClientConnection, CommonSku, + CostOptionSelectedValues, + CostTypeValues, + CronTrigger, + DBMEndpoint, + DataBaseMigration, + DataBaseMigrationAssessment, DataControllerProperties, DataControllerResource, DataControllerUpdate, + DatabaseAssessmentsItem, + DatabaseMigrationJobsItem, + Databases, + DiskSizes, + DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration, + DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration, + DistributedAvailabilityGroupCreateUpdateConfiguration, + EntraAuthentication, + ErrorAdditionalInfo, + ErrorDetail, ErrorResponse, - ErrorResponseBody, ExtendedLocation, + FailoverCluster, + FailoverGroupProperties, + FailoverGroupResource, + FailoverGroupSpec, + FailoverMiLinkResourceId, + HostIPAddressInformation, + ImpactedObjectsInfo, + ImpactedObjectsSuitabilitySummary, + K8SActiveDirectory, + K8SActiveDirectoryConnector, + K8SNetworkSettings, K8SResourceRequirements, K8SScheduling, K8SSchedulingOptions, + K8SSecurity, + K8SSettings, + K8StransparentDataEncryption, KeytabInformation, LogAnalyticsWorkspaceConfig, + ManagedInstanceLinkCreateUpdateConfiguration, + MiLinkCreateUpdateConfiguration, + Migration, + MigrationAssessment, + MigrationAssessmentSettings, + Monitoring, OnPremiseProperty, Operation, OperationDisplay, - OperationListResult, - PageOfDataControllerResource, PostgresInstance, - PostgresInstanceListResult, PostgresInstanceProperties, PostgresInstanceSku, PostgresInstanceUpdate, ProxyResource, Resource, + Schedule, + SequencerAction, + ServerAssessmentsItem, + ServerAssessmentsPropertiesItemsItem, + SkuRecommendationResults, + SkuRecommendationResultsAzureSqlDatabase, + SkuRecommendationResultsAzureSqlDatabaseTargetSku, + SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory, + SkuRecommendationResultsAzureSqlManagedInstance, + SkuRecommendationResultsAzureSqlManagedInstanceTargetSku, + SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory, + SkuRecommendationResultsAzureSqlVirtualMachine, + SkuRecommendationResultsAzureSqlVirtualMachineTargetSku, + SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory, + SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize, + SkuRecommendationResultsMonthlyCost, + SkuRecommendationResultsMonthlyCostOptionItem, + SkuRecommendationSummary, + SkuRecommendationSummaryTargetSku, + SkuRecommendationSummaryTargetSkuCategory, + SqlAvailabilityGroupDatabaseReplicaResourceProperties, + SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem, + SqlAvailabilityGroupReplicaResourceProperties, + SqlAvailabilityGroupStaticIPListenerProperties, SqlManagedInstance, SqlManagedInstanceK8SRaw, SqlManagedInstanceK8SSpec, - SqlManagedInstanceListResult, SqlManagedInstanceProperties, SqlManagedInstanceSku, SqlManagedInstanceUpdate, + SqlServerAvailabilityGroupResource, + SqlServerAvailabilityGroupResourceProperties, + SqlServerAvailabilityGroupResourcePropertiesDatabases, + SqlServerAvailabilityGroupResourcePropertiesReplicas, + SqlServerAvailabilityGroupUpdate, + SqlServerDatabaseResource, + SqlServerDatabaseResourceProperties, + SqlServerDatabaseResourcePropertiesBackupInformation, + SqlServerDatabaseResourcePropertiesDatabaseOptions, + SqlServerDatabaseUpdate, + SqlServerEsuLicense, + SqlServerEsuLicenseProperties, + SqlServerEsuLicenseUpdate, + SqlServerEsuLicenseUpdateProperties, SqlServerInstance, - SqlServerInstanceListResult, + SqlServerInstanceBpaColumn, + SqlServerInstanceBpaRequest, + SqlServerInstanceJob, + SqlServerInstanceJobStatus, + SqlServerInstanceJobsRequest, + SqlServerInstanceJobsResponse, + SqlServerInstanceJobsStatusRequest, + SqlServerInstanceJobsStatusResponse, + SqlServerInstanceManagedInstanceLinkAssessment, + SqlServerInstanceManagedInstanceLinkAssessmentRequest, + SqlServerInstanceManagedInstanceLinkAssessmentResponse, + SqlServerInstanceMigrationReadinessReportResponse, SqlServerInstanceProperties, + SqlServerInstanceRunBestPracticesAssessmentResponse, + SqlServerInstanceRunMigrationAssessmentResponse, + SqlServerInstanceRunMigrationReadinessAssessmentResponse, + SqlServerInstanceRunTargetRecommendationJobRequest, + SqlServerInstanceRunTargetRecommendationJobResponse, + SqlServerInstanceTargetRecommendationReport, + SqlServerInstanceTargetRecommendationReportSection, + SqlServerInstanceTargetRecommendationReportsRequest, + SqlServerInstanceTargetRecommendationReportsResponse, + SqlServerInstanceTelemetryColumn, + SqlServerInstanceTelemetryRequest, SqlServerInstanceUpdate, + SqlServerInstanceUpdateProperties, + SqlServerLicense, + SqlServerLicenseProperties, + SqlServerLicenseUpdate, + SqlServerLicenseUpdateProperties, SystemData, + TargetReadiness, TrackedResource, UploadServicePrincipal, UploadWatermark, ) -from ._azure_arc_data_management_client_enums import ( # type: ignore +from ._enums import ( # type: ignore AccountProvisioningMode, + ActivationState, + AggregationType, + AlwaysOnRole, ArcSqlManagedInstanceLicenseType, + ArcSqlServerAvailabilityGroupTypeFilter, + ArcSqlServerAvailabilityMode, + ArcSqlServerFailoverMode, ArcSqlServerLicenseType, + AssessmentStatus, + AutomatedBackupPreference, + AzureManagedInstanceRole, + BillingPlan, + ClusterType, + ConnectionAuth, ConnectionStatus, CreatedByType, + DatabaseCreateMode, + DatabaseState, + DbFailover, DefenderStatus, + DifferentialBackupHours, + DiscoverySource, + DtcSupport, EditionType, + EncryptionAlgorithm, + ExecutionState, ExtendedLocationTypes, + FailoverGroupPartnerSyncMode, + FailureConditionLevel, HostType, + IdentityType, Infrastructure, + InitiatedFrom, + InstanceFailoverGroupRole, + JobStatus, + LastExecutionStatus, + LicenseCategory, + MiLinkAssessmentCategory, + MigrationMode, + MigrationStatus, + Mode, OperationOrigin, + PrimaryAllowConnections, + ProvisioningState, + RecommendationStatus, + RecoveryMode, + ReplicationPartnerType, + ResourceUpdateMode, + Result, + Role, + ScopeType, + SecondaryAllowConnections, + SeedingMode, + SequencerState, + ServiceType, SqlManagedInstanceSkuTier, + SqlServerInstanceBpaColumnType, + SqlServerInstanceBpaQueryType, + SqlServerInstanceBpaReportType, + SqlServerInstanceTargetRecommendationReportSectionType, + SqlServerInstanceTelemetryColumnType, SqlVersion, + State, + TargetType, + Version, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -88,7 +249,6 @@ __all__ = [ "ActiveDirectoryConnectorDNSDetails", "ActiveDirectoryConnectorDomainDetails", - "ActiveDirectoryConnectorListResult", "ActiveDirectoryConnectorProperties", "ActiveDirectoryConnectorResource", "ActiveDirectoryConnectorSpec", @@ -96,59 +256,221 @@ "ActiveDirectoryDomainController", "ActiveDirectoryDomainControllers", "ActiveDirectoryInformation", + "AdditionalMigrationJobAttributes", + "Authentication", + "AvailabilityGroupConfigure", + "AvailabilityGroupCreateUpdateConfiguration", + "AvailabilityGroupCreateUpdateReplicaConfiguration", + "AvailabilityGroupInfo", + "AvailabilityGroupRetrievalFilters", + "AvailabilityGroupState", + "BackgroundJob", + "BackupPolicy", "BasicLoginInformation", + "BestPracticesAssessment", + "ClientConnection", "CommonSku", + "CostOptionSelectedValues", + "CostTypeValues", + "CronTrigger", + "DBMEndpoint", + "DataBaseMigration", + "DataBaseMigrationAssessment", "DataControllerProperties", "DataControllerResource", "DataControllerUpdate", + "DatabaseAssessmentsItem", + "DatabaseMigrationJobsItem", + "Databases", + "DiskSizes", + "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration", + "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration", + "DistributedAvailabilityGroupCreateUpdateConfiguration", + "EntraAuthentication", + "ErrorAdditionalInfo", + "ErrorDetail", "ErrorResponse", - "ErrorResponseBody", "ExtendedLocation", + "FailoverCluster", + "FailoverGroupProperties", + "FailoverGroupResource", + "FailoverGroupSpec", + "FailoverMiLinkResourceId", + "HostIPAddressInformation", + "ImpactedObjectsInfo", + "ImpactedObjectsSuitabilitySummary", + "K8SActiveDirectory", + "K8SActiveDirectoryConnector", + "K8SNetworkSettings", "K8SResourceRequirements", "K8SScheduling", "K8SSchedulingOptions", + "K8SSecurity", + "K8SSettings", + "K8StransparentDataEncryption", "KeytabInformation", "LogAnalyticsWorkspaceConfig", + "ManagedInstanceLinkCreateUpdateConfiguration", + "MiLinkCreateUpdateConfiguration", + "Migration", + "MigrationAssessment", + "MigrationAssessmentSettings", + "Monitoring", "OnPremiseProperty", "Operation", "OperationDisplay", - "OperationListResult", - "PageOfDataControllerResource", "PostgresInstance", - "PostgresInstanceListResult", "PostgresInstanceProperties", "PostgresInstanceSku", "PostgresInstanceUpdate", "ProxyResource", "Resource", + "Schedule", + "SequencerAction", + "ServerAssessmentsItem", + "ServerAssessmentsPropertiesItemsItem", + "SkuRecommendationResults", + "SkuRecommendationResultsAzureSqlDatabase", + "SkuRecommendationResultsAzureSqlDatabaseTargetSku", + "SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory", + "SkuRecommendationResultsAzureSqlManagedInstance", + "SkuRecommendationResultsAzureSqlManagedInstanceTargetSku", + "SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory", + "SkuRecommendationResultsAzureSqlVirtualMachine", + "SkuRecommendationResultsAzureSqlVirtualMachineTargetSku", + "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory", + "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize", + "SkuRecommendationResultsMonthlyCost", + "SkuRecommendationResultsMonthlyCostOptionItem", + "SkuRecommendationSummary", + "SkuRecommendationSummaryTargetSku", + "SkuRecommendationSummaryTargetSkuCategory", + "SqlAvailabilityGroupDatabaseReplicaResourceProperties", + "SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem", + "SqlAvailabilityGroupReplicaResourceProperties", + "SqlAvailabilityGroupStaticIPListenerProperties", "SqlManagedInstance", "SqlManagedInstanceK8SRaw", "SqlManagedInstanceK8SSpec", - "SqlManagedInstanceListResult", "SqlManagedInstanceProperties", "SqlManagedInstanceSku", "SqlManagedInstanceUpdate", + "SqlServerAvailabilityGroupResource", + "SqlServerAvailabilityGroupResourceProperties", + "SqlServerAvailabilityGroupResourcePropertiesDatabases", + "SqlServerAvailabilityGroupResourcePropertiesReplicas", + "SqlServerAvailabilityGroupUpdate", + "SqlServerDatabaseResource", + "SqlServerDatabaseResourceProperties", + "SqlServerDatabaseResourcePropertiesBackupInformation", + "SqlServerDatabaseResourcePropertiesDatabaseOptions", + "SqlServerDatabaseUpdate", + "SqlServerEsuLicense", + "SqlServerEsuLicenseProperties", + "SqlServerEsuLicenseUpdate", + "SqlServerEsuLicenseUpdateProperties", "SqlServerInstance", - "SqlServerInstanceListResult", + "SqlServerInstanceBpaColumn", + "SqlServerInstanceBpaRequest", + "SqlServerInstanceJob", + "SqlServerInstanceJobStatus", + "SqlServerInstanceJobsRequest", + "SqlServerInstanceJobsResponse", + "SqlServerInstanceJobsStatusRequest", + "SqlServerInstanceJobsStatusResponse", + "SqlServerInstanceManagedInstanceLinkAssessment", + "SqlServerInstanceManagedInstanceLinkAssessmentRequest", + "SqlServerInstanceManagedInstanceLinkAssessmentResponse", + "SqlServerInstanceMigrationReadinessReportResponse", "SqlServerInstanceProperties", + "SqlServerInstanceRunBestPracticesAssessmentResponse", + "SqlServerInstanceRunMigrationAssessmentResponse", + "SqlServerInstanceRunMigrationReadinessAssessmentResponse", + "SqlServerInstanceRunTargetRecommendationJobRequest", + "SqlServerInstanceRunTargetRecommendationJobResponse", + "SqlServerInstanceTargetRecommendationReport", + "SqlServerInstanceTargetRecommendationReportSection", + "SqlServerInstanceTargetRecommendationReportsRequest", + "SqlServerInstanceTargetRecommendationReportsResponse", + "SqlServerInstanceTelemetryColumn", + "SqlServerInstanceTelemetryRequest", "SqlServerInstanceUpdate", + "SqlServerInstanceUpdateProperties", + "SqlServerLicense", + "SqlServerLicenseProperties", + "SqlServerLicenseUpdate", + "SqlServerLicenseUpdateProperties", "SystemData", + "TargetReadiness", "TrackedResource", "UploadServicePrincipal", "UploadWatermark", "AccountProvisioningMode", + "ActivationState", + "AggregationType", + "AlwaysOnRole", "ArcSqlManagedInstanceLicenseType", + "ArcSqlServerAvailabilityGroupTypeFilter", + "ArcSqlServerAvailabilityMode", + "ArcSqlServerFailoverMode", "ArcSqlServerLicenseType", + "AssessmentStatus", + "AutomatedBackupPreference", + "AzureManagedInstanceRole", + "BillingPlan", + "ClusterType", + "ConnectionAuth", "ConnectionStatus", "CreatedByType", + "DatabaseCreateMode", + "DatabaseState", + "DbFailover", "DefenderStatus", + "DifferentialBackupHours", + "DiscoverySource", + "DtcSupport", "EditionType", + "EncryptionAlgorithm", + "ExecutionState", "ExtendedLocationTypes", + "FailoverGroupPartnerSyncMode", + "FailureConditionLevel", "HostType", + "IdentityType", "Infrastructure", + "InitiatedFrom", + "InstanceFailoverGroupRole", + "JobStatus", + "LastExecutionStatus", + "LicenseCategory", + "MiLinkAssessmentCategory", + "MigrationMode", + "MigrationStatus", + "Mode", "OperationOrigin", + "PrimaryAllowConnections", + "ProvisioningState", + "RecommendationStatus", + "RecoveryMode", + "ReplicationPartnerType", + "ResourceUpdateMode", + "Result", + "Role", + "ScopeType", + "SecondaryAllowConnections", + "SeedingMode", + "SequencerState", + "ServiceType", "SqlManagedInstanceSkuTier", + "SqlServerInstanceBpaColumnType", + "SqlServerInstanceBpaQueryType", + "SqlServerInstanceBpaReportType", + "SqlServerInstanceTargetRecommendationReportSectionType", + "SqlServerInstanceTelemetryColumnType", "SqlVersion", + "State", + "TargetType", + "Version", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py deleted file mode 100644 index 8133d9dc267d..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_azure_arc_data_management_client_enums.py +++ /dev/null @@ -1,135 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccountProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The service account provisioning mode for this Active Directory connector.""" - - AUTOMATIC = "automatic" - MANUAL = "manual" - - -class ArcSqlManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The license type to apply for this managed instance.""" - - BASE_PRICE = "BasePrice" - LICENSE_INCLUDED = "LicenseIncluded" - DISASTER_RECOVERY = "DisasterRecovery" - - -class ArcSqlServerLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SQL Server license type.""" - - UNDEFINED = "Undefined" - FREE = "Free" - HADR = "HADR" - SERVER_CAL = "ServerCAL" - LICENSE_ONLY = "LicenseOnly" - PAYG = "PAYG" - PAID = "Paid" - - -class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The cloud connectivity status.""" - - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - REGISTERED = "Registered" - UNKNOWN = "Unknown" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DefenderStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of Azure Defender.""" - - PROTECTED = "Protected" - UNPROTECTED = "Unprotected" - UNKNOWN = "Unknown" - - -class EditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SQL Server edition.""" - - EVALUATION = "Evaluation" - ENTERPRISE = "Enterprise" - STANDARD = "Standard" - WEB = "Web" - DEVELOPER = "Developer" - EXPRESS = "Express" - - -class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of extendedLocation.""" - - CUSTOM_LOCATION = "CustomLocation" - - -class HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of host for Azure Arc SQL Server.""" - - AZURE_VIRTUAL_MACHINE = "Azure Virtual Machine" - AZURE_VM_WARE_VIRTUAL_MACHINE = "Azure VMWare Virtual Machine" - AZURE_KUBERNETES_SERVICE = "Azure Kubernetes Service" - AWS_VM_WARE_VIRTUAL_MACHINE = "AWS VMWare Virtual Machine" - AWS_KUBERNETES_SERVICE = "AWS Kubernetes Service" - GCP_VM_WARE_VIRTUAL_MACHINE = "GCP VMWare Virtual Machine" - GCP_KUBERNETES_SERVICE = "GCP Kubernetes Service" - CONTAINER = "Container" - VIRTUAL_MACHINE = "Virtual Machine" - PHYSICAL_SERVER = "Physical Server" - AWS_VIRTUAL_MACHINE = "AWS Virtual Machine" - GCP_VIRTUAL_MACHINE = "GCP Virtual Machine" - OTHER = "Other" - - -class Infrastructure(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The infrastructure the data controller is running on.""" - - AZURE = "azure" - GCP = "gcp" - AWS = "aws" - ALIBABA = "alibaba" - ONPREMISES = "onpremises" - OTHER = "other" - - -class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation.""" - - USER = "user" - SYSTEM = "system" - - -class SqlManagedInstanceSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The pricing tier for the instance.""" - - GENERAL_PURPOSE = "GeneralPurpose" - BUSINESS_CRITICAL = "BusinessCritical" - - -class SqlVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SQL Server version.""" - - SQL_SERVER2012 = "SQL Server 2012" - SQL_SERVER2014 = "SQL Server 2014" - SQL_SERVER2016 = "SQL Server 2016" - SQL_SERVER2017 = "SQL Server 2017" - SQL_SERVER2019 = "SQL Server 2019" - SQL_SERVER2022 = "SQL Server 2022" - UNKNOWN = "Unknown" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_enums.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_enums.py new file mode 100644 index 000000000000..e01e23334fd3 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_enums.py @@ -0,0 +1,975 @@ +# 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 enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AccountProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The service account provisioning mode for this Active Directory connector.""" + + AUTOMATIC = "automatic" + """automatic.""" + MANUAL = "manual" + """manual.""" + + +class ActivationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The activation state of the license.""" + + ACTIVATED = "Activated" + """Activated.""" + DEACTIVATED = "Deactivated" + """Deactivated.""" + + +class AggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The aggregation type to use for the numerical columns in the dataset.""" + + AVERAGE = "Average" + """Average.""" + MINIMUM = "Minimum" + """Minimum.""" + MAXIMUM = "Maximum" + """Maximum.""" + SUM = "Sum" + """Sum.""" + COUNT = "Count" + """Count.""" + + +class AlwaysOnRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The role of the SQL Server, based on availability.""" + + NONE = "None" + """None.""" + FAILOVER_CLUSTER_INSTANCE = "FailoverClusterInstance" + """FailoverClusterInstance.""" + FAILOVER_CLUSTER_NODE = "FailoverClusterNode" + """FailoverClusterNode.""" + AVAILABILITY_GROUP_REPLICA = "AvailabilityGroupReplica" + """AvailabilityGroupReplica.""" + + +class ArcSqlManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The license type to apply for this managed instance.""" + + BASE_PRICE = "BasePrice" + """BasePrice.""" + LICENSE_INCLUDED = "LicenseIncluded" + """LicenseIncluded.""" + DISASTER_RECOVERY = "DisasterRecovery" + """DisasterRecovery.""" + + +class ArcSqlServerAvailabilityGroupTypeFilter(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Filter retrieval based on availability group type.""" + + CONTAINED = "CONTAINED" + """Contained Availability Group (CAG).""" + DISTRIBUTED = "DISTRIBUTED" + """Distributed Availability Group (DAG).""" + DEFAULT = "DEFAULT" + """Default standard availability group that is not contained or distributed.""" + + +class ArcSqlServerAvailabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Property that determines whether a given availability replica can run in synchronous-commit + mode. + """ + + SYNCHRONOUS_COMMIT = "SYNCHRONOUS_COMMIT" + """SYNCHRONOUS_COMMIT.""" + ASYNCHRONOUS_COMMIT = "ASYNCHRONOUS_COMMIT" + """ASYNCHRONOUS_COMMIT.""" + + +class ArcSqlServerFailoverMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Property to set the failover mode of the availability group replica.""" + + AUTOMATIC = "AUTOMATIC" + """AUTOMATIC.""" + MANUAL = "MANUAL" + """MANUAL.""" + EXTERNAL = "EXTERNAL" + """EXTERNAL.""" + NONE = "NONE" + """NONE.""" + + +class ArcSqlServerLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SQL Server license type.""" + + UNDEFINED = "Undefined" + """Undefined.""" + FREE = "Free" + """Free.""" + HADR = "HADR" + """HADR.""" + SERVER_CAL = "ServerCAL" + """ServerCAL.""" + LICENSE_ONLY = "LicenseOnly" + """LicenseOnly.""" + PAYG = "PAYG" + """PAYG.""" + PAID = "Paid" + """Paid.""" + FABRIC_CAPACITY = "FabricCapacity" + """FabricCapacity.""" + + +class AssessmentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the requirement.""" + + SUCCESS = "Success" + """Success.""" + WARNING = "Warning" + """Warning.""" + FAILURE = "Failure" + """Failure.""" + + +class AutomatedBackupPreference(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Preferred replica for running automated backups.""" + + PRIMARY = "PRIMARY" + """PRIMARY.""" + SECONDARY_ONLY = "SECONDARY_ONLY" + """SECONDARY_ONLY.""" + SECONDARY = "SECONDARY" + """SECONDARY.""" + NONE = "NONE" + """NONE.""" + + +class AzureManagedInstanceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The role of managed instance in a distributed availability group, can be Primary or Secondary.""" + + PRIMARY = "Primary" + """Primary.""" + SECONDARY = "Secondary" + """Secondary.""" + + +class BillingPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SQL Server ESU license type.""" + + PAYG = "PAYG" + """PAYG.""" + PAID = "Paid" + """Paid.""" + + +class ClusterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Set to WSFC when availability group is on a failover cluster instance on a Windows Server + failover cluster. Set to NONE when availability group not using WSFC for cluster coordination. + """ + + WSFC = "WSFC" + """WSFC.""" + NONE = "NONE" + """NONE.""" + + +class ConnectionAuth(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The endpoint connection authentication type(s).""" + + WINDOWS_NTLM = "Windows_NTLM" + """Windows_NTLM.""" + WINDOWS_KERBEROS = "Windows_Kerberos" + """Windows_Kerberos.""" + WINDOWS_NEGOTIATE = "Windows_Negotiate" + """Windows_Negotiate.""" + CERTIFICATE = "Certificate" + """Certificate.""" + WINDOWS_NTLM_CERTIFICATE = "Windows_NTLM_Certificate" + """Windows_NTLM_Certificate.""" + WINDOWS_KERBEROS_CERTIFICATE = "Windows_Kerberos_Certificate" + """Windows_Kerberos_Certificate.""" + WINDOWS_NEGOTIATE_CERTIFICATE = "Windows_Negotiate_Certificate" + """Windows_Negotiate_Certificate.""" + CERTIFICATE_WINDOWS_NTLM = "Certificate_Windows_NTLM" + """Certificate_Windows_NTLM.""" + CERTIFICATE_WINDOWS_KERBEROS = "Certificate_Windows_Kerberos" + """Certificate_Windows_Kerberos.""" + CERTIFICATE_WINDOWS_NEGOTIATE = "Certificate_Windows_Negotiate" + """Certificate_Windows_Negotiate.""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The cloud connectivity status.""" + + CONNECTED = "Connected" + """Connected.""" + DISCONNECTED = "Disconnected" + """Disconnected.""" + REGISTERED = "Registered" + """Registered.""" + DISCOVERED = "Discovered" + """Discovered.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class DatabaseCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Database create mode. PointInTimeRestore: Create a database by restoring a point in time backup + of an existing database. sourceDatabaseId and restorePointInTime must be specified. + """ + + DEFAULT = "Default" + """Default.""" + POINT_IN_TIME_RESTORE = "PointInTimeRestore" + """PointInTimeRestore.""" + + +class DatabaseState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the database.""" + + ONLINE = "Online" + """Online.""" + RESTORING = "Restoring" + """Restoring.""" + RECOVERING = "Recovering" + """Recovering.""" + RECOVERY_PENDING = "RecoveryPending" + """RecoveryPending.""" + SUSPECT = "Suspect" + """Suspect.""" + EMERGENCY = "Emergency" + """Emergency.""" + OFFLINE = "Offline" + """Offline.""" + COPYING = "Copying" + """Copying.""" + OFFLINE_SECONDARY = "OfflineSecondary" + """OfflineSecondary.""" + + +class DbFailover(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies whether the availability group supports failover for database health conditions.""" + + ON = "ON" + """ON.""" + OFF = "OFF" + """OFF.""" + + +class DefenderStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of Azure Defender.""" + + PROTECTED = "Protected" + """Protected.""" + UNPROTECTED = "Unprotected" + """Unprotected.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class DifferentialBackupHours(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """The differential backup interval in hours.""" + + TWELVE = 12 + """12.""" + TWENTY_FOUR = 24 + """24.""" + + +class DiscoverySource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the discovery agent or client for this instance.""" + + AZURE_ARC = "Azure Arc" + """Instance is discovered by Azure Arc enabled agent/extensions.""" + AZURE_MIGRATE = "Azure Migrate" + """Instance is discovered by Azure Migrate agent.""" + ADS = "ADS" + """Instance is discovered/registered from Azure Data Studio (ADS).""" + SSMS = "SSMS" + """Instance is discovered/registered from SQL Server Management Studio (SSMS).""" + SSMA = "SSMA" + """Instance is discovered/registered from SQL Server Migration Assistant (SSMA).""" + IMPORT = "Import" + """Instance is registered via Import.""" + DMS_PORTAL = "DMS-Portal" + """Instance is discovered/registered from Azure Database Migration Service(DMS) Azure Portal.""" + DMS_PS = "DMS-PS" + """Instance is discovered/registered from DMS using PowerShell - Azure DataMigration Service + Module.""" + DMS_CLI = "DMS-CLI" + """Instance is discovered/registered from DMS using datamigration extension for the Azure CLI.""" + DMS_SDK = "DMS-SDK" + """Instance is discovered/registered from Azure Database Migration Service SDK like Python or .NET + SDKs.""" + OTHER = "Other" + """Instance is discovered/registered from any other source not listed above.""" + + +class DtcSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies whether DTC support has been enabled for this availability group.""" + + PER_DB = "PER_DB" + """PER_DB.""" + NONE = "NONE" + """NONE.""" + + +class EditionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SQL Server edition.""" + + EVALUATION = "Evaluation" + """Evaluation.""" + ENTERPRISE = "Enterprise" + """Enterprise.""" + STANDARD = "Standard" + """Standard.""" + WEB = "Web" + """Web.""" + DEVELOPER = "Developer" + """Developer.""" + EXPRESS = "Express" + """Express.""" + BUSINESS_INTELLIGENCE = "Business Intelligence" + """Business Intelligence.""" + STANDARD_DEVELOPER = "Standard Developer" + """Standard Developer.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class EncryptionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The encryption algorithm(s) used by the endpoint.""" + + NONE = "NONE" + """NONE.""" + RC4 = "RC4" + """RC4.""" + AES = "AES" + """AES.""" + NONE_RC4 = "NONE, RC4" + """NONE, RC4.""" + NONE_AES = "NONE, AES" + """NONE, AES.""" + RC4_AES = "RC4, AES" + """RC4, AES.""" + AES_RC4 = "AES, RC4" + """AES, RC4.""" + NONE_RC4_AES = "NONE, RC4, AES" + """NONE, RC4, AES.""" + NONE_AES_RC4 = "NONE, AES, RC4" + """NONE, AES, RC4.""" + + +class ExecutionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The execution state of the background job.""" + + WAITING = "Waiting" + """Waiting.""" + RUNNING = "Running" + """Running.""" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + CUSTOM_LOCATION = "CustomLocation" + """CustomLocation.""" + + +class FailoverGroupPartnerSyncMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The partner sync mode of the SQL managed instance.""" + + ASYNC = "async" + """async.""" + SYNC = "sync" + """sync.""" + + +class FailureConditionLevel(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """User-defined failure condition level under which an automatic failover must be triggered.""" + + ONE = 1 + """1.""" + TWO = 2 + """2.""" + THREE = 3 + """3.""" + FOUR = 4 + """4.""" + FIVE = 5 + """5.""" + + +class HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of host for Azure Arc SQL Server.""" + + AZURE_VIRTUAL_MACHINE = "Azure Virtual Machine" + """Azure Virtual Machine.""" + AZURE_VM_WARE_VIRTUAL_MACHINE = "Azure VMWare Virtual Machine" + """Azure VMWare Virtual Machine.""" + AZURE_KUBERNETES_SERVICE = "Azure Kubernetes Service" + """Azure Kubernetes Service.""" + AWS_VM_WARE_VIRTUAL_MACHINE = "AWS VMWare Virtual Machine" + """AWS VMWare Virtual Machine.""" + AWS_KUBERNETES_SERVICE = "AWS Kubernetes Service" + """AWS Kubernetes Service.""" + GCP_VM_WARE_VIRTUAL_MACHINE = "GCP VMWare Virtual Machine" + """GCP VMWare Virtual Machine.""" + GCP_KUBERNETES_SERVICE = "GCP Kubernetes Service" + """GCP Kubernetes Service.""" + CONTAINER = "Container" + """Container.""" + VIRTUAL_MACHINE = "Virtual Machine" + """Virtual Machine.""" + PHYSICAL_SERVER = "Physical Server" + """Physical Server.""" + AWS_VIRTUAL_MACHINE = "AWS Virtual Machine" + """AWS Virtual Machine.""" + GCP_VIRTUAL_MACHINE = "GCP Virtual Machine" + """GCP Virtual Machine.""" + HYPER_V_VIRTUAL_MACHINE = "Hyper-V Virtual Machine" + """Hyper-V Virtual Machine.""" + OTHER = "Other" + """Other.""" + + +class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The method used for Entra authentication.""" + + SYSTEM_ASSIGNED_MANAGED_IDENTITY = "SystemAssignedManagedIdentity" + """System Assigned Managed Identity.""" + USER_ASSIGNED_MANAGED_IDENTITY = "UserAssignedManagedIdentity" + """User Assigned Managed Identity.""" + + +class Infrastructure(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The infrastructure the data controller is running on.""" + + AZURE = "azure" + """azure.""" + GCP = "gcp" + """gcp.""" + AWS = "aws" + """aws.""" + ALIBABA = "alibaba" + """alibaba.""" + ONPREMISES = "onpremises" + """onpremises.""" + OTHER = "other" + """other.""" + + +class InitiatedFrom(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """To indicate the client from which the migration is initiated from e.g. Azure Arc, DMS-Azure + Portal/PS/CLI for additional tracking. + """ + + AZURE_ARC = "Azure Arc" + """Migration is initiated from Azure Arc enabled clients.""" + ADS = "ADS" + """Migration is initiated from Azure Data Studio (ADS).""" + SSMS = "SSMS" + """Migration is initiated from SQL Server Management Studio (SSMS).""" + SSMA = "SSMA" + """Migration is initiated from SQL Server Migration Assistant (SSMA).""" + DMS_PORTAL = "DMS-Portal" + """Migration is initiated from Azure Database Migration Service(DMS) Azure Portal.""" + DMS_PS = "DMS-PS" + """Migration is initiated from DMS using PowerShell - Azure DataMigration Service Module.""" + DMS_CLI = "DMS-CLI" + """Migration is initiated from DMS using datamigration extension for the Azure CLI.""" + DMS_SDK = "DMS-SDK" + """Migration is initiated from Azure Database Migration Service SDK like Python or .NET SDKs.""" + OTHER = "Other" + """Migration is initiated from any other client not listed above.""" + + +class InstanceFailoverGroupRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The role of the SQL managed instance in this failover group.""" + + PRIMARY = "primary" + """primary.""" + SECONDARY = "secondary" + """secondary.""" + FORCE_PRIMARY_ALLOW_DATA_LOSS = "force-primary-allow-data-loss" + """force-primary-allow-data-loss.""" + FORCE_SECONDARY = "force-secondary" + """force-secondary.""" + + +class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the current status of the target recommendation job.""" + + NOT_STARTED = "NotStarted" + """NotStarted.""" + IN_PROGRESS = "InProgress" + """InProgress.""" + SUCCEEDED = "Succeeded" + """Succeeded.""" + FAILED = "Failed" + """Failed.""" + + +class LastExecutionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The last execution status of the background job.""" + + SUCCEEDED = "Succeeded" + """Succeeded.""" + COMPLETED = "Completed" + """Completed.""" + FAILED = "Failed" + """Failed.""" + FAULTED = "Faulted" + """Faulted.""" + POSTPONED = "Postponed" + """Postponed.""" + RESCHEDULED = "Rescheduled" + """Rescheduled.""" + + +class LicenseCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This property represents the choice between SQL Server Core and ESU licenses.""" + + CORE = "Core" + """Core.""" + + +class MigrationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode/type of migration.""" + + LOG_SHIPPING = "LogShipping" + """Migration based on log-shipping technology like LRS (Log Replay Service).""" + MI_LINK = "MILink" + """Migration using managed instance link (MILink) that utilizes Always On availability group + technology.""" + LOGICAL = "Logical" + """Logical migration refers to moving data at the logical level (schema and rows) rather than + transferring physical database files or backups. Examples include migrating to Azure SQL + Database, which does not support physical restore.""" + OTHER = "Other" + """Other mode of migration not listed currently.""" + UNKNOWN = "Unknown" + """Mode of migration is not known.""" + + +class MigrationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the migration job.""" + + NOT_STARTED = "NotStarted" + """NotStarted.""" + IN_PROGRESS = "InProgress" + """InProgress.""" + IN_PROGRESS_WITH_WARNINGS = "InProgressWithWarnings" + """InProgressWithWarnings.""" + CANCELLED = "Cancelled" + """Cancelled.""" + FAILED = "Failed" + """Failed.""" + SUCCESSFUL = "Successful" + """Successful.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class MiLinkAssessmentCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Validation category for the MI Link prerequisites assessment.""" + + SQL_INSTANCE = "SqlInstance" + """Assessments of the given instance on the on-premise SQL Server (box).""" + SQL_INSTANCE_DATABASE = "SqlInstanceDatabase" + """Assessments of the database(s) on the given instance on the on-premise SQL Server (box).""" + MANAGED_INSTANCE = "ManagedInstance" + """Assessments of the Managed Instance.""" + MANAGED_INSTANCE_DATABASE = "ManagedInstanceDatabase" + """Assessments of the database(s) on the Managed Instance.""" + MANAGED_INSTANCE_CROSS_VALIDATION = "ManagedInstanceCrossValidation" + """Assessments that use data from both the Managed Instance and the given instance of the + on-premise SQL Server (box) for the validations.""" + CERTIFICATES = "Certificates" + """Assessments of the necessary certificates configuration.""" + BOX_TO_MI_NETWORK_CONNECTIVITY = "BoxToMiNetworkConnectivity" + """Assessment of network connectivity from the on-premise SQL Server (box) to the Managed + Instance.""" + MI_TO_BOX_NETWORK_CONNECTIVITY = "MiToBoxNetworkConnectivity" + """Assessments of network connectivity from the Managed Instance to the on-premise SQL Server + (box).""" + SQL_INSTANCE_AG = "SqlInstanceAg" + """Assessments of the chosen Availability Group.""" + DAG_CROSS_VALIDATION = "DagCrossValidation" + """Assessments of the chosen Distributed Availability Group.""" + + +class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of authentication in SqlServer.""" + + MIXED = "Mixed" + """Mixed mode authentication for SQL Server which includes windows and SQL Authentication.""" + WINDOWS = "Windows" + """Windows Authentication for SQL Server.""" + UNDEFINED = "Undefined" + """Used for scenarios were the mode cannot be determined.""" + + +class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation.""" + + USER = "user" + """user.""" + SYSTEM = "system" + """system.""" + + +class PrimaryAllowConnections(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the primary replica should allow all connections or only READ_WRITE connections + (disallowing ReadOnly connections). + """ + + ALL = "ALL" + """ALL.""" + READ_WRITE = "READ_WRITE" + """READ_WRITE.""" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the failover group resource.""" + + SUCCEEDED = "Succeeded" + """Succeeded.""" + FAILED = "Failed" + """Failed.""" + CANCELED = "Canceled" + """Canceled.""" + ACCEPTED = "Accepted" + """Accepted.""" + + +class RecommendationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The target recommendation Status for this database.""" + + NOT_READY = "NotReady" + """NotReady.""" + READY = "Ready" + """Ready.""" + READY_WITH_CONDITIONS = "ReadyWithConditions" + """ReadyWithConditions.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class RecoveryMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the database.""" + + FULL = "Full" + """Full.""" + BULK_LOGGED = "Bulk-logged" + """Bulk-logged.""" + SIMPLE = "Simple" + """Simple.""" + + +class ReplicationPartnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ReplicationPartnerType.""" + + SQL_SERVER = "SQLServer" + """SQLServer.""" + AZURE_SQLVM = "AzureSQLVM" + """AzureSQLVM.""" + AZURE_SQL_MANAGED_INSTANCE = "AzureSQLManagedInstance" + """AzureSQLManagedInstance.""" + UNKNOWN = "Unknown" + """Unknown.""" + + +class ResourceUpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Controls whether the SQL Server instance resource is updated with the target recommendation + details after the job completes. + """ + + UPDATE_ALL_TARGET_RECOMMENDATION_DETAILS = "UpdateAllTargetRecommendationDetails" + """Update the SQL Server instance resource with all target recommendation details, including SKU + recommendations and cost estimates, upon job completion.""" + SKIP_RESOURCE_UPDATE = "SkipResourceUpdate" + """Do not update the SQL Server instance resource. The target recommendation results will only be + available via the GetTargetRecommendationReports API.""" + + +class Result(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The result of the sequencer action.""" + + NOT_COMPLETED = "NotCompleted" + """NotCompleted.""" + SUCCEEDED = "Succeeded" + """Succeeded.""" + FAILED = "Failed" + """Failed.""" + TIMED_OUT = "TimedOut" + """TimedOut.""" + SKIPPED = "Skipped" + """Skipped.""" + + +class Role(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mirroring Role.""" + + NONE = "NONE" + """NONE.""" + PARTNER = "PARTNER" + """PARTNER.""" + WITNESS = "WITNESS" + """WITNESS.""" + ALL = "ALL" + """ALL.""" + + +class ScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Azure scope to which the license will apply.""" + + TENANT = "Tenant" + """Tenant.""" + SUBSCRIPTION = "Subscription" + """Subscription.""" + RESOURCE_GROUP = "ResourceGroup" + """ResourceGroup.""" + + +class SecondaryAllowConnections(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the secondary replica should allow all connections, no connections, or only ReadOnly + connections. + """ + + NO = "NO" + """NO.""" + ALL = "ALL" + """ALL.""" + READ_ONLY = "READ_ONLY" + """READ_ONLY.""" + + +class SeedingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies how the secondary replica will be initially seeded. AUTOMATIC enables direct seeding. + This method will seed the secondary replica over the network. This method does not require you + to backup and restore a copy of the primary database on the replica. MANUAL specifies manual + seeding (default). This method requires you to create a backup of the database on the primary + replica and manually restore that backup on the secondary replica. + """ + + AUTOMATIC = "AUTOMATIC" + """AUTOMATIC.""" + MANUAL = "MANUAL" + """MANUAL.""" + + +class SequencerState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The state of the sequencer action.""" + + NOT_STARTED = "NotStarted" + """NotStarted.""" + WAITING_PREDECESSORS = "WaitingPredecessors" + """WaitingPredecessors.""" + EXECUTING_ACTION = "ExecutingAction" + """ExecutingAction.""" + CREATING_SUCCESSORS = "CreatingSuccessors" + """CreatingSuccessors.""" + COMPLETED = "Completed" + """Completed.""" + + +class ServiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates if the resource represents a SQL Server engine or a SQL Server component service + installed on the host. + """ + + ENGINE = "Engine" + """SQL Server Database Services.""" + SSRS = "SSRS" + """SQL Server Reporting Services.""" + SSAS = "SSAS" + """SQL Server Analysis Services.""" + SSIS = "SSIS" + """SQL Server Integration Services.""" + PBIRS = "PBIRS" + """Power BI Report Server.""" + + +class SqlManagedInstanceSkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The pricing tier for the instance.""" + + GENERAL_PURPOSE = "GeneralPurpose" + """GeneralPurpose.""" + BUSINESS_CRITICAL = "BusinessCritical" + """BusinessCritical.""" + + +class SqlServerInstanceBpaColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the result column.""" + + BOOL = "bool" + """bool.""" + DATETIME = "datetime" + """datetime.""" + INT = "int" + """int.""" + LONG = "long" + """long.""" + DOUBLE = "double" + """double.""" + STRING = "string" + """string.""" + GUID = "guid" + """guid.""" + TIMESPAN = "timespan" + """timespan.""" + + +class SqlServerInstanceBpaQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of query to run for summarizing the best practices assessment results. If not + specified, the default is 'Basic'. + """ + + BASIC = "Basic" + """Basic.""" + HISTORICAL_TRENDS = "HistoricalTrends" + """HistoricalTrends.""" + + +class SqlServerInstanceBpaReportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The report type that needs to be fetched. If not specified, the default is AssessmentSummary.""" + + ASSESSMENT_DATA_POINT = "AssessmentDataPoint" + """AssessmentDataPoint.""" + ASSESSMENT_SUMMARY = "AssessmentSummary" + """AssessmentSummary.""" + + +class SqlServerInstanceTargetRecommendationReportSectionType( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Filters the report to a specific section type. If not specified, all section types are + returned. Section types are grouped into two categories: requirements sections contain + performance and resource metrics collected from the source SQL Server, while recommendation + sections contain suggested Azure target SKUs derived from those requirements. + """ + + REQUIREMENTS_PER_INSTANCE = "RequirementsPerInstance" + """Aggregated performance and resource requirements for the entire SQL Server instance, including + CPU, memory, IOPS, throughput, and storage metrics collected from the source server.""" + REQUIREMENTS_PER_DATABASE = "RequirementsPerDatabase" + """Performance and resource requirements broken down per database, including CPU, memory, IOPS, + throughput, and storage metrics collected from the source server for each individual database.""" + FILE_REQUIREMENTS_PER_DATABASE = "FileRequirementsPerDatabase" + """File-level performance requirements per database, including IOPS and throughput metrics for + individual data and log files. Only available when includeFileLevelRequirements is set to true + in the RunTargetRecommendationJob request.""" + SQL_VM_TARGET_RECOMMENDATION_PER_INSTANCE = "SqlVmTargetRecommendationPerInstance" + """Recommended Azure SQL Virtual Machine SKU for the entire SQL Server instance, including VM + size, compute, storage, and estimated monthly cost derived from the collected requirements.""" + SQL_MI_TARGET_RECOMMENDATION_PER_INSTANCE = "SqlMiTargetRecommendationPerInstance" + """Recommended Azure SQL Managed Instance SKU for the entire SQL Server instance, including + service tier, compute, storage, and estimated monthly cost derived from the collected + requirements.""" + SQL_DB_TARGET_RECOMMENDATION_PER_DATABASE = "SqlDbTargetRecommendationPerDatabase" + """Recommended Azure SQL Database SKU per database, including service tier, compute, storage, and + estimated monthly cost derived from the collected requirements for each individual database.""" + + +class SqlServerInstanceTelemetryColumnType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the telemetry column.""" + + BOOL = "bool" + """bool.""" + DATETIME = "datetime" + """datetime.""" + INT = "int" + """int.""" + LONG = "long" + """long.""" + DOUBLE = "double" + """double.""" + STRING = "string" + """string.""" + GUID = "guid" + """guid.""" + TIMESPAN = "timespan" + """timespan.""" + + +class SqlVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SQL Server version.""" + + UNKNOWN = "Unknown" + """Unknown.""" + SQL_SERVER2012 = "SQL Server 2012" + """SQL Server 2012.""" + SQL_SERVER2014 = "SQL Server 2014" + """SQL Server 2014.""" + SQL_SERVER2016 = "SQL Server 2016" + """SQL Server 2016.""" + SQL_SERVER2017 = "SQL Server 2017" + """SQL Server 2017.""" + SQL_SERVER2019 = "SQL Server 2019" + """SQL Server 2019.""" + SQL_SERVER2022 = "SQL Server 2022" + """SQL Server 2022.""" + SQL_SERVER2025 = "SQL Server 2025" + """SQL Server 2025.""" + + +class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The activation state of the license.""" + + INACTIVE = "Inactive" + """Inactive.""" + ACTIVE = "Active" + """Active.""" + TERMINATED = "Terminated" + """Terminated.""" + ENABLED = "Enabled" + """Enabled.""" + DISABLED = "Disabled" + """Disabled.""" + DELETED = "Deleted" + """Deleted.""" + COMPLETED = "Completed" + """Completed.""" + FAULTED = "Faulted" + """Faulted.""" + SUSPENDED = "Suspended" + """Suspended.""" + + +class TargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of target in Azure this database is being migrated to.""" + + AZURE_SQL_DATABASE = "AzureSqlDatabase" + """AzureSqlDatabase.""" + AZURE_SQL_MANAGED_INSTANCE = "AzureSqlManagedInstance" + """AzureSqlManagedInstance.""" + AZURE_SQL_VIRTUAL_MACHINE = "AzureSqlVirtualMachine" + """AzureSqlVirtualMachine.""" + + +class Version(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The SQL Server version the license covers.""" + + SQL_SERVER2012 = "SQL Server 2012" + """SQL Server 2012.""" + SQL_SERVER2014 = "SQL Server 2014" + """SQL Server 2014.""" + SQL_SERVER2016 = "SQL Server 2016" + """SQL Server 2016.""" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py new file mode 100644 index 000000000000..93ee26417710 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models.py @@ -0,0 +1,8765 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class ActiveDirectoryConnectorDNSDetails(_Model): + """DNS server details. + + :ivar domain_name: DNS domain name for which DNS lookups should be forwarded to the Active + Directory DNS servers. + :vartype domain_name: str + :ivar nameserver_ip_addresses: List of Active Directory DNS server IP addresses. Required. + :vartype nameserver_ip_addresses: list[str] + :ivar replicas: Replica count for DNS proxy service. Default value is 1. + :vartype replicas: int + :ivar prefer_k8_s_dns_for_ptr_lookups: Flag indicating whether to prefer Kubernetes DNS server + response over AD DNS server response for IP address lookups. + :vartype prefer_k8_s_dns_for_ptr_lookups: bool + """ + + domain_name: Optional[str] = rest_field( + name="domainName", visibility=["read", "create", "update", "delete", "query"] + ) + """DNS domain name for which DNS lookups should be forwarded to the Active Directory DNS servers.""" + nameserver_ip_addresses: list[str] = rest_field( + name="nameserverIPAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Active Directory DNS server IP addresses. Required.""" + replicas: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Replica count for DNS proxy service. Default value is 1.""" + prefer_k8_s_dns_for_ptr_lookups: Optional[bool] = rest_field( + name="preferK8sDnsForPtrLookups", visibility=["read", "create", "update", "delete", "query"] + ) + """Flag indicating whether to prefer Kubernetes DNS server response over AD DNS server response + for IP address lookups.""" + + @overload + def __init__( + self, + *, + nameserver_ip_addresses: list[str], + domain_name: Optional[str] = None, + replicas: Optional[int] = None, + prefer_k8_s_dns_for_ptr_lookups: Optional[bool] = 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 ActiveDirectoryConnectorDomainDetails(_Model): + """Active Directory domain details. + + :ivar realm: Name (uppercase) of the Active Directory domain that this AD connector will be + associated with. Required. + :vartype realm: str + :ivar netbios_domain_name: NETBIOS name of the Active Directory domain. + :vartype netbios_domain_name: str + :ivar service_account_provisioning: The service account provisioning mode for this Active + Directory connector. Known values are: "automatic" and "manual". + :vartype service_account_provisioning: str or + ~azure.mgmt.azurearcdata.models.AccountProvisioningMode + :ivar ou_distinguished_name: The distinguished name of the Active Directory Organizational + Unit. + :vartype ou_distinguished_name: str + :ivar domain_controllers: null. + :vartype domain_controllers: ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers + """ + + realm: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name (uppercase) of the Active Directory domain that this AD connector will be associated with. + Required.""" + netbios_domain_name: Optional[str] = rest_field( + name="netbiosDomainName", visibility=["read", "create", "update", "delete", "query"] + ) + """NETBIOS name of the Active Directory domain.""" + service_account_provisioning: Optional[Union[str, "_models.AccountProvisioningMode"]] = rest_field( + name="serviceAccountProvisioning", visibility=["read", "create", "update", "delete", "query"] + ) + """The service account provisioning mode for this Active Directory connector. Known values are: + \"automatic\" and \"manual\".""" + ou_distinguished_name: Optional[str] = rest_field( + name="ouDistinguishedName", visibility=["read", "create", "update", "delete", "query"] + ) + """The distinguished name of the Active Directory Organizational Unit.""" + domain_controllers: Optional["_models.ActiveDirectoryDomainControllers"] = rest_field( + name="domainControllers", visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + realm: str, + netbios_domain_name: Optional[str] = None, + service_account_provisioning: Optional[Union[str, "_models.AccountProvisioningMode"]] = None, + ou_distinguished_name: Optional[str] = None, + domain_controllers: Optional["_models.ActiveDirectoryDomainControllers"] = 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 ActiveDirectoryConnectorProperties(_Model): + """The properties of an Active Directory connector resource. + + :ivar domain_service_account_login_information: Username and password for domain service + account authentication. + :vartype domain_service_account_login_information: + ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar provisioning_state: The provisioning state of the Active Directory connector resource. + :vartype provisioning_state: str + :ivar spec: null. Required. + :vartype spec: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec + :ivar status: null. + :vartype status: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus + """ + + domain_service_account_login_information: Optional["_models.BasicLoginInformation"] = rest_field( + name="domainServiceAccountLoginInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Username and password for domain service account authentication.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Active Directory connector resource.""" + spec: "_models.ActiveDirectoryConnectorSpec" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + status: Optional["_models.ActiveDirectoryConnectorStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + spec: "_models.ActiveDirectoryConnectorSpec", + domain_service_account_login_information: Optional["_models.BasicLoginInformation"] = None, + status: Optional["_models.ActiveDirectoryConnectorStatus"] = 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 Resource(_Model): + """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.azurearcdata.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurearcdata.models.SystemData + """ + + +class ActiveDirectoryConnectorResource(ProxyResource): + """Active directory connector 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.azurearcdata.models.SystemData + :ivar properties: null. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties + """ + + properties: "_models.ActiveDirectoryConnectorProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.ActiveDirectoryConnectorProperties", + ) -> 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 ActiveDirectoryConnectorSpec(_Model): + """The specifications of the AD Kubernetes resource. + + :ivar active_directory: null. Required. + :vartype active_directory: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails + :ivar dns: null. Required. + :vartype dns: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails + """ + + active_directory: "_models.ActiveDirectoryConnectorDomainDetails" = rest_field( + name="activeDirectory", visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + dns: "_models.ActiveDirectoryConnectorDNSDetails" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + + @overload + def __init__( + self, + *, + active_directory: "_models.ActiveDirectoryConnectorDomainDetails", + dns: "_models.ActiveDirectoryConnectorDNSDetails", + ) -> 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 ActiveDirectoryConnectorStatus(_Model): + """The status of the Kubernetes custom resource. + + :ivar last_update_time: The time that the custom resource was last updated. + :vartype last_update_time: str + :ivar observed_generation: The version of the replicaSet associated with the AD connector + custom resource. + :vartype observed_generation: int + :ivar state: The state of the AD connector custom resource. + :vartype state: str + """ + + last_update_time: Optional[str] = rest_field( + name="lastUpdateTime", visibility=["read", "create", "update", "delete", "query"] + ) + """The time that the custom resource was last updated.""" + observed_generation: Optional[int] = rest_field( + name="observedGeneration", visibility=["read", "create", "update", "delete", "query"] + ) + """The version of the replicaSet associated with the AD connector custom resource.""" + state: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The state of the AD connector custom resource.""" + + @overload + def __init__( + self, + *, + last_update_time: Optional[str] = None, + observed_generation: Optional[int] = None, + state: 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 ActiveDirectoryDomainController(_Model): + """Information about a domain controller in the AD domain. + + :ivar hostname: Fully-qualified domain name of a domain controller in the AD domain. Required. + :vartype hostname: str + """ + + hostname: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully-qualified domain name of a domain controller in the AD domain. Required.""" + + @overload + def __init__( + self, + *, + hostname: str, + ) -> 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 ActiveDirectoryDomainControllers(_Model): + """Details about the Active Directory domain controllers associated with this AD connector + instance. + + :ivar primary_domain_controller: Information about the Primary Domain Controller (PDC) in the + AD domain. + :vartype primary_domain_controller: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController + :ivar secondary_domain_controllers: null. + :vartype secondary_domain_controllers: + list[~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController] + """ + + primary_domain_controller: Optional["_models.ActiveDirectoryDomainController"] = rest_field( + name="primaryDomainController", visibility=["read", "create", "update", "delete", "query"] + ) + """Information about the Primary Domain Controller (PDC) in the AD domain.""" + secondary_domain_controllers: Optional[list["_models.ActiveDirectoryDomainController"]] = rest_field( + name="secondaryDomainControllers", visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + primary_domain_controller: Optional["_models.ActiveDirectoryDomainController"] = None, + secondary_domain_controllers: Optional[list["_models.ActiveDirectoryDomainController"]] = 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 ActiveDirectoryInformation(_Model): + """Active Directory information that related to the resource. + + :ivar keytab_information: Keytab information that is used for the Sql Managed Instance when + Active Directory authentication is used. + :vartype keytab_information: ~azure.mgmt.azurearcdata.models.KeytabInformation + """ + + keytab_information: Optional["_models.KeytabInformation"] = rest_field( + name="keytabInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Keytab information that is used for the Sql Managed Instance when Active Directory + authentication is used.""" + + @overload + def __init__( + self, + *, + keytab_information: Optional["_models.KeytabInformation"] = 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 AdditionalMigrationJobAttributes(_Model): + """Any other migration type specific attributes to associate with this job. + + :ivar key_name: Unique attribute name. + :vartype key_name: str + :ivar key_value: Attribute value. + :vartype key_value: str + """ + + key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) + """Unique attribute name.""" + key_value: Optional[str] = rest_field(name="keyValue", visibility=["read", "create", "update", "delete", "query"]) + """Attribute value.""" + + @overload + def __init__( + self, + *, + key_name: Optional[str] = None, + key_value: 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 Authentication(_Model): + """Authentication related configuration for the SQL Server Instance. + + :ivar mode: Mode of authentication in SqlServer. Known values are: "Mixed", "Windows", and + "Undefined". + :vartype mode: str or ~azure.mgmt.azurearcdata.models.Mode + :ivar sql_server_entra_identity: Entra Authentication configuration for the SQL Server + Instance. + :vartype sql_server_entra_identity: list[~azure.mgmt.azurearcdata.models.EntraAuthentication] + """ + + mode: Optional[Union[str, "_models.Mode"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Mode of authentication in SqlServer. Known values are: \"Mixed\", \"Windows\", and + \"Undefined\".""" + sql_server_entra_identity: Optional[list["_models.EntraAuthentication"]] = rest_field( + name="sqlServerEntraIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """Entra Authentication configuration for the SQL Server Instance.""" + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, "_models.Mode"]] = None, + sql_server_entra_identity: Optional[list["_models.EntraAuthentication"]] = 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 AvailabilityGroupConfigure(_Model): + """The specifications of the availability group replica configuration. + + :ivar endpoint_name: Name of the mirroring endpoint URL. + :vartype endpoint_name: str + :ivar endpoint_url: Mirroring endpoint URL of availability group replica. + :vartype endpoint_url: str + :ivar endpoint_authentication_mode: Permitted authentication modes for the mirroring endpoint. + Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", "Certificate", + "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", "Windows_Negotiate_Certificate", + "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", and + "Certificate_Windows_Negotiate". + :vartype endpoint_authentication_mode: str or ~azure.mgmt.azurearcdata.models.ConnectionAuth + :ivar certificate_name: Name of certificate to use for authentication. Required if any + CERTIFICATE authentication modes are specified. + :vartype certificate_name: str + :ivar endpoint_connect_login: The login which will connect to the mirroring endpoint. + :vartype endpoint_connect_login: str + :ivar availability_mode: Property that determines whether a given availability replica can run + in synchronous-commit mode. Known values are: "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityMode + :ivar availability_mode_description: The Availability Synchronization mode of the availability + group replica. + :vartype availability_mode_description: str + :ivar failover_mode: Property to set the failover mode of the availability group replica. Known + values are: "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerFailoverMode + :ivar failover_mode_description: The failover mode of the availability group replica. + :vartype failover_mode_description: str + :ivar session_timeout: The time-out period of availability group session replica, in seconds. + :vartype session_timeout: int + :ivar primary_allow_connections: Whether the primary replica should allow all connections or + only READ_WRITE connections (disallowing ReadOnly connections). Known values are: "ALL" and + "READ_WRITE". + :vartype primary_allow_connections: str or + ~azure.mgmt.azurearcdata.models.PrimaryAllowConnections + :ivar primary_role_allow_connections_description: Whether the availability allows all + connections or only read-write connections. + :vartype primary_role_allow_connections_description: str + :ivar secondary_allow_connections: Whether the secondary replica should allow all connections, + no connections, or only ReadOnly connections. Known values are: "NO", "ALL", and "READ_ONLY". + :vartype secondary_allow_connections: str or + ~azure.mgmt.azurearcdata.models.SecondaryAllowConnections + :ivar secondary_role_allow_connections_description: Whether an availability replica that is + performing the secondary role (that is, a secondary replica) can accept connections from + clients. + :vartype secondary_role_allow_connections_description: str + :ivar replica_create_date: Date that the replica was created. + :vartype replica_create_date: ~datetime.datetime + :ivar replica_modify_date: Date that the replica was modified. + :vartype replica_modify_date: ~datetime.datetime + :ivar backup_priority: Represents the user-specified priority for performing backups on this + replica relative to the other replicas in the same availability group. + :vartype backup_priority: int + :ivar read_only_routing_url: Connectivity endpoint (URL) of the read only availability replica. + :vartype read_only_routing_url: str + :ivar read_write_routing_url: Connectivity endpoint (URL) of the read write availability + replica. + :vartype read_write_routing_url: str + :ivar seeding_mode: Specifies how the secondary replica will be initially seeded. AUTOMATIC + enables direct seeding. This method will seed the secondary replica over the network. This + method does not require you to backup and restore a copy of the primary database on the + replica. MANUAL specifies manual seeding (default). This method requires you to create a backup + of the database on the primary replica and manually restore that backup on the secondary + replica. Known values are: "AUTOMATIC" and "MANUAL". + :vartype seeding_mode: str or ~azure.mgmt.azurearcdata.models.SeedingMode + :ivar seeding_mode_description: Describes seeding mode. + :vartype seeding_mode_description: str + """ + + endpoint_name: Optional[str] = rest_field( + name="endpointName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the mirroring endpoint URL.""" + endpoint_url: Optional[str] = rest_field( + name="endpointUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Mirroring endpoint URL of availability group replica.""" + endpoint_authentication_mode: Optional[Union[str, "_models.ConnectionAuth"]] = rest_field( + name="endpointAuthenticationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Permitted authentication modes for the mirroring endpoint. Known values are: \"Windows_NTLM\", + \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", \"Windows_NTLM_Certificate\", + \"Windows_Kerberos_Certificate\", \"Windows_Negotiate_Certificate\", + \"Certificate_Windows_NTLM\", \"Certificate_Windows_Kerberos\", and + \"Certificate_Windows_Negotiate\".""" + certificate_name: Optional[str] = rest_field( + name="certificateName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of certificate to use for authentication. Required if any CERTIFICATE authentication modes + are specified.""" + endpoint_connect_login: Optional[str] = rest_field( + name="endpointConnectLogin", visibility=["read", "create", "update", "delete", "query"] + ) + """The login which will connect to the mirroring endpoint.""" + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = rest_field( + name="availabilityMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Property that determines whether a given availability replica can run in synchronous-commit + mode. Known values are: \"SYNCHRONOUS_COMMIT\" and \"ASYNCHRONOUS_COMMIT\".""" + availability_mode_description: Optional[str] = rest_field(name="availabilityModeDescription", visibility=["read"]) + """The Availability Synchronization mode of the availability group replica.""" + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = rest_field( + name="failoverMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Property to set the failover mode of the availability group replica. Known values are: + \"AUTOMATIC\", \"MANUAL\", \"EXTERNAL\", and \"NONE\".""" + failover_mode_description: Optional[str] = rest_field(name="failoverModeDescription", visibility=["read"]) + """The failover mode of the availability group replica.""" + session_timeout: Optional[int] = rest_field( + name="sessionTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """The time-out period of availability group session replica, in seconds.""" + primary_allow_connections: Optional[Union[str, "_models.PrimaryAllowConnections"]] = rest_field( + name="primaryAllowConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the primary replica should allow all connections or only READ_WRITE connections + (disallowing ReadOnly connections). Known values are: \"ALL\" and \"READ_WRITE\".""" + primary_role_allow_connections_description: Optional[str] = rest_field( + name="primaryRoleAllowConnectionsDescription", visibility=["read"] + ) + """Whether the availability allows all connections or only read-write connections.""" + secondary_allow_connections: Optional[Union[str, "_models.SecondaryAllowConnections"]] = rest_field( + name="secondaryAllowConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the secondary replica should allow all connections, no connections, or only ReadOnly + connections. Known values are: \"NO\", \"ALL\", and \"READ_ONLY\".""" + secondary_role_allow_connections_description: Optional[str] = rest_field( + name="secondaryRoleAllowConnectionsDescription", visibility=["read"] + ) + """Whether an availability replica that is performing the secondary role (that is, a secondary + replica) can accept connections from clients.""" + replica_create_date: Optional[datetime.datetime] = rest_field( + name="replicaCreateDate", visibility=["read"], format="rfc3339" + ) + """Date that the replica was created.""" + replica_modify_date: Optional[datetime.datetime] = rest_field( + name="replicaModifyDate", visibility=["read"], format="rfc3339" + ) + """Date that the replica was modified.""" + backup_priority: Optional[int] = rest_field( + name="backupPriority", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the user-specified priority for performing backups on this replica relative to the + other replicas in the same availability group.""" + read_only_routing_url: Optional[str] = rest_field( + name="readOnlyRoutingUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Connectivity endpoint (URL) of the read only availability replica.""" + read_write_routing_url: Optional[str] = rest_field( + name="readWriteRoutingUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Connectivity endpoint (URL) of the read write availability replica.""" + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = rest_field( + name="seedingMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies how the secondary replica will be initially seeded. AUTOMATIC enables direct seeding. + This method will seed the secondary replica over the network. This method does not require you + to backup and restore a copy of the primary database on the replica. MANUAL specifies manual + seeding (default). This method requires you to create a backup of the database on the primary + replica and manually restore that backup on the secondary replica. Known values are: + \"AUTOMATIC\" and \"MANUAL\".""" + seeding_mode_description: Optional[str] = rest_field(name="seedingModeDescription", visibility=["read"]) + """Describes seeding mode.""" + + @overload + def __init__( + self, + *, + endpoint_name: Optional[str] = None, + endpoint_url: Optional[str] = None, + endpoint_authentication_mode: Optional[Union[str, "_models.ConnectionAuth"]] = None, + certificate_name: Optional[str] = None, + endpoint_connect_login: Optional[str] = None, + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = None, + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = None, + session_timeout: Optional[int] = None, + primary_allow_connections: Optional[Union[str, "_models.PrimaryAllowConnections"]] = None, + secondary_allow_connections: Optional[Union[str, "_models.SecondaryAllowConnections"]] = None, + backup_priority: Optional[int] = None, + read_only_routing_url: Optional[str] = None, + read_write_routing_url: Optional[str] = None, + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = 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 AvailabilityGroupCreateUpdateConfiguration(_Model): # pylint: disable=name-too-long + """Options used in creating an availability group. + + :ivar availability_group_name: Name of the availability group. + :vartype availability_group_name: str + :ivar replicas: List of availability group replicas. + :vartype replicas: + list[~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateReplicaConfiguration] + :ivar databases: List of databases to include in the availability group. + :vartype databases: list[str] + :ivar automated_backup_preference: Preferred replica for running automated backups. Known + values are: "PRIMARY", "SECONDARY_ONLY", "SECONDARY", and "NONE". + :vartype automated_backup_preference: str or + ~azure.mgmt.azurearcdata.models.AutomatedBackupPreference + :ivar failure_condition_level: User-defined failure condition level under which an automatic + failover must be triggered. Known values are: 1, 2, 3, 4, and 5. + :vartype failure_condition_level: int or ~azure.mgmt.azurearcdata.models.FailureConditionLevel + :ivar health_check_timeout: Wait time (in milliseconds) for the sp_server_diagnostics system + stored procedure to return server-health information, before the server instance is assumed to + be slow or not responding. + :vartype health_check_timeout: int + :ivar db_failover: Specifies whether the availability group supports failover for database + health conditions. Known values are: "ON" and "OFF". + :vartype db_failover: str or ~azure.mgmt.azurearcdata.models.DbFailover + :ivar dtc_support: Specifies whether DTC support has been enabled for this availability group. + Known values are: "PER_DB" and "NONE". + :vartype dtc_support: str or ~azure.mgmt.azurearcdata.models.DtcSupport + :ivar required_synchronized_secondaries_to_commit: The number of secondary replicas that must + be in a synchronized state for a commit to complete. + :vartype required_synchronized_secondaries_to_commit: int + :ivar cluster_type: Set to WSFC when availability group is on a failover cluster instance on a + Windows Server failover cluster. Set to NONE when availability group not using WSFC for cluster + coordination. Known values are: "WSFC" and "NONE". + :vartype cluster_type: str or ~azure.mgmt.azurearcdata.models.ClusterType + :ivar listener: The listener for the sql server availability group. + :vartype listener: + ~azure.mgmt.azurearcdata.models.SqlAvailabilityGroupStaticIPListenerProperties + """ + + availability_group_name: Optional[str] = rest_field( + name="availabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the availability group.""" + replicas: Optional[list["_models.AvailabilityGroupCreateUpdateReplicaConfiguration"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of availability group replicas.""" + databases: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of databases to include in the availability group.""" + automated_backup_preference: Optional[Union[str, "_models.AutomatedBackupPreference"]] = rest_field( + name="automatedBackupPreference", visibility=["read", "create", "update", "delete", "query"] + ) + """Preferred replica for running automated backups. Known values are: \"PRIMARY\", + \"SECONDARY_ONLY\", \"SECONDARY\", and \"NONE\".""" + failure_condition_level: Optional[Union[int, "_models.FailureConditionLevel"]] = rest_field( + name="failureConditionLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """User-defined failure condition level under which an automatic failover must be triggered. Known + values are: 1, 2, 3, 4, and 5.""" + health_check_timeout: Optional[int] = rest_field( + name="healthCheckTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """Wait time (in milliseconds) for the sp_server_diagnostics system stored procedure to return + server-health information, before the server instance is assumed to be slow or not responding.""" + db_failover: Optional[Union[str, "_models.DbFailover"]] = rest_field( + name="dbFailover", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the availability group supports failover for database health conditions. + Known values are: \"ON\" and \"OFF\".""" + dtc_support: Optional[Union[str, "_models.DtcSupport"]] = rest_field( + name="dtcSupport", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether DTC support has been enabled for this availability group. Known values are: + \"PER_DB\" and \"NONE\".""" + required_synchronized_secondaries_to_commit: Optional[int] = rest_field( + name="requiredSynchronizedSecondariesToCommit", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas that must be in a synchronized state for a commit to complete.""" + cluster_type: Optional[Union[str, "_models.ClusterType"]] = rest_field( + name="clusterType", visibility=["read", "create", "update", "delete", "query"] + ) + """Set to WSFC when availability group is on a failover cluster instance on a Windows Server + failover cluster. Set to NONE when availability group not using WSFC for cluster coordination. + Known values are: \"WSFC\" and \"NONE\".""" + listener: Optional["_models.SqlAvailabilityGroupStaticIPListenerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The listener for the sql server availability group.""" + + @overload + def __init__( + self, + *, + availability_group_name: Optional[str] = None, + replicas: Optional[list["_models.AvailabilityGroupCreateUpdateReplicaConfiguration"]] = None, + databases: Optional[list[str]] = None, + automated_backup_preference: Optional[Union[str, "_models.AutomatedBackupPreference"]] = None, + failure_condition_level: Optional[Union[int, "_models.FailureConditionLevel"]] = None, + health_check_timeout: Optional[int] = None, + db_failover: Optional[Union[str, "_models.DbFailover"]] = None, + dtc_support: Optional[Union[str, "_models.DtcSupport"]] = None, + required_synchronized_secondaries_to_commit: Optional[int] = None, + cluster_type: Optional[Union[str, "_models.ClusterType"]] = None, + listener: Optional["_models.SqlAvailabilityGroupStaticIPListenerProperties"] = 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 AvailabilityGroupCreateUpdateReplicaConfiguration(_Model): # pylint: disable=name-too-long + """The specifications of the availability group replica configuration. + + :ivar server_instance: the server instance hosting the replica. + :vartype server_instance: str + :ivar endpoint_name: Name of the database mirroring endpoint URL for the availability group + replica. + :vartype endpoint_name: str + :ivar endpoint_url: Database mirroring endpoint URL of availability group replica. + :vartype endpoint_url: str + :ivar endpoint_authentication_mode: Permitted authentication modes for the mirroring endpoint. + Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", "Certificate", + "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", "Windows_Negotiate_Certificate", + "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", and + "Certificate_Windows_Negotiate". + :vartype endpoint_authentication_mode: str or ~azure.mgmt.azurearcdata.models.ConnectionAuth + :ivar certificate_name: Name of certificate to use for authentication. Required if any + CERTIFICATE authentication modes are specified. + :vartype certificate_name: str + :ivar endpoint_connect_login: The login which will connect to the mirroring endpoint. + :vartype endpoint_connect_login: str + :ivar availability_mode: Property that determines whether a given availability replica can run + in synchronous-commit mode. Known values are: "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityMode + :ivar failover_mode: Property to set the failover mode of the availability group replica. Known + values are: "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerFailoverMode + :ivar seeding_mode: Specifies how the secondary replica will be initially seeded. AUTOMATIC + enables direct seeding. This method will seed the secondary replica over the network. This + method does not require you to backup and restore a copy of the primary database on the + replica. MANUAL specifies manual seeding (default). This method requires you to create a backup + of the database on the primary replica and manually restore that backup on the secondary + replica. Known values are: "AUTOMATIC" and "MANUAL". + :vartype seeding_mode: str or ~azure.mgmt.azurearcdata.models.SeedingMode + :ivar backup_priority: Represents the user-specified priority for performing backups on this + replica relative to the other replicas in the same availability group. + :vartype backup_priority: int + :ivar secondary_role_allow_connections: Whether the secondary replica should allow all + connections, no connections, or only ReadOnly connections. Known values are: "NO", "ALL", and + "READ_ONLY". + :vartype secondary_role_allow_connections: str or + ~azure.mgmt.azurearcdata.models.SecondaryAllowConnections + :ivar secondary_role_read_only_routing_url: Connectivity endpoint (URL) of the read only + availability replica. + :vartype secondary_role_read_only_routing_url: str + :ivar primary_role_allow_connections: Whether the primary replica should allow all connections + or only READ_WRITE connections (disallowing ReadOnly connections). Known values are: "ALL" and + "READ_WRITE". + :vartype primary_role_allow_connections: str or + ~azure.mgmt.azurearcdata.models.PrimaryAllowConnections + :ivar primary_role_read_only_routing_list: List of read only routing URLs. + :vartype primary_role_read_only_routing_list: list[str] + :ivar session_timeout: The time-out period of availability group session replica, in seconds. + :vartype session_timeout: int + """ + + server_instance: Optional[str] = rest_field( + name="serverInstance", visibility=["read", "create", "update", "delete", "query"] + ) + """the server instance hosting the replica.""" + endpoint_name: Optional[str] = rest_field( + name="endpointName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the database mirroring endpoint URL for the availability group replica.""" + endpoint_url: Optional[str] = rest_field( + name="endpointUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Database mirroring endpoint URL of availability group replica.""" + endpoint_authentication_mode: Optional[Union[str, "_models.ConnectionAuth"]] = rest_field( + name="endpointAuthenticationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Permitted authentication modes for the mirroring endpoint. Known values are: \"Windows_NTLM\", + \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", \"Windows_NTLM_Certificate\", + \"Windows_Kerberos_Certificate\", \"Windows_Negotiate_Certificate\", + \"Certificate_Windows_NTLM\", \"Certificate_Windows_Kerberos\", and + \"Certificate_Windows_Negotiate\".""" + certificate_name: Optional[str] = rest_field( + name="certificateName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of certificate to use for authentication. Required if any CERTIFICATE authentication modes + are specified.""" + endpoint_connect_login: Optional[str] = rest_field( + name="endpointConnectLogin", visibility=["read", "create", "update", "delete", "query"] + ) + """The login which will connect to the mirroring endpoint.""" + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = rest_field( + name="availabilityMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Property that determines whether a given availability replica can run in synchronous-commit + mode. Known values are: \"SYNCHRONOUS_COMMIT\" and \"ASYNCHRONOUS_COMMIT\".""" + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = rest_field( + name="failoverMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Property to set the failover mode of the availability group replica. Known values are: + \"AUTOMATIC\", \"MANUAL\", \"EXTERNAL\", and \"NONE\".""" + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = rest_field( + name="seedingMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies how the secondary replica will be initially seeded. AUTOMATIC enables direct seeding. + This method will seed the secondary replica over the network. This method does not require you + to backup and restore a copy of the primary database on the replica. MANUAL specifies manual + seeding (default). This method requires you to create a backup of the database on the primary + replica and manually restore that backup on the secondary replica. Known values are: + \"AUTOMATIC\" and \"MANUAL\".""" + backup_priority: Optional[int] = rest_field( + name="backupPriority", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the user-specified priority for performing backups on this replica relative to the + other replicas in the same availability group.""" + secondary_role_allow_connections: Optional[Union[str, "_models.SecondaryAllowConnections"]] = rest_field( + name="secondaryRoleAllowConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the secondary replica should allow all connections, no connections, or only ReadOnly + connections. Known values are: \"NO\", \"ALL\", and \"READ_ONLY\".""" + secondary_role_read_only_routing_url: Optional[str] = rest_field( + name="secondaryRoleReadOnlyRoutingUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Connectivity endpoint (URL) of the read only availability replica.""" + primary_role_allow_connections: Optional[Union[str, "_models.PrimaryAllowConnections"]] = rest_field( + name="primaryRoleAllowConnections", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the primary replica should allow all connections or only READ_WRITE connections + (disallowing ReadOnly connections). Known values are: \"ALL\" and \"READ_WRITE\".""" + primary_role_read_only_routing_list: Optional[list[str]] = rest_field( + name="primaryRoleReadOnlyRoutingList", visibility=["read", "create", "update", "delete", "query"] + ) + """List of read only routing URLs.""" + session_timeout: Optional[int] = rest_field( + name="sessionTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """The time-out period of availability group session replica, in seconds.""" + + @overload + def __init__( + self, + *, + server_instance: Optional[str] = None, + endpoint_name: Optional[str] = None, + endpoint_url: Optional[str] = None, + endpoint_authentication_mode: Optional[Union[str, "_models.ConnectionAuth"]] = None, + certificate_name: Optional[str] = None, + endpoint_connect_login: Optional[str] = None, + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = None, + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = None, + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = None, + backup_priority: Optional[int] = None, + secondary_role_allow_connections: Optional[Union[str, "_models.SecondaryAllowConnections"]] = None, + secondary_role_read_only_routing_url: Optional[str] = None, + primary_role_allow_connections: Optional[Union[str, "_models.PrimaryAllowConnections"]] = None, + primary_role_read_only_routing_list: Optional[list[str]] = None, + session_timeout: Optional[int] = 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 AvailabilityGroupInfo(_Model): + """The specifications of the availability group state. + + :ivar failure_condition_level: User-defined failure condition level under which an automatic + failover must be triggered. + :vartype failure_condition_level: int + :ivar health_check_timeout: Wait time (in milliseconds) for the sp_server_diagnostics system + stored procedure to return server-health information, before the server instance is assumed to + be slow or not responding. + :vartype health_check_timeout: int + :ivar automated_backup_preference_description: Preferred location for performing backups on the + availability databases in this availability group. + :vartype automated_backup_preference_description: str + :ivar version: SQL Server availability group current version. + :vartype version: int + :ivar basic_features: Specifies whether this is a basic availability group. + :vartype basic_features: bool + :ivar dtc_support: Specifies whether DTC support has been enabled for this availability group. + :vartype dtc_support: bool + :ivar db_failover: Specifies whether the availability group supports failover for database + health conditions. + :vartype db_failover: bool + :ivar is_distributed: Specifies whether this is a distributed availability group. + :vartype is_distributed: bool + :ivar cluster_type_description: SQL Server availability group cluster type description. + :vartype cluster_type_description: str + :ivar required_synchronized_secondaries_to_commit: The number of secondary replicas that must + be in a synchronized state for a commit to complete. + :vartype required_synchronized_secondaries_to_commit: int + :ivar is_contained: SQL Server availability group contained system databases. + :vartype is_contained: bool + :ivar primary_replica: Name of the server instance that is hosting the current primary replica. + :vartype primary_replica: str + :ivar primary_recovery_health_description: Indicates the recovery health of the primary + replica. + :vartype primary_recovery_health_description: str + :ivar secondary_recovery_health_description: Indicates the recovery health of a secondary + replica. + :vartype secondary_recovery_health_description: str + :ivar synchronization_health_description: Reflects a roll-up of the synchronization health of + all availability replicas in the availability group. + :vartype synchronization_health_description: str + :ivar replication_partner_type: Known values are: "SQLServer", "AzureSQLVM", + "AzureSQLManagedInstance", and "Unknown". + :vartype replication_partner_type: str or + ~azure.mgmt.azurearcdata.models.ReplicationPartnerType + :ivar listener: The listener for the sql server availability group. + :vartype listener: + ~azure.mgmt.azurearcdata.models.SqlAvailabilityGroupStaticIPListenerProperties + """ + + failure_condition_level: Optional[int] = rest_field( + name="failureConditionLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """User-defined failure condition level under which an automatic failover must be triggered.""" + health_check_timeout: Optional[int] = rest_field( + name="healthCheckTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """Wait time (in milliseconds) for the sp_server_diagnostics system stored procedure to return + server-health information, before the server instance is assumed to be slow or not responding.""" + automated_backup_preference_description: Optional[str] = rest_field( + name="automatedBackupPreferenceDescription", visibility=["read"] + ) + """Preferred location for performing backups on the availability databases in this availability + group.""" + version: Optional[int] = rest_field(visibility=["read"]) + """SQL Server availability group current version.""" + basic_features: Optional[bool] = rest_field( + name="basicFeatures", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether this is a basic availability group.""" + dtc_support: Optional[bool] = rest_field( + name="dtcSupport", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether DTC support has been enabled for this availability group.""" + db_failover: Optional[bool] = rest_field( + name="dbFailover", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether the availability group supports failover for database health conditions.""" + is_distributed: Optional[bool] = rest_field( + name="isDistributed", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether this is a distributed availability group.""" + cluster_type_description: Optional[str] = rest_field(name="clusterTypeDescription", visibility=["read"]) + """SQL Server availability group cluster type description.""" + required_synchronized_secondaries_to_commit: Optional[int] = rest_field( + name="requiredSynchronizedSecondariesToCommit", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas that must be in a synchronized state for a commit to complete.""" + is_contained: Optional[bool] = rest_field( + name="isContained", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server availability group contained system databases.""" + primary_replica: Optional[str] = rest_field(name="primaryReplica", visibility=["read"]) + """Name of the server instance that is hosting the current primary replica.""" + primary_recovery_health_description: Optional[str] = rest_field( + name="primaryRecoveryHealthDescription", visibility=["read"] + ) + """Indicates the recovery health of the primary replica.""" + secondary_recovery_health_description: Optional[str] = rest_field( + name="secondaryRecoveryHealthDescription", visibility=["read"] + ) + """Indicates the recovery health of a secondary replica.""" + synchronization_health_description: Optional[str] = rest_field( + name="synchronizationHealthDescription", visibility=["read"] + ) + """Reflects a roll-up of the synchronization health of all availability replicas in the + availability group.""" + replication_partner_type: Optional[Union[str, "_models.ReplicationPartnerType"]] = rest_field( + name="replicationPartnerType", visibility=["read"] + ) + """Known values are: \"SQLServer\", \"AzureSQLVM\", \"AzureSQLManagedInstance\", and \"Unknown\".""" + listener: Optional["_models.SqlAvailabilityGroupStaticIPListenerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The listener for the sql server availability group.""" + + @overload + def __init__( + self, + *, + failure_condition_level: Optional[int] = None, + health_check_timeout: Optional[int] = None, + basic_features: Optional[bool] = None, + dtc_support: Optional[bool] = None, + db_failover: Optional[bool] = None, + is_distributed: Optional[bool] = None, + required_synchronized_secondaries_to_commit: Optional[int] = None, + is_contained: Optional[bool] = None, + listener: Optional["_models.SqlAvailabilityGroupStaticIPListenerProperties"] = 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 AvailabilityGroupRetrievalFilters(_Model): + """AvailabilityGroupRetrievalFilters. + + :ivar availability_group_type_filter: Filter retrieval based on availability group type. Known + values are: "CONTAINED", "DISTRIBUTED", and "DEFAULT". + :vartype availability_group_type_filter: str or + ~azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityGroupTypeFilter + :ivar replication_partner_type_filter: Known values are: "SQLServer", "AzureSQLVM", + "AzureSQLManagedInstance", and "Unknown". + :vartype replication_partner_type_filter: str or + ~azure.mgmt.azurearcdata.models.ReplicationPartnerType + """ + + availability_group_type_filter: Optional[Union[str, "_models.ArcSqlServerAvailabilityGroupTypeFilter"]] = ( + rest_field(name="availabilityGroupTypeFilter", visibility=["read", "create", "update", "delete", "query"]) + ) + """Filter retrieval based on availability group type. Known values are: \"CONTAINED\", + \"DISTRIBUTED\", and \"DEFAULT\".""" + replication_partner_type_filter: Optional[Union[str, "_models.ReplicationPartnerType"]] = rest_field( + name="replicationPartnerTypeFilter", visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"SQLServer\", \"AzureSQLVM\", \"AzureSQLManagedInstance\", and \"Unknown\".""" + + @overload + def __init__( + self, + *, + availability_group_type_filter: Optional[Union[str, "_models.ArcSqlServerAvailabilityGroupTypeFilter"]] = None, + replication_partner_type_filter: Optional[Union[str, "_models.ReplicationPartnerType"]] = 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 AvailabilityGroupState(_Model): + """The specifications of the availability group state. + + :ivar availability_group_replica_role: Current Always On availability groups role of the + availability group replica. + :vartype availability_group_replica_role: str + :ivar operational_state_description: Current operational state of the availability group + replica. + :vartype operational_state_description: str + :ivar recovery_health_description: Recovery health of the availability group replica. + :vartype recovery_health_description: str + :ivar synchronization_health_description: Reflects a rollup of the database synchronization + state (synchronization_state) of all joined availability databases (also known as replicas) and + the availability mode of the replica (synchronous-commit or asynchronous-commit mode). The + rollup will reflect the least healthy accumulated state the databases on the replica. + :vartype synchronization_health_description: str + :ivar connected_state_description: Whether a secondary replica is currently connected to the + primary replica. + :vartype connected_state_description: str + :ivar last_connect_error_description: Text description of the last connection error of the + availability group replica. + :vartype last_connect_error_description: str + :ivar last_connect_error_timestamp: Date and time timestamp indicating when the last connect + error occurred. + :vartype last_connect_error_timestamp: ~datetime.datetime + """ + + availability_group_replica_role: Optional[str] = rest_field( + name="availabilityGroupReplicaRole", visibility=["read"] + ) + """Current Always On availability groups role of the availability group replica.""" + operational_state_description: Optional[str] = rest_field(name="operationalStateDescription", visibility=["read"]) + """Current operational state of the availability group replica.""" + recovery_health_description: Optional[str] = rest_field(name="recoveryHealthDescription", visibility=["read"]) + """Recovery health of the availability group replica.""" + synchronization_health_description: Optional[str] = rest_field( + name="synchronizationHealthDescription", visibility=["read"] + ) + """Reflects a rollup of the database synchronization state (synchronization_state) of all joined + availability databases (also known as replicas) and the availability mode of the replica + (synchronous-commit or asynchronous-commit mode). The rollup will reflect the least healthy + accumulated state the databases on the replica.""" + connected_state_description: Optional[str] = rest_field(name="connectedStateDescription", visibility=["read"]) + """Whether a secondary replica is currently connected to the primary replica.""" + last_connect_error_description: Optional[str] = rest_field(name="lastConnectErrorDescription", visibility=["read"]) + """Text description of the last connection error of the availability group replica.""" + last_connect_error_timestamp: Optional[datetime.datetime] = rest_field( + name="lastConnectErrorTimestamp", visibility=["read"], format="rfc3339" + ) + """Date and time timestamp indicating when the last connect error occurred.""" + + +class BackgroundJob(_Model): + """The background job details. + + :ivar state: The state of the background job. Known values are: "Inactive", "Active", + "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", and "Suspended". + :vartype state: str or ~azure.mgmt.azurearcdata.models.State + :ivar execution_state: The execution state of the background job. Known values are: "Waiting" + and "Running". + :vartype execution_state: str or ~azure.mgmt.azurearcdata.models.ExecutionState + :ivar start_time: The start time of the background job. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the background job. + :vartype end_time: ~datetime.datetime + :ivar last_execution_status: The last execution status of the background job. Known values are: + "Succeeded", "Completed", "Failed", "Faulted", "Postponed", and "Rescheduled". + :vartype last_execution_status: str or ~azure.mgmt.azurearcdata.models.LastExecutionStatus + :ivar last_execution_time: The last execution time of the background job in ISO 8601 date-time + format. + :vartype last_execution_time: ~datetime.datetime + :ivar next_execution_time: The next execution time of the background job in ISO 8601 date-time + format. + :vartype next_execution_time: ~datetime.datetime + """ + + state: Optional[Union[str, "_models.State"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The state of the background job. Known values are: \"Inactive\", \"Active\", \"Terminated\", + \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and \"Suspended\".""" + execution_state: Optional[Union[str, "_models.ExecutionState"]] = rest_field( + name="executionState", visibility=["read", "create", "update", "delete", "query"] + ) + """The execution state of the background job. Known values are: \"Waiting\" and \"Running\".""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the background job.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the background job.""" + last_execution_status: Optional[Union[str, "_models.LastExecutionStatus"]] = rest_field( + name="lastExecutionStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The last execution status of the background job. Known values are: \"Succeeded\", + \"Completed\", \"Failed\", \"Faulted\", \"Postponed\", and \"Rescheduled\".""" + last_execution_time: Optional[datetime.datetime] = rest_field( + name="lastExecutionTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The last execution time of the background job in ISO 8601 date-time format.""" + next_execution_time: Optional[datetime.datetime] = rest_field( + name="nextExecutionTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The next execution time of the background job in ISO 8601 date-time format.""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.State"]] = None, + execution_state: Optional[Union[str, "_models.ExecutionState"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + last_execution_status: Optional[Union[str, "_models.LastExecutionStatus"]] = None, + last_execution_time: Optional[datetime.datetime] = None, + next_execution_time: Optional[datetime.datetime] = 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 BackupPolicy(_Model): + """The backup profile for the SQL server. + + :ivar retention_period_days: The retention period for all the databases in this managed + instance. + :vartype retention_period_days: int + :ivar full_backup_days: The value indicating days between full backups. + :vartype full_backup_days: int + :ivar differential_backup_hours: The differential backup interval in hours. Known values are: + 12 and 24. + :vartype differential_backup_hours: int or + ~azure.mgmt.azurearcdata.models.DifferentialBackupHours + :ivar transaction_log_backup_minutes: The value indicating minutes between transaction log + backups. + :vartype transaction_log_backup_minutes: int + """ + + retention_period_days: Optional[int] = rest_field( + name="retentionPeriodDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The retention period for all the databases in this managed instance.""" + full_backup_days: Optional[int] = rest_field( + name="fullBackupDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The value indicating days between full backups.""" + differential_backup_hours: Optional[Union[int, "_models.DifferentialBackupHours"]] = rest_field( + name="differentialBackupHours", visibility=["read", "create", "update", "delete", "query"] + ) + """The differential backup interval in hours. Known values are: 12 and 24.""" + transaction_log_backup_minutes: Optional[int] = rest_field( + name="transactionLogBackupMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The value indicating minutes between transaction log backups.""" + + @overload + def __init__( + self, + *, + retention_period_days: Optional[int] = None, + full_backup_days: Optional[int] = None, + differential_backup_hours: Optional[Union[int, "_models.DifferentialBackupHours"]] = None, + transaction_log_backup_minutes: Optional[int] = 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 BasicLoginInformation(_Model): + """Username and password for basic login authentication. + + :ivar username: Login username. + :vartype username: str + :ivar password: Login password. + :vartype password: str + """ + + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Login username.""" + password: Optional[str] = rest_field(visibility=["create", "update"]) + """Login password.""" + + @overload + def __init__( + self, + *, + username: Optional[str] = None, + password: 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 BestPracticesAssessment(_Model): + """The configuration related to SQL best practices assessment. + + :ivar enabled: Indicates if SQL best practices assessment is enabled for the SQL Server + instance. + :vartype enabled: bool + :ivar schedule: The scheduling configuration. + :vartype schedule: ~azure.mgmt.azurearcdata.models.Schedule + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if SQL best practices assessment is enabled for the SQL Server instance.""" + schedule: Optional["_models.Schedule"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The scheduling configuration.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + schedule: Optional["_models.Schedule"] = 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 ClientConnection(_Model): + """Client connection related configuration. + + :ivar enabled: Indicates if client connection is enabled for this SQL Server instance. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if client connection is enabled for this SQL Server instance.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = 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 CommonSku(_Model): + """The resource model definition representing SKU for ARM resources. + + :ivar name: The name of the SKU. It is typically a letter+number code. Required. + :vartype name: str + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU. It is typically a letter+number code. Required.""" + dev: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether dev/test is enabled. When the dev field is set to true, the resource is used for + dev/test purpose.""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + @overload + def __init__( + self, + *, + name: str, + dev: Optional[bool] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = 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 CostOptionSelectedValues(_Model): + """Cost option value for the different cost factors selected. + + :ivar compute_and_storage_cost_option: selected cost saving option e.g. With1YearASPAndDevTest. + :vartype compute_and_storage_cost_option: str + :ivar sql_license_cost_option: With Azure Hybrid Benefit(AHB) or not for SQL. + :vartype sql_license_cost_option: str + :ivar windows_license_cost_option: With Azure Hybrid Benefit(AHB) or not for Windows. + :vartype windows_license_cost_option: str + """ + + compute_and_storage_cost_option: Optional[str] = rest_field( + name="computeAndStorageCostOption", visibility=["read", "create", "update", "delete", "query"] + ) + """selected cost saving option e.g. With1YearASPAndDevTest.""" + sql_license_cost_option: Optional[str] = rest_field( + name="sqlLicenseCostOption", visibility=["read", "create", "update", "delete", "query"] + ) + """With Azure Hybrid Benefit(AHB) or not for SQL.""" + windows_license_cost_option: Optional[str] = rest_field( + name="windowsLicenseCostOption", visibility=["read", "create", "update", "delete", "query"] + ) + """With Azure Hybrid Benefit(AHB) or not for Windows.""" + + @overload + def __init__( + self, + *, + compute_and_storage_cost_option: Optional[str] = None, + sql_license_cost_option: Optional[str] = None, + windows_license_cost_option: 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 CostTypeValues(_Model): + """The Monthly cost of the particular SKU. + + :ivar compute_cost: Represents the Cost of Compute. + :vartype compute_cost: float + :ivar storage_cost: Represents the Cost of Storage. + :vartype storage_cost: float + :ivar iops_cost: Represents the Cost of IOPS. + :vartype iops_cost: float + """ + + compute_cost: Optional[float] = rest_field( + name="computeCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of Compute.""" + storage_cost: Optional[float] = rest_field( + name="storageCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of Storage.""" + iops_cost: Optional[float] = rest_field(name="iopsCost", visibility=["read", "create", "update", "delete", "query"]) + """Represents the Cost of IOPS.""" + + @overload + def __init__( + self, + *, + compute_cost: Optional[float] = None, + storage_cost: Optional[float] = None, + iops_cost: 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 CronTrigger(_Model): + """The cron trigger configuration. + + :ivar start_time: Indicates the start time for the trigger. The default value is the time at + which the trigger was created. + :vartype start_time: str + :ivar time_zone: The time zone in which the trigger is scheduled. + :vartype time_zone: str + :ivar expression: A cron string representing a CronTab expression. A crontab expression is a + very compact way to express a recurring schedule with the following format: '{minutes} {hours} + {days} {months} {days-of-week}'. + :vartype expression: str + """ + + start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """Indicates the start time for the trigger. The default value is the time at which the trigger + was created.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """The time zone in which the trigger is scheduled.""" + expression: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A cron string representing a CronTab expression. A crontab expression is a very compact way to + express a recurring schedule with the following format: '{minutes} {hours} {days} {months} + {days-of-week}'.""" + + @overload + def __init__( + self, + *, + start_time: Optional[str] = None, + time_zone: Optional[str] = None, + expression: 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 DatabaseAssessmentsItem(_Model): + """DatabaseAssessmentsItem. + + :ivar applies_to_migration_target_platform: + :vartype applies_to_migration_target_platform: str + :ivar feature_id: + :vartype feature_id: str + :ivar issue_category: + :vartype issue_category: str + :ivar more_information: + :vartype more_information: str + """ + + applies_to_migration_target_platform: Optional[str] = rest_field( + name="appliesToMigrationTargetPlatform", visibility=["read", "create", "update", "delete", "query"] + ) + feature_id: Optional[str] = rest_field(name="featureId", visibility=["read", "create", "update", "delete", "query"]) + issue_category: Optional[str] = rest_field( + name="issueCategory", visibility=["read", "create", "update", "delete", "query"] + ) + more_information: Optional[str] = rest_field( + name="moreInformation", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + applies_to_migration_target_platform: Optional[str] = None, + feature_id: Optional[str] = None, + issue_category: Optional[str] = None, + more_information: 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 DataBaseMigration(_Model): + """Migration related configuration. + + :ivar assessment: Migration assessments related configuration. + :vartype assessment: ~azure.mgmt.azurearcdata.models.DataBaseMigrationAssessment + :ivar jobs: Migration jobs/actual data movement/data migrations associated with this database + related information. + :vartype jobs: list[~azure.mgmt.azurearcdata.models.DatabaseMigrationJobsItem] + """ + + assessment: Optional["_models.DataBaseMigrationAssessment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Migration assessments related configuration.""" + jobs: Optional[list["_models.DatabaseMigrationJobsItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Migration jobs/actual data movement/data migrations associated with this database related + information.""" + + @overload + def __init__( + self, + *, + assessment: Optional["_models.DataBaseMigrationAssessment"] = None, + jobs: Optional[list["_models.DatabaseMigrationJobsItem"]] = 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 DataBaseMigrationAssessment(_Model): + """The migration assessment related configuration. + + :ivar assessment_upload_time: The time when Migration Assessment Report upload was last + performed. + :vartype assessment_upload_time: ~datetime.datetime + :ivar target_recommendation_generation_time: The UTC timestamp in ISO 8601 format indicating + when the latest target recommendations were generated for this database. This value is set as + part of a successful RunTargetRecommendation job and is independent of when the migration + readiness results were uploaded (assessmentUploadTime). + :vartype target_recommendation_generation_time: ~datetime.datetime + :ivar database_assessments: Issues and warnings impacting the migration of Database to + particular Azure Migration Target. + :vartype database_assessments: list[~azure.mgmt.azurearcdata.models.DatabaseAssessmentsItem] + :ivar target_readiness: The target readiness for migration for this database. + :vartype target_readiness: ~azure.mgmt.azurearcdata.models.TargetReadiness + """ + + assessment_upload_time: Optional[datetime.datetime] = rest_field( + name="assessmentUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when Migration Assessment Report upload was last performed.""" + target_recommendation_generation_time: Optional[datetime.datetime] = rest_field( + name="targetRecommendationGenerationTime", visibility=["read"], format="rfc3339" + ) + """The UTC timestamp in ISO 8601 format indicating when the latest target recommendations were + generated for this database. This value is set as part of a successful RunTargetRecommendation + job and is independent of when the migration readiness results were uploaded + (assessmentUploadTime).""" + database_assessments: Optional[list["_models.DatabaseAssessmentsItem"]] = rest_field( + name="databaseAssessments", visibility=["read"] + ) + """Issues and warnings impacting the migration of Database to particular Azure Migration Target.""" + target_readiness: Optional["_models.TargetReadiness"] = rest_field(name="targetReadiness", visibility=["read"]) + """The target readiness for migration for this database.""" + + +class DatabaseMigrationJobsItem(_Model): + """DatabaseMigrationJobsItem. + + :ivar migration_tracking_id: Reference identifier for tracking purposes/optional link to system + initiating this migration. e.g. Arc MI link job id, DMS resource id. + :vartype migration_tracking_id: str + :ivar migration_mode: Mode/type of migration. Known values are: "LogShipping", "MILink", + "Logical", "Other", and "Unknown". + :vartype migration_mode: str or ~azure.mgmt.azurearcdata.models.MigrationMode + :ivar initiated_from: To indicate the client from which the migration is initiated from e.g. + Azure Arc, DMS-Azure Portal/PS/CLI for additional tracking. Known values are: "Azure Arc", + "ADS", "SSMS", "SSMA", "DMS-Portal", "DMS-PS", "DMS-CLI", "DMS-SDK", and "Other". + :vartype initiated_from: str or ~azure.mgmt.azurearcdata.models.InitiatedFrom + :ivar status: Status of the migration job. Known values are: "NotStarted", "InProgress", + "InProgressWithWarnings", "Cancelled", "Failed", "Successful", and "Unknown". + :vartype status: str or ~azure.mgmt.azurearcdata.models.MigrationStatus + :ivar last_error: Last error if any associated with this migration job. + :vartype last_error: str + :ivar target_type: Type of target in Azure this database is being migrated to. Known values + are: "AzureSqlDatabase", "AzureSqlManagedInstance", and "AzureSqlVirtualMachine". + :vartype target_type: str or ~azure.mgmt.azurearcdata.models.TargetType + :ivar target_resource_id: Resource Id of the target SQL resource for this migration job. + :vartype target_resource_id: str + :ivar start_time: Time when migration job was started. + :vartype start_time: ~datetime.datetime + :ivar end_time: Time when migration job reached terminal state. + :vartype end_time: ~datetime.datetime + :ivar additional_attributes: + :vartype additional_attributes: + list[~azure.mgmt.azurearcdata.models.AdditionalMigrationJobAttributes] + """ + + migration_tracking_id: Optional[str] = rest_field( + name="migrationTrackingId", visibility=["read", "create", "update", "delete", "query"] + ) + """Reference identifier for tracking purposes/optional link to system initiating this migration. + e.g. Arc MI link job id, DMS resource id.""" + migration_mode: Optional[Union[str, "_models.MigrationMode"]] = rest_field( + name="migrationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Mode/type of migration. Known values are: \"LogShipping\", \"MILink\", \"Logical\", \"Other\", + and \"Unknown\".""" + initiated_from: Optional[Union[str, "_models.InitiatedFrom"]] = rest_field( + name="initiatedFrom", visibility=["read", "create", "update", "delete", "query"] + ) + """To indicate the client from which the migration is initiated from e.g. Azure Arc, DMS-Azure + Portal/PS/CLI for additional tracking. Known values are: \"Azure Arc\", \"ADS\", \"SSMS\", + \"SSMA\", \"DMS-Portal\", \"DMS-PS\", \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + status: Optional[Union[str, "_models.MigrationStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the migration job. Known values are: \"NotStarted\", \"InProgress\", + \"InProgressWithWarnings\", \"Cancelled\", \"Failed\", \"Successful\", and \"Unknown\".""" + last_error: Optional[str] = rest_field(name="lastError", visibility=["read", "create", "update", "delete", "query"]) + """Last error if any associated with this migration job.""" + target_type: Optional[Union[str, "_models.TargetType"]] = rest_field( + name="targetType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of target in Azure this database is being migrated to. Known values are: + \"AzureSqlDatabase\", \"AzureSqlManagedInstance\", and \"AzureSqlVirtualMachine\".""" + target_resource_id: Optional[str] = rest_field( + name="targetResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource Id of the target SQL resource for this migration job.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Time when migration job was started.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Time when migration job reached terminal state.""" + additional_attributes: Optional[list["_models.AdditionalMigrationJobAttributes"]] = rest_field( + name="additionalAttributes", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + migration_tracking_id: Optional[str] = None, + migration_mode: Optional[Union[str, "_models.MigrationMode"]] = None, + initiated_from: Optional[Union[str, "_models.InitiatedFrom"]] = None, + status: Optional[Union[str, "_models.MigrationStatus"]] = None, + last_error: Optional[str] = None, + target_type: Optional[Union[str, "_models.TargetType"]] = None, + target_resource_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + additional_attributes: Optional[list["_models.AdditionalMigrationJobAttributes"]] = 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 Databases(_Model): + """List of database names. + + :ivar values_property: List of database names. + :vartype values_property: list[str] + """ + + values_property: Optional[list[str]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """List of database names.""" + + @overload + def __init__( + self, + *, + values_property: Optional[list[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 DataControllerProperties(_Model): + """The data controller properties. + + :ivar infrastructure: The infrastructure the data controller is running on. Known values are: + "azure", "gcp", "aws", "alibaba", "onpremises", and "other". + :vartype infrastructure: str or ~azure.mgmt.azurearcdata.models.Infrastructure + :ivar on_premise_property: Properties from the Kubernetes data controller. + :vartype on_premise_property: ~azure.mgmt.azurearcdata.models.OnPremiseProperty + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: any + :ivar upload_watermark: Properties on upload watermark. Mostly timestamp for each upload data + type. + :vartype upload_watermark: ~azure.mgmt.azurearcdata.models.UploadWatermark + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: ~datetime.datetime + :ivar basic_login_information: Deprecated. Azure Arc Data Services data controller no longer + expose any endpoint. All traffic are exposed through Kubernetes native API. + :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar metrics_dashboard_credential: Login credential for metrics dashboard on the Kubernetes + cluster. + :vartype metrics_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar logs_dashboard_credential: Login credential for logs dashboard on the Kubernetes cluster. + :vartype logs_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar log_analytics_workspace_config: Log analytics workspace id and primary key. + :vartype log_analytics_workspace_config: + ~azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig + :ivar upload_service_principal: Deprecated. Service principal is deprecated in favor of Arc + Kubernetes service extension managed identity. + :vartype upload_service_principal: ~azure.mgmt.azurearcdata.models.UploadServicePrincipal + :ivar provisioning_state: The provisioning state of the Arc Data Controller resource. + :vartype provisioning_state: str + :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :vartype cluster_id: str + :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :vartype extension_id: str + """ + + infrastructure: Optional[Union[str, "_models.Infrastructure"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The infrastructure the data controller is running on. Known values are: \"azure\", \"gcp\", + \"aws\", \"alibaba\", \"onpremises\", and \"other\".""" + on_premise_property: Optional["_models.OnPremiseProperty"] = rest_field( + name="onPremiseProperty", visibility=["read", "create", "update", "delete", "query"] + ) + """Properties from the Kubernetes data controller.""" + k8_s_raw: Optional[Any] = rest_field(name="k8sRaw", visibility=["read", "create", "update", "delete", "query"]) + """The raw kubernetes information.""" + upload_watermark: Optional["_models.UploadWatermark"] = rest_field( + name="uploadWatermark", visibility=["read", "create", "update", "delete", "query"] + ) + """Properties on upload watermark. Mostly timestamp for each upload data type.""" + last_uploaded_date: Optional[datetime.datetime] = rest_field( + name="lastUploadedDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + basic_login_information: Optional["_models.BasicLoginInformation"] = rest_field( + name="basicLoginInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. Azure Arc Data Services data controller no longer expose any endpoint. All traffic + are exposed through Kubernetes native API.""" + metrics_dashboard_credential: Optional["_models.BasicLoginInformation"] = rest_field( + name="metricsDashboardCredential", visibility=["read", "create", "update", "delete", "query"] + ) + """Login credential for metrics dashboard on the Kubernetes cluster.""" + logs_dashboard_credential: Optional["_models.BasicLoginInformation"] = rest_field( + name="logsDashboardCredential", visibility=["read", "create", "update", "delete", "query"] + ) + """Login credential for logs dashboard on the Kubernetes cluster.""" + log_analytics_workspace_config: Optional["_models.LogAnalyticsWorkspaceConfig"] = rest_field( + name="logAnalyticsWorkspaceConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """Log analytics workspace id and primary key.""" + upload_service_principal: Optional["_models.UploadServicePrincipal"] = rest_field( + name="uploadServicePrincipal", visibility=["read", "create", "update", "delete", "query"] + ) + """Deprecated. Service principal is deprecated in favor of Arc Kubernetes service extension + managed identity.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc Data Controller resource.""" + cluster_id: Optional[str] = rest_field(name="clusterId", visibility=["read", "create", "update", "delete", "query"]) + """If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom + location belongs to.""" + extension_id: Optional[str] = rest_field( + name="extensionId", visibility=["read", "create", "update", "delete", "query"] + ) + """If a CustomLocation is provided, this contains the ARM id of the extension the custom location + belongs to.""" + + @overload + def __init__( + self, + *, + infrastructure: Optional[Union[str, "_models.Infrastructure"]] = None, + on_premise_property: Optional["_models.OnPremiseProperty"] = None, + k8_s_raw: Optional[Any] = None, + upload_watermark: Optional["_models.UploadWatermark"] = None, + last_uploaded_date: Optional[datetime.datetime] = None, + basic_login_information: Optional["_models.BasicLoginInformation"] = None, + metrics_dashboard_credential: Optional["_models.BasicLoginInformation"] = None, + logs_dashboard_credential: Optional["_models.BasicLoginInformation"] = None, + log_analytics_workspace_config: Optional["_models.LogAnalyticsWorkspaceConfig"] = None, + upload_service_principal: Optional["_models.UploadServicePrincipal"] = None, + cluster_id: Optional[str] = None, + extension_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): + """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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurearcdata.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, 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 DataControllerResource(TrackedResource): + """Data controller 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.azurearcdata.models.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 data controller's properties. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation + """ + + properties: "_models.DataControllerProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The data controller's properties. Required.""" + extended_location: Optional["_models.ExtendedLocation"] = rest_field( + name="extendedLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The extendedLocation of the resource.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.DataControllerProperties", + tags: Optional[dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = 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 DataControllerUpdate(_Model): + """Used for updating a data controller resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The data controller's properties. + :vartype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.DataControllerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The data controller's properties.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.DataControllerProperties"] = 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 DBMEndpoint(_Model): + """Database mirroring endpoint related properties. + + :ivar endpoint_name: Name of the database mirroring endpoint. + :vartype endpoint_name: str + :ivar role: Mirroring Role. Known values are: "NONE", "PARTNER", "WITNESS", and "ALL". + :vartype role: str or ~azure.mgmt.azurearcdata.models.Role + :ivar is_encryption_enabled: Is Encryption enabled. + :vartype is_encryption_enabled: bool + :ivar encryption_algorithm: Encryption Algorithm. Known values are: "NONE", "RC4", "AES", + "NONE, RC4", "NONE, AES", "RC4, AES", "AES, RC4", "NONE, RC4, AES", and "NONE, AES, RC4". + :vartype encryption_algorithm: str or ~azure.mgmt.azurearcdata.models.EncryptionAlgorithm + :ivar connection_auth: The type of connection authentication required for connections to this + endpoint. Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", + "Certificate", "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", + "Windows_Negotiate_Certificate", "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", + and "Certificate_Windows_Negotiate". + :vartype connection_auth: str or ~azure.mgmt.azurearcdata.models.ConnectionAuth + :ivar port: The port number that the endpoint is listening on. + :vartype port: int + :ivar is_dynamic_port: Is the port number dynamically assigned. + :vartype is_dynamic_port: bool + :ivar ip_address: Listener IP address. + :vartype ip_address: str + :ivar certificate_name: Name of the certificate. + :vartype certificate_name: str + :ivar certificate_expiry_date: The certificate expiry date. + :vartype certificate_expiry_date: ~datetime.datetime + """ + + endpoint_name: Optional[str] = rest_field(name="endpointName", visibility=["read"]) + """Name of the database mirroring endpoint.""" + role: Optional[Union[str, "_models.Role"]] = rest_field(visibility=["read"]) + """Mirroring Role. Known values are: \"NONE\", \"PARTNER\", \"WITNESS\", and \"ALL\".""" + is_encryption_enabled: Optional[bool] = rest_field(name="isEncryptionEnabled", visibility=["read"]) + """Is Encryption enabled.""" + encryption_algorithm: Optional[Union[str, "_models.EncryptionAlgorithm"]] = rest_field( + name="encryptionAlgorithm", visibility=["read"] + ) + """Encryption Algorithm. Known values are: \"NONE\", \"RC4\", \"AES\", \"NONE, RC4\", \"NONE, + AES\", \"RC4, AES\", \"AES, RC4\", \"NONE, RC4, AES\", and \"NONE, AES, RC4\".""" + connection_auth: Optional[Union[str, "_models.ConnectionAuth"]] = rest_field( + name="connectionAuth", visibility=["read"] + ) + """The type of connection authentication required for connections to this endpoint. Known values + are: \"Windows_NTLM\", \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", + \"Windows_NTLM_Certificate\", \"Windows_Kerberos_Certificate\", + \"Windows_Negotiate_Certificate\", \"Certificate_Windows_NTLM\", + \"Certificate_Windows_Kerberos\", and \"Certificate_Windows_Negotiate\".""" + port: Optional[int] = rest_field(visibility=["read"]) + """The port number that the endpoint is listening on.""" + is_dynamic_port: Optional[bool] = rest_field(name="isDynamicPort", visibility=["read"]) + """Is the port number dynamically assigned.""" + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read"]) + """Listener IP address.""" + certificate_name: Optional[str] = rest_field(name="certificateName", visibility=["read"]) + """Name of the certificate.""" + certificate_expiry_date: Optional[datetime.datetime] = rest_field( + name="certificateExpiryDate", visibility=["read"], format="rfc3339" + ) + """The certificate expiry date.""" + + +class DiskSizes(_Model): + """disk size values. + + :ivar disk_type: Type of managed disk. + :vartype disk_type: str + :ivar redundancy: Redundancy option. + :vartype redundancy: str + :ivar size: Size of the managed disk - e.g. P30, P40. + :vartype size: str + :ivar caching: Caching configuration - e.g. read only caching. + :vartype caching: str + :ivar max_size_in_gib: maximum disk size in GiB. + :vartype max_size_in_gib: float + :ivar max_throughput_in_mbps: maximum throughput in MB/s. + :vartype max_throughput_in_mbps: float + :ivar max_iops: maximum IO requirements/s (IOPS). + :vartype max_iops: float + """ + + disk_type: Optional[str] = rest_field(name="diskType", visibility=["read", "create", "update", "delete", "query"]) + """Type of managed disk.""" + redundancy: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Redundancy option.""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the managed disk - e.g. P30, P40.""" + caching: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Caching configuration - e.g. read only caching.""" + max_size_in_gib: Optional[float] = rest_field( + name="maxSizeInGib", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum disk size in GiB.""" + max_throughput_in_mbps: Optional[float] = rest_field( + name="maxThroughputInMbps", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum throughput in MB/s.""" + max_iops: Optional[float] = rest_field(name="maxIops", visibility=["read", "create", "update", "delete", "query"]) + """maximum IO requirements/s (IOPS).""" + + @overload + def __init__( + self, + *, + disk_type: Optional[str] = None, + redundancy: Optional[str] = None, + size: Optional[str] = None, + caching: Optional[str] = None, + max_size_in_gib: Optional[float] = None, + max_throughput_in_mbps: Optional[float] = None, + max_iops: 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 DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration( + _Model +): # pylint: disable=name-too-long + """The availability group certificate configuration. + + :ivar certificate_name: Name of the certificate. + :vartype certificate_name: str + """ + + certificate_name: Optional[str] = rest_field( + name="certificateName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the certificate.""" + + @overload + def __init__( + self, + *, + certificate_name: 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 DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration(_Model): # pylint: disable=name-too-long + """The availability group configuration specification for a distributed availability group. + + :ivar availability_group: The azure resource identifier for the availability group. + :vartype availability_group: str + :ivar listener_url: The listener URL of the availability group. + :vartype listener_url: str + :ivar availability_mode: The availability mode of the availability group. Known values are: + "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerAvailabilityMode + :ivar failover_mode: The failover mode of the availability group. Known values are: + "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerFailoverMode + :ivar seeding_mode: The seeding mode of the availability group. Known values are: "AUTOMATIC" + and "MANUAL". + :vartype seeding_mode: str or ~azure.mgmt.azurearcdata.models.SeedingMode + :ivar certificate_configuration: The certificate configuration for the availability group. + :vartype certificate_configuration: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration + """ + + availability_group: Optional[str] = rest_field( + name="availabilityGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """The azure resource identifier for the availability group.""" + listener_url: Optional[str] = rest_field( + name="listenerUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """The listener URL of the availability group.""" + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = rest_field( + name="availabilityMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The availability mode of the availability group. Known values are: \"SYNCHRONOUS_COMMIT\" and + \"ASYNCHRONOUS_COMMIT\".""" + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = rest_field( + name="failoverMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The failover mode of the availability group. Known values are: \"AUTOMATIC\", \"MANUAL\", + \"EXTERNAL\", and \"NONE\".""" + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = rest_field( + name="seedingMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The seeding mode of the availability group. Known values are: \"AUTOMATIC\" and \"MANUAL\".""" + certificate_configuration: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration" + ] = rest_field(name="certificateConfiguration", visibility=["read", "create", "update", "delete", "query"]) + """The certificate configuration for the availability group.""" + + @overload + def __init__( + self, + *, + availability_group: Optional[str] = None, + listener_url: Optional[str] = None, + availability_mode: Optional[Union[str, "_models.ArcSqlServerAvailabilityMode"]] = None, + failover_mode: Optional[Union[str, "_models.ArcSqlServerFailoverMode"]] = None, + seeding_mode: Optional[Union[str, "_models.SeedingMode"]] = None, + certificate_configuration: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration" + ] = 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 DistributedAvailabilityGroupCreateUpdateConfiguration(_Model): # pylint: disable=name-too-long + """Options used in creating a distributed availability group. + + :ivar availability_group_name: Name of the availability group. + :vartype availability_group_name: str + :ivar primary_availability_group: The initial primary availability group for the distributed + availability group. + :vartype primary_availability_group: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration + :ivar secondary_availability_group: The initial secondary availability group for the + distributed availability group. + :vartype secondary_availability_group: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration + """ + + availability_group_name: Optional[str] = rest_field( + name="availabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the availability group.""" + primary_availability_group: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + ] = rest_field(name="primaryAvailabilityGroup", visibility=["read", "create", "update", "delete", "query"]) + """The initial primary availability group for the distributed availability group.""" + secondary_availability_group: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + ] = rest_field(name="secondaryAvailabilityGroup", visibility=["read", "create", "update", "delete", "query"]) + """The initial secondary availability group for the distributed availability group.""" + + @overload + def __init__( + self, + *, + availability_group_name: Optional[str] = None, + primary_availability_group: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + ] = None, + secondary_availability_group: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + ] = 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 EntraAuthentication(_Model): + """Entra Authentication configuration. + + :ivar identity_type: The method used for Entra authentication. Known values are: + "SystemAssignedManagedIdentity" and "UserAssignedManagedIdentity". + :vartype identity_type: str or ~azure.mgmt.azurearcdata.models.IdentityType + :ivar client_id: The client Id of the Managed Identity to query Microsoft Graph API. An empty + string must be used for the system assigned Managed Identity. + :vartype client_id: str + """ + + identity_type: Optional[Union[str, "_models.IdentityType"]] = rest_field( + name="identityType", visibility=["read", "create", "update", "delete", "query"] + ) + """The method used for Entra authentication. Known values are: \"SystemAssignedManagedIdentity\" + and \"UserAssignedManagedIdentity\".""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be + used for the system assigned Managed Identity.""" + + @overload + def __init__( + self, + *, + identity_type: Optional[Union[str, "_models.IdentityType"]] = None, + client_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 ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.azurearcdata.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.azurearcdata.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.azurearcdata.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = 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 ExtendedLocation(_Model): + """The complex type of the extended location. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. "CustomLocation" + :vartype type: str or ~azure.mgmt.azurearcdata.models.ExtendedLocationTypes + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the extended location.""" + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the extended location. \"CustomLocation\"""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = 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 FailoverCluster(_Model): + """Failover Cluster Instance properties. + + :ivar id: The GUID of the SQL Server's underlying Failover Cluster. + :vartype id: str + :ivar network_name: The network name to connect to the SQL FCI. + :vartype network_name: str + :ivar sql_instance_ids: The ARM IDs of the Arc SQL Server resources, belonging to the current + server's Failover cluster. + :vartype sql_instance_ids: list[str] + :ivar host_names: The host names which are part of the SQL FCI resource group. + :vartype host_names: list[str] + :ivar host_ip_addresses: The IP addresses and subnet masks associated with the SQL Failover + Cluster Instance on this host. + :vartype host_ip_addresses: list[~azure.mgmt.azurearcdata.models.HostIPAddressInformation] + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The GUID of the SQL Server's underlying Failover Cluster.""" + network_name: Optional[str] = rest_field(name="networkName", visibility=["read"]) + """The network name to connect to the SQL FCI.""" + sql_instance_ids: Optional[list[str]] = rest_field(name="sqlInstanceIds", visibility=["read"]) + """The ARM IDs of the Arc SQL Server resources, belonging to the current server's Failover + cluster.""" + host_names: Optional[list[str]] = rest_field(name="hostNames", visibility=["read"]) + """The host names which are part of the SQL FCI resource group.""" + host_ip_addresses: Optional[list["_models.HostIPAddressInformation"]] = rest_field( + name="hostIPAddresses", visibility=["read"] + ) + """The IP addresses and subnet masks associated with the SQL Failover Cluster Instance on this + host.""" + + +class FailoverGroupProperties(_Model): + """The properties of a failover group resource. + + :ivar provisioning_state: The provisioning state of the failover group resource. Known values + are: "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: str or ~azure.mgmt.azurearcdata.models.ProvisioningState + :ivar partner_managed_instance_id: The resource ID of the partner SQL managed instance. + Required. + :vartype partner_managed_instance_id: str + :ivar spec: The specifications of the failover group resource. Required. + :vartype spec: ~azure.mgmt.azurearcdata.models.FailoverGroupSpec + :ivar status: The status of the failover group custom resource. + :vartype status: any + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of the failover group resource. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", and \"Accepted\".""" + partner_managed_instance_id: str = rest_field( + name="partnerManagedInstanceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the partner SQL managed instance. Required.""" + spec: "_models.FailoverGroupSpec" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The specifications of the failover group resource. Required.""" + status: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the failover group custom resource.""" + + @overload + def __init__( + self, + *, + partner_managed_instance_id: str, + spec: "_models.FailoverGroupSpec", + status: Optional[Any] = 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 FailoverGroupResource(ProxyResource): + """A failover group 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.azurearcdata.models.SystemData + :ivar properties: null. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.FailoverGroupProperties + """ + + properties: "_models.FailoverGroupProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.FailoverGroupProperties", + ) -> 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 FailoverGroupSpec(_Model): + """The specifications of the failover group resource. + + :ivar shared_name: The shared name of the failover group for this SQL managed instance. Both + SQL managed instance and its partner have to use the same shared name. + :vartype shared_name: str + :ivar source_mi: The name of the SQL managed instance with this failover group role. + :vartype source_mi: str + :ivar partner_mi: The name of the partner SQL managed instance. + :vartype partner_mi: str + :ivar partner_mirroring_url: The mirroring endpoint URL of the partner SQL managed instance. + :vartype partner_mirroring_url: str + :ivar partner_mirroring_cert: The mirroring endpoint public certificate for the partner SQL + managed instance. Only PEM format is supported. + :vartype partner_mirroring_cert: str + :ivar partner_sync_mode: The partner sync mode of the SQL managed instance. Known values are: + "async" and "sync". + :vartype partner_sync_mode: str or ~azure.mgmt.azurearcdata.models.FailoverGroupPartnerSyncMode + :ivar role: The role of the SQL managed instance in this failover group. Required. Known values + are: "primary", "secondary", "force-primary-allow-data-loss", and "force-secondary". + :vartype role: str or ~azure.mgmt.azurearcdata.models.InstanceFailoverGroupRole + """ + + shared_name: Optional[str] = rest_field( + name="sharedName", visibility=["read", "create", "update", "delete", "query"] + ) + """The shared name of the failover group for this SQL managed instance. Both SQL managed instance + and its partner have to use the same shared name.""" + source_mi: Optional[str] = rest_field(name="sourceMI", visibility=["read", "create", "update", "delete", "query"]) + """The name of the SQL managed instance with this failover group role.""" + partner_mi: Optional[str] = rest_field(name="partnerMI", visibility=["read", "create", "update", "delete", "query"]) + """The name of the partner SQL managed instance.""" + partner_mirroring_url: Optional[str] = rest_field( + name="partnerMirroringURL", visibility=["read", "create", "update", "delete", "query"] + ) + """The mirroring endpoint URL of the partner SQL managed instance.""" + partner_mirroring_cert: Optional[str] = rest_field( + name="partnerMirroringCert", visibility=["read", "create", "update", "delete", "query"] + ) + """The mirroring endpoint public certificate for the partner SQL managed instance. Only PEM format + is supported.""" + partner_sync_mode: Optional[Union[str, "_models.FailoverGroupPartnerSyncMode"]] = rest_field( + name="partnerSyncMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The partner sync mode of the SQL managed instance. Known values are: \"async\" and \"sync\".""" + role: Union[str, "_models.InstanceFailoverGroupRole"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The role of the SQL managed instance in this failover group. Required. Known values are: + \"primary\", \"secondary\", \"force-primary-allow-data-loss\", and \"force-secondary\".""" + + @overload + def __init__( + self, + *, + role: Union[str, "_models.InstanceFailoverGroupRole"], + shared_name: Optional[str] = None, + source_mi: Optional[str] = None, + partner_mi: Optional[str] = None, + partner_mirroring_url: Optional[str] = None, + partner_mirroring_cert: Optional[str] = None, + partner_sync_mode: Optional[Union[str, "_models.FailoverGroupPartnerSyncMode"]] = 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 FailoverMiLinkResourceId(_Model): + """The azure resource identifier for the Sql Managed Instance. + + :ivar managed_instance_id: Azure resource id for the sql managed instance. + :vartype managed_instance_id: str + :ivar force: Whether to perform a Force Failover as opposed to just a regular Failover. + :vartype force: bool + """ + + managed_instance_id: Optional[str] = rest_field( + name="managedInstanceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure resource id for the sql managed instance.""" + force: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to perform a Force Failover as opposed to just a regular Failover.""" + + @overload + def __init__( + self, + *, + managed_instance_id: Optional[str] = None, + force: Optional[bool] = 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 HostIPAddressInformation(_Model): + """IP address and subnet mask. + + :ivar ip_address: IP address. + :vartype ip_address: str + :ivar subnet_mask: Subnet mask. + :vartype subnet_mask: str + """ + + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read"]) + """IP address.""" + subnet_mask: Optional[str] = rest_field(name="subnetMask", visibility=["read"]) + """Subnet mask.""" + + +class ImpactedObjectsInfo(_Model): + """summary information about the incompatible feature id, number of objects impacted and category + of issue (warning/error). + + :ivar feature_id: Represents the feature id from + `https://learn.microsoft.com/en-us/data-migration/sql-server/database/assessment-rules?view=azuresql + `_. + OR + `https://learn.microsoft.com/en-us/data-migration/sql-server/managed-instance/assessment-rules?view=azuresql + `_. + :vartype feature_id: str + :ivar number_impacted: Represents the number of issues/warnings. + :vartype number_impacted: int + :ivar issue_category: Issue or Warning. + :vartype issue_category: str + """ + + feature_id: Optional[str] = rest_field(name="featureId", visibility=["read", "create", "update", "delete", "query"]) + """Represents the feature id from + `https://learn.microsoft.com/en-us/data-migration/sql-server/database/assessment-rules?view=azuresql + `_. + OR + `https://learn.microsoft.com/en-us/data-migration/sql-server/managed-instance/assessment-rules?view=azuresql + `_.""" + number_impacted: Optional[int] = rest_field( + name="numberImpacted", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the number of issues/warnings.""" + issue_category: Optional[str] = rest_field( + name="issueCategory", visibility=["read", "create", "update", "delete", "query"] + ) + """Issue or Warning.""" + + @overload + def __init__( + self, + *, + feature_id: Optional[str] = None, + number_impacted: Optional[int] = None, + issue_category: 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 ImpactedObjectsSuitabilitySummary(_Model): + """Represents a summary of migration readiness issues/warnings per feature type for Azure SQL DB + and SQL MI targets. + + :ivar azure_sql_database: + :vartype azure_sql_database: list[~azure.mgmt.azurearcdata.models.ImpactedObjectsInfo] + :ivar azure_sql_managed_instance: + :vartype azure_sql_managed_instance: list[~azure.mgmt.azurearcdata.models.ImpactedObjectsInfo] + """ + + azure_sql_database: Optional[list["_models.ImpactedObjectsInfo"]] = rest_field( + name="azureSqlDatabase", visibility=["read"] + ) + azure_sql_managed_instance: Optional[list["_models.ImpactedObjectsInfo"]] = rest_field( + name="azureSqlManagedInstance", visibility=["read"] + ) + + +class K8SActiveDirectory(_Model): + """The kubernetes active directory information. + + :ivar connector: + :vartype connector: ~azure.mgmt.azurearcdata.models.K8SActiveDirectoryConnector + :ivar account_name: Account name for AAD. + :vartype account_name: str + :ivar keytab_secret: Keytab secret used to authenticate with Active Directory. + :vartype keytab_secret: str + :ivar encryption_types: An array of encryption types. + :vartype encryption_types: list[str] + """ + + connector: Optional["_models.K8SActiveDirectoryConnector"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + account_name: Optional[str] = rest_field( + name="accountName", visibility=["read", "create", "update", "delete", "query"] + ) + """Account name for AAD.""" + keytab_secret: Optional[str] = rest_field( + name="keytabSecret", visibility=["read", "create", "update", "delete", "query"] + ) + """Keytab secret used to authenticate with Active Directory.""" + encryption_types: Optional[list[str]] = rest_field( + name="encryptionTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of encryption types.""" + + @overload + def __init__( + self, + *, + connector: Optional["_models.K8SActiveDirectoryConnector"] = None, + account_name: Optional[str] = None, + keytab_secret: Optional[str] = None, + encryption_types: Optional[list[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 K8SActiveDirectoryConnector(_Model): + """K8SActiveDirectoryConnector. + + :ivar name: Name of the connector. + :vartype name: str + :ivar namespace: Name space of the connector. + :vartype namespace: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the connector.""" + namespace: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name space of the connector.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + namespace: 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 K8SNetworkSettings(_Model): + """The kubernetes network settings information. + + :ivar forceencryption: If 1, then SQL Server forces all connections to be encrypted. By + default, this option is 0. + :vartype forceencryption: int + :ivar tlsciphers: Specifies which ciphers are allowed by SQL Server for TLS. + :vartype tlsciphers: str + :ivar tlsprotocols: A comma-separated list of which TLS protocols are allowed by SQL Server. + :vartype tlsprotocols: str + """ + + forceencryption: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If 1, then SQL Server forces all connections to be encrypted. By default, this option is 0.""" + tlsciphers: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies which ciphers are allowed by SQL Server for TLS.""" + tlsprotocols: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A comma-separated list of which TLS protocols are allowed by SQL Server.""" + + @overload + def __init__( + self, + *, + forceencryption: Optional[int] = None, + tlsciphers: Optional[str] = None, + tlsprotocols: 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 K8SResourceRequirements(_Model): + """The kubernetes resource limits and requests used to restrict or reserve resource usage. + + :ivar requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' + request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default + 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and + maximum 'memory' is '128Gi'. + :vartype requests: dict[str, str] + :ivar limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request + must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' + is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum + 'memory' is '128Gi'. + :vartype limits: dict[str, str] + """ + + requests: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less + than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', + minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is + '128Gi'.""" + limits: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less + than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', + minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is + '128Gi'.""" + + @overload + def __init__( + self, + *, + requests: Optional[dict[str, str]] = None, + limits: Optional[dict[str, 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 K8SScheduling(_Model): + """The kubernetes scheduling information. + + :ivar default: The kubernetes scheduling options. It describes restrictions used to help + Kubernetes select appropriate nodes to host the database service. + :vartype default: ~azure.mgmt.azurearcdata.models.K8SSchedulingOptions + """ + + default: Optional["_models.K8SSchedulingOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select + appropriate nodes to host the database service.""" + + @overload + def __init__( + self, + *, + default: Optional["_models.K8SSchedulingOptions"] = 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 K8SSchedulingOptions(_Model): + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select + appropriate nodes to host the database service. + + :ivar resources: The kubernetes resource limits and requests used to restrict or reserve + resource usage. + :vartype resources: ~azure.mgmt.azurearcdata.models.K8SResourceRequirements + """ + + resources: Optional["_models.K8SResourceRequirements"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes resource limits and requests used to restrict or reserve resource usage.""" + + @overload + def __init__( + self, + *, + resources: Optional["_models.K8SResourceRequirements"] = 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 K8SSecurity(_Model): + """The kubernetes security information. + + :ivar admin_login_secret: Admin login secret key. + :vartype admin_login_secret: str + :ivar service_certificate_secret: Service certificate secret used. + :vartype service_certificate_secret: str + :ivar active_directory: The kubernetes active directory information. + :vartype active_directory: ~azure.mgmt.azurearcdata.models.K8SActiveDirectory + :ivar transparent_data_encryption: Transparent data encryption information. + :vartype transparent_data_encryption: + ~azure.mgmt.azurearcdata.models.K8StransparentDataEncryption + """ + + admin_login_secret: Optional[str] = rest_field( + name="adminLoginSecret", visibility=["read", "create", "update", "delete", "query"] + ) + """Admin login secret key.""" + service_certificate_secret: Optional[str] = rest_field( + name="serviceCertificateSecret", visibility=["read", "create", "update", "delete", "query"] + ) + """Service certificate secret used.""" + active_directory: Optional["_models.K8SActiveDirectory"] = rest_field( + name="activeDirectory", visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes active directory information.""" + transparent_data_encryption: Optional["_models.K8StransparentDataEncryption"] = rest_field( + name="transparentDataEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """Transparent data encryption information.""" + + @overload + def __init__( + self, + *, + admin_login_secret: Optional[str] = None, + service_certificate_secret: Optional[str] = None, + active_directory: Optional["_models.K8SActiveDirectory"] = None, + transparent_data_encryption: Optional["_models.K8StransparentDataEncryption"] = 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 K8SSettings(_Model): + """The kubernetes settings information. + + :ivar network: The kubernetes network settings information. + :vartype network: ~azure.mgmt.azurearcdata.models.K8SNetworkSettings + """ + + network: Optional["_models.K8SNetworkSettings"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes network settings information.""" + + @overload + def __init__( + self, + *, + network: Optional["_models.K8SNetworkSettings"] = 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 K8StransparentDataEncryption(_Model): + """Transparent data encryption information. + + :ivar mode: Transparent data encryption mode. Can be Service Managed, Customer managed or + disabled. + :vartype mode: str + :ivar protector_secret: Protector secret for customer managed Transparent data encryption mode. + :vartype protector_secret: str + """ + + mode: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Transparent data encryption mode. Can be Service Managed, Customer managed or disabled.""" + protector_secret: Optional[str] = rest_field( + name="protectorSecret", visibility=["read", "create", "update", "delete", "query"] + ) + """Protector secret for customer managed Transparent data encryption mode.""" + + @overload + def __init__( + self, + *, + mode: Optional[str] = None, + protector_secret: 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 KeytabInformation(_Model): + """Keytab used for authenticate with Active Directory. + + :ivar keytab: A base64-encoded keytab. + :vartype keytab: str + """ + + keytab: Optional[str] = rest_field(visibility=["create", "update"]) + """A base64-encoded keytab.""" + + @overload + def __init__( + self, + *, + keytab: 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 LogAnalyticsWorkspaceConfig(_Model): + """Log analytics workspace id and primary key. + + :ivar workspace_id: Azure Log Analytics workspace ID. + :vartype workspace_id: str + :ivar primary_key: Primary key of the workspace. + :vartype primary_key: str + """ + + workspace_id: Optional[str] = rest_field( + name="workspaceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Log Analytics workspace ID.""" + primary_key: Optional[str] = rest_field(name="primaryKey", visibility=["create", "update"]) + """Primary key of the workspace.""" + + @overload + def __init__( + self, + *, + workspace_id: Optional[str] = None, + primary_key: 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 ManagedInstanceLinkCreateUpdateConfiguration(_Model): # pylint: disable=name-too-long + """The configuration for the new Managed Instance Link resource. + + :ivar availability_group: The configuration for the SQL Server availability group resource. + :vartype availability_group: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration + :ivar distributed_availability_group: The distributed availability group configuration for the + MI link. + :vartype distributed_availability_group: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration + :ivar mi_link_configuration: The MI Link specific distributed availability group configuration. + :vartype mi_link_configuration: ~azure.mgmt.azurearcdata.models.MiLinkCreateUpdateConfiguration + """ + + availability_group: Optional["_models.AvailabilityGroupCreateUpdateConfiguration"] = rest_field( + name="availabilityGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """The configuration for the SQL Server availability group resource.""" + distributed_availability_group: Optional["_models.DistributedAvailabilityGroupCreateUpdateConfiguration"] = ( + rest_field(name="distributedAvailabilityGroup", visibility=["read", "create", "update", "delete", "query"]) + ) + """The distributed availability group configuration for the MI link.""" + mi_link_configuration: Optional["_models.MiLinkCreateUpdateConfiguration"] = rest_field( + name="miLinkConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """The MI Link specific distributed availability group configuration.""" + + @overload + def __init__( + self, + *, + availability_group: Optional["_models.AvailabilityGroupCreateUpdateConfiguration"] = None, + distributed_availability_group: Optional[ + "_models.DistributedAvailabilityGroupCreateUpdateConfiguration" + ] = None, + mi_link_configuration: Optional["_models.MiLinkCreateUpdateConfiguration"] = 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 Migration(_Model): + """Migration related configuration. + + :ivar assessment: Migration assessments related configuration. + :vartype assessment: ~azure.mgmt.azurearcdata.models.MigrationAssessment + :ivar target_selected_time: The last time when the target resource was selected for migration. + :vartype target_selected_time: ~datetime.datetime + :ivar target_resource_id: Resource Id of the created or selected target SQL resource for + migration. + :vartype target_resource_id: str + """ + + assessment: Optional["_models.MigrationAssessment"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Migration assessments related configuration.""" + target_selected_time: Optional[datetime.datetime] = rest_field( + name="targetSelectedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The last time when the target resource was selected for migration.""" + target_resource_id: Optional[str] = rest_field( + name="targetResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource Id of the created or selected target SQL resource for migration.""" + + @overload + def __init__( + self, + *, + assessment: Optional["_models.MigrationAssessment"] = None, + target_selected_time: Optional[datetime.datetime] = None, + target_resource_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 MigrationAssessment(_Model): + """The migration assessment related configuration. + + :ivar enabled: Indicates if migration assessment is enabled for this SQL Server instance. + :vartype enabled: bool + :ivar assessment_upload_time: The time when Migration Assessment Report upload was last + performed. + :vartype assessment_upload_time: ~datetime.datetime + :ivar assessment_viewed_time: The time when this migration assessment was last viewed. + :vartype assessment_viewed_time: ~datetime.datetime + :ivar target_recommendation_generation_time: The UTC timestamp in ISO 8601 format indicating + when the latest target recommendations were generated for this SQL Server instance. This value + is set as part of a successful RunTargetRecommendation job and is independent of when the + migration readiness results were uploaded (assessmentUploadTime). + :vartype target_recommendation_generation_time: ~datetime.datetime + :ivar version: version of this migration assessment report - to be passed by the migration + assessment engine. + :vartype version: str + :ivar settings: Settings impacting the migration assessment computation - configurable with + some default values if not set. + :vartype settings: ~azure.mgmt.azurearcdata.models.MigrationAssessmentSettings + :ivar server_assessments: Issues and warnings impacting the migration of SQL Server instance to + particular Azure Migration Target. + :vartype server_assessments: list[~azure.mgmt.azurearcdata.models.ServerAssessmentsItem] + :ivar sku_recommendation_results: SKU Recommendation results for Azure migration targets for + SQL Server. + :vartype sku_recommendation_results: ~azure.mgmt.azurearcdata.models.SkuRecommendationResults + :ivar impacted_objects_summary: Represents a summary of migration readiness issues/warnings per + feature type for Azure SQL DB and SQL MI targets. + :vartype impacted_objects_summary: + ~azure.mgmt.azurearcdata.models.ImpactedObjectsSuitabilitySummary + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if migration assessment is enabled for this SQL Server instance.""" + assessment_upload_time: Optional[datetime.datetime] = rest_field( + name="assessmentUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when Migration Assessment Report upload was last performed.""" + assessment_viewed_time: Optional[datetime.datetime] = rest_field( + name="assessmentViewedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time when this migration assessment was last viewed.""" + target_recommendation_generation_time: Optional[datetime.datetime] = rest_field( + name="targetRecommendationGenerationTime", visibility=["read"], format="rfc3339" + ) + """The UTC timestamp in ISO 8601 format indicating when the latest target recommendations were + generated for this SQL Server instance. This value is set as part of a successful + RunTargetRecommendation job and is independent of when the migration readiness results were + uploaded (assessmentUploadTime).""" + version: Optional[str] = rest_field(visibility=["read"]) + """version of this migration assessment report - to be passed by the migration assessment engine.""" + settings: Optional["_models.MigrationAssessmentSettings"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Settings impacting the migration assessment computation - configurable with some default values + if not set.""" + server_assessments: Optional[list["_models.ServerAssessmentsItem"]] = rest_field( + name="serverAssessments", visibility=["read"] + ) + """Issues and warnings impacting the migration of SQL Server instance to particular Azure + Migration Target.""" + sku_recommendation_results: Optional["_models.SkuRecommendationResults"] = rest_field( + name="skuRecommendationResults", visibility=["read"] + ) + """SKU Recommendation results for Azure migration targets for SQL Server.""" + impacted_objects_summary: Optional["_models.ImpactedObjectsSuitabilitySummary"] = rest_field( + name="impactedObjectsSummary", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents a summary of migration readiness issues/warnings per feature type for Azure SQL DB + and SQL MI targets.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + assessment_viewed_time: Optional[datetime.datetime] = None, + settings: Optional["_models.MigrationAssessmentSettings"] = None, + impacted_objects_summary: Optional["_models.ImpactedObjectsSuitabilitySummary"] = 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 MigrationAssessmentSettings(_Model): + """Settings impacting the migration assessment computation - configurable with some default values + if not set. + + :ivar target_location: The target location for Azure SQL SKU for migration. Default is West US. + :vartype target_location: str + :ivar percentile: Indicate the percentile value for the performance sample. Default is 95th + percentile. + :vartype percentile: float + :ivar lookback_period_in_days: How far back to check the performance data - Default is 30 + (days). + :vartype lookback_period_in_days: int + :ivar comfort_factor: Buffer (percentage) to consider while SKU sizing to account for issues + such as seasonal usage, short performance history, and likely increases in future usage - This + buffer is applied on top of the performance metrics. Default is 100 (percent). + :vartype comfort_factor: int + :ivar strategy: Minimize cost or Migrate to PaaS. - to evaluate based on the recommended + strategy. Default is Migrate to PaaS. + :vartype strategy: str + :ivar currency: currency to calculate prices - Default is USD. + :vartype currency: str + :ivar discount_percentage: flat discount percentage to apply for the price - Default is 0. + :vartype discount_percentage: float + :ivar cost_options: Selected cost option value. + :vartype cost_options: ~azure.mgmt.azurearcdata.models.CostOptionSelectedValues + """ + + target_location: Optional[str] = rest_field( + name="targetLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The target location for Azure SQL SKU for migration. Default is West US.""" + percentile: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicate the percentile value for the performance sample. Default is 95th percentile.""" + lookback_period_in_days: Optional[int] = rest_field( + name="lookbackPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """How far back to check the performance data - Default is 30 (days).""" + comfort_factor: Optional[int] = rest_field( + name="comfortFactor", visibility=["read", "create", "update", "delete", "query"] + ) + """Buffer (percentage) to consider while SKU sizing to account for issues such as seasonal usage, + short performance history, and likely increases in future usage - This buffer is applied on top + of the performance metrics. Default is 100 (percent).""" + strategy: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Minimize cost or Migrate to PaaS. - to evaluate based on the recommended strategy. Default is + Migrate to PaaS.""" + currency: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """currency to calculate prices - Default is USD.""" + discount_percentage: Optional[float] = rest_field( + name="discountPercentage", visibility=["read", "create", "update", "delete", "query"] + ) + """flat discount percentage to apply for the price - Default is 0.""" + cost_options: Optional["_models.CostOptionSelectedValues"] = rest_field( + name="costOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Selected cost option value.""" + + @overload + def __init__( + self, + *, + target_location: Optional[str] = None, + percentile: Optional[float] = None, + lookback_period_in_days: Optional[int] = None, + comfort_factor: Optional[int] = None, + strategy: Optional[str] = None, + currency: Optional[str] = None, + discount_percentage: Optional[float] = None, + cost_options: Optional["_models.CostOptionSelectedValues"] = 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 MiLinkCreateUpdateConfiguration(_Model): + """The MI Link specific configuration. + + :ivar instance_availability_group_name: The name of the availability group to be created on the + Managed Instance. + :vartype instance_availability_group_name: str + """ + + instance_availability_group_name: Optional[str] = rest_field( + name="instanceAvailabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the availability group to be created on the Managed Instance.""" + + @overload + def __init__( + self, + *, + instance_availability_group_name: 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 Monitoring(_Model): + """The monitoring configuration. + + :ivar enabled: Indicates if monitoring is enabled for this SQL Server instance. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if monitoring is enabled for this SQL Server instance.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = 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 OnPremiseProperty(_Model): + """Properties from the Kubernetes data controller. + + :ivar id: A globally unique ID identifying the associated Kubernetes cluster. Required. + :vartype id: str + :ivar public_signing_key: Certificate that contains the Kubernetes cluster public key used to + verify signing. Required. + :vartype public_signing_key: str + :ivar signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the + certificate being uploaded. + :vartype signing_certificate_thumbprint: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A globally unique ID identifying the associated Kubernetes cluster. Required.""" + public_signing_key: str = rest_field( + name="publicSigningKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Certificate that contains the Kubernetes cluster public key used to verify signing. Required.""" + signing_certificate_thumbprint: Optional[str] = rest_field( + name="signingCertificateThumbprint", visibility=["read", "create", "update", "delete", "query"] + ) + """Unique thumbprint returned to customer to verify the certificate being uploaded.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + public_signing_key: str, + signing_certificate_thumbprint: 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 Operation(_Model): + """Azure Data Services on Azure Arc operation definition. + + :ivar name: The name of the operation being performed on this particular object. Required. + :vartype name: str + :ivar display: The localized display information for this particular operation / action. + Required. + :vartype display: ~azure.mgmt.azurearcdata.models.OperationDisplay + :ivar origin: The intended executor of the operation. Known values are: "user" and "system". + :vartype origin: str or ~azure.mgmt.azurearcdata.models.OperationOrigin + :ivar is_data_action: Indicates whether the operation is a data action. Required. + :vartype is_data_action: bool + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, any] + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the operation being performed on this particular object. Required.""" + display: "_models.OperationDisplay" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The localized display information for this particular operation / action. Required.""" + origin: Optional[Union[str, "_models.OperationOrigin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation. Known values are: \"user\" and \"system\".""" + is_data_action: bool = rest_field(name="isDataAction", visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether the operation is a data action. Required.""" + properties: Optional[dict[str, Any]] = rest_field(visibility=["read"]) + """Additional descriptions for the operation.""" + + @overload + def __init__( + self, + *, + name: str, + display: "_models.OperationDisplay", + is_data_action: bool, + ) -> 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 OperationDisplay(_Model): + """Display metadata associated with the operation. + + :ivar provider: The localized friendly form of the resource provider name. Required. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related to this + action/operation. Required. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. Required. + :vartype operation: str + :ivar description: The localized friendly description for the operation. Required. + :vartype description: str + """ + + provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The localized friendly form of the resource provider name. Required.""" + resource: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The localized friendly form of the resource type related to this action/operation. Required.""" + operation: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The localized friendly name for the operation. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The localized friendly description for the operation. Required.""" + + @overload + def __init__( + self, + *, + provider: str, + resource: str, + operation: str, + description: str, + ) -> 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 PostgresInstance(TrackedResource): + """A Postgres Instance. + + :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.azurearcdata.models.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: null. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation + :ivar sku: Resource sku. + :vartype sku: ~azure.mgmt.azurearcdata.models.PostgresInstanceSku + """ + + properties: "_models.PostgresInstanceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + extended_location: Optional["_models.ExtendedLocation"] = rest_field( + name="extendedLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The extendedLocation of the resource.""" + sku: Optional["_models.PostgresInstanceSku"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource sku.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.PostgresInstanceProperties", + tags: Optional[dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + sku: Optional["_models.PostgresInstanceSku"] = 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 PostgresInstanceProperties(_Model): + """Postgres Instance properties. + + :ivar data_controller_id: The data controller id. + :vartype data_controller_id: str + :ivar admin: The instance admin. + :vartype admin: str + :ivar basic_login_information: Username and password for basic authentication. + :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: any + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: ~datetime.datetime + :ivar provisioning_state: The provisioning state of the Azure Arc-enabled PostgreSQL instance. + :vartype provisioning_state: str + """ + + data_controller_id: Optional[str] = rest_field( + name="dataControllerId", visibility=["read", "create", "update", "delete", "query"] + ) + """The data controller id.""" + admin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The instance admin.""" + basic_login_information: Optional["_models.BasicLoginInformation"] = rest_field( + name="basicLoginInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Username and password for basic authentication.""" + k8_s_raw: Optional[Any] = rest_field(name="k8sRaw", visibility=["read", "create", "update", "delete", "query"]) + """The raw kubernetes information.""" + last_uploaded_date: Optional[datetime.datetime] = rest_field( + name="lastUploadedDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Azure Arc-enabled PostgreSQL instance.""" + + @overload + def __init__( + self, + *, + data_controller_id: Optional[str] = None, + admin: Optional[str] = None, + basic_login_information: Optional["_models.BasicLoginInformation"] = None, + k8_s_raw: Optional[Any] = None, + last_uploaded_date: Optional[datetime.datetime] = 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 PostgresInstanceSku(CommonSku): + """The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc. + + :ivar name: The name of the SKU. It is typically a letter+number code. Required. + :vartype name: str + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier. Default value is "Hyperscale". + :vartype tier: str + """ + + tier: Optional[Literal["Hyperscale"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """This field is required to be implemented by the Resource Provider if the service has more than + one tier. Default value is \"Hyperscale\".""" + + @overload + def __init__( + self, + *, + name: str, + dev: Optional[bool] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + tier: Optional[Literal["Hyperscale"]] = 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 PostgresInstanceUpdate(_Model): + """An update to a Postgres Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Postgres Instance properties. + :vartype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.PostgresInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Postgres Instance properties.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.PostgresInstanceProperties"] = 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 Schedule(_Model): + """The scheduling configuration. + + :ivar enabled: Indicates whether scheduling is enabled. + :vartype enabled: bool + :ivar cron_trigger: The cron trigger configuration. + :vartype cron_trigger: ~azure.mgmt.azurearcdata.models.CronTrigger + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates whether scheduling is enabled.""" + cron_trigger: Optional["_models.CronTrigger"] = rest_field( + name="cronTrigger", visibility=["read", "create", "update", "delete", "query"] + ) + """The cron trigger configuration.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + cron_trigger: Optional["_models.CronTrigger"] = 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 SequencerAction(_Model): + """The sequencer action details. + + :ivar action_id: The unique identifier of the sequencer action. + :vartype action_id: str + :ivar state: The state of the sequencer action. Known values are: "NotStarted", + "WaitingPredecessors", "ExecutingAction", "CreatingSuccessors", and "Completed". + :vartype state: str or ~azure.mgmt.azurearcdata.models.SequencerState + :ivar result: The result of the sequencer action. Known values are: "NotCompleted", + "Succeeded", "Failed", "TimedOut", and "Skipped". + :vartype result: str or ~azure.mgmt.azurearcdata.models.Result + """ + + action_id: Optional[str] = rest_field(name="actionId", visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the sequencer action.""" + state: Optional[Union[str, "_models.SequencerState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The state of the sequencer action. Known values are: \"NotStarted\", \"WaitingPredecessors\", + \"ExecutingAction\", \"CreatingSuccessors\", and \"Completed\".""" + result: Optional[Union[str, "_models.Result"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The result of the sequencer action. Known values are: \"NotCompleted\", \"Succeeded\", + \"Failed\", \"TimedOut\", and \"Skipped\".""" + + @overload + def __init__( + self, + *, + action_id: Optional[str] = None, + state: Optional[Union[str, "_models.SequencerState"]] = None, + result: Optional[Union[str, "_models.Result"]] = 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 ServerAssessmentsItem(_Model): + """ServerAssessmentsItem. + + :ivar applies_to_migration_target_platform: + :vartype applies_to_migration_target_platform: str + :ivar feature_id: + :vartype feature_id: str + :ivar impacted_objects: + :vartype impacted_objects: + list[~azure.mgmt.azurearcdata.models.ServerAssessmentsPropertiesItemsItem] + :ivar issue_category: + :vartype issue_category: str + :ivar more_information: + :vartype more_information: str + """ + + applies_to_migration_target_platform: Optional[str] = rest_field( + name="appliesToMigrationTargetPlatform", visibility=["read", "create", "update", "delete", "query"] + ) + feature_id: Optional[str] = rest_field(name="featureId", visibility=["read", "create", "update", "delete", "query"]) + impacted_objects: Optional[list["_models.ServerAssessmentsPropertiesItemsItem"]] = rest_field( + name="impactedObjects", visibility=["read", "create", "update", "delete", "query"] + ) + issue_category: Optional[str] = rest_field( + name="issueCategory", visibility=["read", "create", "update", "delete", "query"] + ) + more_information: Optional[str] = rest_field( + name="moreInformation", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + applies_to_migration_target_platform: Optional[str] = None, + feature_id: Optional[str] = None, + impacted_objects: Optional[list["_models.ServerAssessmentsPropertiesItemsItem"]] = None, + issue_category: Optional[str] = None, + more_information: 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 ServerAssessmentsPropertiesItemsItem(_Model): + """ServerAssessmentsPropertiesItemsItem. + + :ivar impact_detail: + :vartype impact_detail: str + :ivar name: + :vartype name: str + :ivar object_type: + :vartype object_type: str + """ + + impact_detail: Optional[str] = rest_field( + name="impactDetail", visibility=["read", "create", "update", "delete", "query"] + ) + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + object_type: Optional[str] = rest_field( + name="objectType", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + impact_detail: Optional[str] = None, + name: Optional[str] = None, + object_type: 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 SkuRecommendationResults(_Model): + """SKU Recommendation results for Azure migration targets for SQL Server. + + :ivar azure_sql_database: SKU Recommendation results for Azure SQL Database. + :vartype azure_sql_database: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabase + :ivar azure_sql_managed_instance: SKU Recommendation results for Azure SQL Managed Instance. + :vartype azure_sql_managed_instance: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstance + :ivar azure_sql_virtual_machine: SKU Recommendation results for Azure SQL Virtual Machine. + :vartype azure_sql_virtual_machine: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachine + """ + + azure_sql_database: Optional["_models.SkuRecommendationResultsAzureSqlDatabase"] = rest_field( + name="azureSqlDatabase", visibility=["read", "create", "update", "delete", "query"] + ) + """SKU Recommendation results for Azure SQL Database.""" + azure_sql_managed_instance: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstance"] = rest_field( + name="azureSqlManagedInstance", visibility=["read", "create", "update", "delete", "query"] + ) + """SKU Recommendation results for Azure SQL Managed Instance.""" + azure_sql_virtual_machine: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachine"] = rest_field( + name="azureSqlVirtualMachine", visibility=["read", "create", "update", "delete", "query"] + ) + """SKU Recommendation results for Azure SQL Virtual Machine.""" + + @overload + def __init__( + self, + *, + azure_sql_database: Optional["_models.SkuRecommendationResultsAzureSqlDatabase"] = None, + azure_sql_managed_instance: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstance"] = None, + azure_sql_virtual_machine: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachine"] = 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 SkuRecommendationResultsAzureSqlDatabase(_Model): + """SKU Recommendation results for Azure SQL Database. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: str or ~azure.mgmt.azurearcdata.models.RecommendationStatus + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: + list[~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem] + :ivar target_sku: + :vartype target_sku: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSku + """ + + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field( + name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + number_of_server_blocker_issues: Optional[int] = rest_field( + name="numberOfServerBlockerIssues", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of blocker issues to fix before migrating to the target platform.""" + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = rest_field( + name="monthlyCost", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly cost of the particular SKU.""" + monthly_cost_options: Optional[list["_models.SkuRecommendationResultsMonthlyCostOptionItem"]] = rest_field( + name="monthlyCostOptions", visibility=["read"] + ) + """The monthly cost for all different savings options applicable for the particular SKU.""" + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlDatabaseTargetSku"] = rest_field( + name="targetSku", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None, + number_of_server_blocker_issues: Optional[int] = None, + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = None, + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlDatabaseTargetSku"] = 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 SkuRecommendationResultsAzureSqlDatabaseTargetSku(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlDatabaseTargetSku. + + :ivar category: + :vartype category: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: maximum storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The maximum storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The maximum throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: Optional["_models.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + compute_size: Optional[int] = rest_field( + name="computeSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Compute Size in vCores.""" + storage_max_size_in_mb: Optional[float] = rest_field( + name="storageMaxSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum storage for this particular SKU, in MB.""" + predicted_data_size_in_mb: Optional[float] = rest_field( + name="predictedDataSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predicted_log_size_in_mb: Optional[float] = rest_field( + name="predictedLogSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + max_storage_iops: Optional[float] = rest_field( + name="maxStorageIops", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum storage IOPS in Azure SQL, will impact the billing cost.""" + max_throughput_m_bps: Optional[float] = rest_field( + name="maxThroughputMBps", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum throughput in Azure SQL, will impact the billing cost.""" + + @overload + def __init__( + self, + *, + category: Optional["_models.SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory"] = None, + compute_size: Optional[int] = None, + storage_max_size_in_mb: Optional[float] = None, + predicted_data_size_in_mb: Optional[float] = None, + predicted_log_size_in_mb: Optional[float] = None, + max_storage_iops: Optional[float] = None, + max_throughput_m_bps: 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 SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + compute_tier: Optional[str] = rest_field( + name="computeTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The compute tier of the target SKU.""" + hardware_type: Optional[str] = rest_field( + name="hardwareType", visibility=["read", "create", "update", "delete", "query"] + ) + """The hardware type of the target SKU.""" + sql_purchasing_model: Optional[str] = rest_field( + name="sqlPurchasingModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL purchasing model of the target SKU.""" + sql_service_tier: Optional[str] = rest_field( + name="sqlServiceTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL service tier of the target SKU.""" + zone_redundancy_available: Optional[bool] = rest_field( + name="zoneRedundancyAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if zone redundancy is available for the target SKU.""" + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = None, + hardware_type: Optional[str] = None, + sql_purchasing_model: Optional[str] = None, + sql_service_tier: Optional[str] = None, + zone_redundancy_available: Optional[bool] = 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 SkuRecommendationResultsAzureSqlManagedInstance(_Model): # pylint: disable=name-too-long + """SKU Recommendation results for Azure SQL Managed Instance. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: str or ~azure.mgmt.azurearcdata.models.RecommendationStatus + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: + list[~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem] + :ivar target_sku: + :vartype target_sku: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku + """ + + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field( + name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + number_of_server_blocker_issues: Optional[int] = rest_field( + name="numberOfServerBlockerIssues", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of blocker issues to fix before migrating to the target platform.""" + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = rest_field( + name="monthlyCost", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly cost of the particular SKU.""" + monthly_cost_options: Optional[list["_models.SkuRecommendationResultsMonthlyCostOptionItem"]] = rest_field( + name="monthlyCostOptions", visibility=["read"] + ) + """The monthly cost for all different savings options applicable for the particular SKU.""" + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku"] = rest_field( + name="targetSku", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None, + number_of_server_blocker_issues: Optional[int] = None, + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = None, + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSku"] = 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 SkuRecommendationResultsAzureSqlManagedInstanceTargetSku(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlManagedInstanceTargetSku. + + :ivar category: + :vartype category: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: maximum storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The maximum storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The maximum throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + compute_size: Optional[int] = rest_field( + name="computeSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Compute Size in vCores.""" + storage_max_size_in_mb: Optional[float] = rest_field( + name="storageMaxSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum storage for this particular SKU, in MB.""" + predicted_data_size_in_mb: Optional[float] = rest_field( + name="predictedDataSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predicted_log_size_in_mb: Optional[float] = rest_field( + name="predictedLogSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + max_storage_iops: Optional[float] = rest_field( + name="maxStorageIops", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum storage IOPS in Azure SQL, will impact the billing cost.""" + max_throughput_m_bps: Optional[float] = rest_field( + name="maxThroughputMBps", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum throughput in Azure SQL, will impact the billing cost.""" + + @overload + def __init__( + self, + *, + category: Optional["_models.SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory"] = None, + compute_size: Optional[int] = None, + storage_max_size_in_mb: Optional[float] = None, + predicted_data_size_in_mb: Optional[float] = None, + predicted_log_size_in_mb: Optional[float] = None, + max_storage_iops: Optional[float] = None, + max_throughput_m_bps: 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 SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + compute_tier: Optional[str] = rest_field( + name="computeTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The compute tier of the target SKU.""" + hardware_type: Optional[str] = rest_field( + name="hardwareType", visibility=["read", "create", "update", "delete", "query"] + ) + """The hardware type of the target SKU.""" + sql_purchasing_model: Optional[str] = rest_field( + name="sqlPurchasingModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL purchasing model of the target SKU.""" + sql_service_tier: Optional[str] = rest_field( + name="sqlServiceTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL service tier of the target SKU.""" + zone_redundancy_available: Optional[bool] = rest_field( + name="zoneRedundancyAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if zone redundancy is available for the target SKU.""" + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = None, + hardware_type: Optional[str] = None, + sql_purchasing_model: Optional[str] = None, + sql_service_tier: Optional[str] = None, + zone_redundancy_available: Optional[bool] = 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 SkuRecommendationResultsAzureSqlVirtualMachine(_Model): # pylint: disable=name-too-long + """SKU Recommendation results for Azure SQL Virtual Machine. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: str or ~azure.mgmt.azurearcdata.models.RecommendationStatus + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: + list[~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem] + :ivar target_sku: + :vartype target_sku: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku + """ + + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field( + name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + number_of_server_blocker_issues: Optional[int] = rest_field( + name="numberOfServerBlockerIssues", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of blocker issues to fix before migrating to the target platform.""" + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = rest_field( + name="monthlyCost", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly cost of the particular SKU.""" + monthly_cost_options: Optional[list["_models.SkuRecommendationResultsMonthlyCostOptionItem"]] = rest_field( + name="monthlyCostOptions", visibility=["read"] + ) + """The monthly cost for all different savings options applicable for the particular SKU.""" + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku"] = rest_field( + name="targetSku", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None, + number_of_server_blocker_issues: Optional[int] = None, + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = None, + target_sku: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSku"] = 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 SkuRecommendationResultsAzureSqlVirtualMachineTargetSku(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlVirtualMachineTargetSku. + + :ivar category: + :vartype category: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar virtual_machine_size: size parameters for VM size. + :vartype virtual_machine_size: + ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize + :ivar data_disk_sizes: Data disk sizes. + :vartype data_disk_sizes: list[~azure.mgmt.azurearcdata.models.DiskSizes] + :ivar log_disk_sizes: Log disk sizes. + :vartype log_disk_sizes: list[~azure.mgmt.azurearcdata.models.DiskSizes] + :ivar temp_db_disk_sizes: temp db disk sizes. + :vartype temp_db_disk_sizes: list[~azure.mgmt.azurearcdata.models.DiskSizes] + """ + + category: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + compute_size: Optional[int] = rest_field( + name="computeSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Compute Size in vCores.""" + predicted_data_size_in_mb: Optional[float] = rest_field( + name="predictedDataSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predicted_log_size_in_mb: Optional[float] = rest_field( + name="predictedLogSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + virtual_machine_size: Optional[ + "_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize" + ] = rest_field(name="virtualMachineSize", visibility=["read", "create", "update", "delete", "query"]) + """size parameters for VM size.""" + data_disk_sizes: Optional[list["_models.DiskSizes"]] = rest_field( + name="dataDiskSizes", visibility=["read", "create", "update", "delete", "query"] + ) + """Data disk sizes.""" + log_disk_sizes: Optional[list["_models.DiskSizes"]] = rest_field( + name="logDiskSizes", visibility=["read", "create", "update", "delete", "query"] + ) + """Log disk sizes.""" + temp_db_disk_sizes: Optional[list["_models.DiskSizes"]] = rest_field( + name="tempDbDiskSizes", visibility=["read", "create", "update", "delete", "query"] + ) + """temp db disk sizes.""" + + @overload + def __init__( + self, + *, + category: Optional["_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory"] = None, + compute_size: Optional[int] = None, + predicted_data_size_in_mb: Optional[float] = None, + predicted_log_size_in_mb: Optional[float] = None, + virtual_machine_size: Optional[ + "_models.SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize" + ] = None, + data_disk_sizes: Optional[list["_models.DiskSizes"]] = None, + log_disk_sizes: Optional[list["_models.DiskSizes"]] = None, + temp_db_disk_sizes: Optional[list["_models.DiskSizes"]] = 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 SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory(_Model): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory. + + :ivar available_vm_skus: Available VM SKUs for the Azure SQL Virtual Machine. + :vartype available_vm_skus: list[str] + :ivar virtual_machine_family: The virtual machine family of the target SKU. + :vartype virtual_machine_family: str + """ + + available_vm_skus: Optional[list[str]] = rest_field( + name="availableVmSkus", visibility=["read", "create", "update", "delete", "query"] + ) + """Available VM SKUs for the Azure SQL Virtual Machine.""" + virtual_machine_family: Optional[str] = rest_field( + name="virtualMachineFamily", visibility=["read", "create", "update", "delete", "query"] + ) + """The virtual machine family of the target SKU.""" + + @overload + def __init__( + self, + *, + available_vm_skus: Optional[list[str]] = None, + virtual_machine_family: 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 SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize( + _Model +): # pylint: disable=name-too-long + """size parameters for VM size. + + :ivar virtual_machine_family: Virtual Machine Family, for example : standardMSFamily. + :vartype virtual_machine_family: str + :ivar size_name: VM Size, for example : M64ls. + :vartype size_name: str + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar azure_sku_name: Virtual Machine SKU name,: Eg : Standard_F16s. + :vartype azure_sku_name: str + :ivar v_cpus_available: Available vCores. This can be less than the vCores in the Constrained + vCPU VM Sizes. + :vartype v_cpus_available: int + :ivar max_network_interfaces: maximum network interfaces. + :vartype max_network_interfaces: int + """ + + virtual_machine_family: Optional[str] = rest_field( + name="virtualMachineFamily", visibility=["read", "create", "update", "delete", "query"] + ) + """Virtual Machine Family, for example : standardMSFamily.""" + size_name: Optional[str] = rest_field(name="sizeName", visibility=["read", "create", "update", "delete", "query"]) + """VM Size, for example : M64ls.""" + compute_size: Optional[int] = rest_field( + name="computeSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Compute Size in vCores.""" + azure_sku_name: Optional[str] = rest_field( + name="azureSkuName", visibility=["read", "create", "update", "delete", "query"] + ) + """Virtual Machine SKU name,: Eg : Standard_F16s.""" + v_cpus_available: Optional[int] = rest_field( + name="vCPUsAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """Available vCores. This can be less than the vCores in the Constrained vCPU VM Sizes.""" + max_network_interfaces: Optional[int] = rest_field( + name="maxNetworkInterfaces", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum network interfaces.""" + + @overload + def __init__( + self, + *, + virtual_machine_family: Optional[str] = None, + size_name: Optional[str] = None, + compute_size: Optional[int] = None, + azure_sku_name: Optional[str] = None, + v_cpus_available: Optional[int] = None, + max_network_interfaces: Optional[int] = 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 SkuRecommendationResultsMonthlyCost(_Model): + """The monthly cost of the particular SKU. + + :ivar compute_cost: Represents the Cost of Compute. + :vartype compute_cost: float + :ivar storage_cost: Represents the Cost of Storage. + :vartype storage_cost: float + :ivar iops_cost: Represents the Cost of IOPS. + :vartype iops_cost: float + :ivar sql_license_cost: Represents the Cost of SQL license. + :vartype sql_license_cost: float + :ivar windows_license_cost: Represents the Cost of Windows license. + :vartype windows_license_cost: float + :ivar total_cost: Represents the Total Cost. + :vartype total_cost: float + """ + + compute_cost: Optional[float] = rest_field( + name="computeCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of Compute.""" + storage_cost: Optional[float] = rest_field( + name="storageCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of Storage.""" + iops_cost: Optional[float] = rest_field(name="iopsCost", visibility=["read", "create", "update", "delete", "query"]) + """Represents the Cost of IOPS.""" + sql_license_cost: Optional[float] = rest_field( + name="sqlLicenseCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of SQL license.""" + windows_license_cost: Optional[float] = rest_field( + name="windowsLicenseCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Cost of Windows license.""" + total_cost: Optional[float] = rest_field( + name="totalCost", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the Total Cost.""" + + @overload + def __init__( + self, + *, + compute_cost: Optional[float] = None, + storage_cost: Optional[float] = None, + iops_cost: Optional[float] = None, + sql_license_cost: Optional[float] = None, + windows_license_cost: Optional[float] = None, + total_cost: 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 SkuRecommendationResultsMonthlyCostOptionItem(_Model): # pylint: disable=name-too-long + """The monthly cost values for this saving option combination for the particular SKU. + + :ivar key_name: The unique combination of saving options for a price e.g. With1YearASPAndProd. + :vartype key_name: str + :ivar key_value: The Monthly cost of the particular SKU. + :vartype key_value: ~azure.mgmt.azurearcdata.models.CostTypeValues + """ + + key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"]) + """The unique combination of saving options for a price e.g. With1YearASPAndProd.""" + key_value: Optional["_models.CostTypeValues"] = rest_field( + name="keyValue", visibility=["read", "create", "update", "delete", "query"] + ) + """The Monthly cost of the particular SKU.""" + + @overload + def __init__( + self, + *, + key_name: Optional[str] = None, + key_value: Optional["_models.CostTypeValues"] = 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 SkuRecommendationSummary(_Model): + """The SKU recommendation summary. + + :ivar num_of_blocker_issues: Number of blocker issues to fix before migrating this database to + the target platform. + :vartype num_of_blocker_issues: int + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: str or ~azure.mgmt.azurearcdata.models.RecommendationStatus + :ivar impacted_objects_summary: + :vartype impacted_objects_summary: list[~azure.mgmt.azurearcdata.models.ImpactedObjectsInfo] + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: ~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCost + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: + list[~azure.mgmt.azurearcdata.models.SkuRecommendationResultsMonthlyCostOptionItem] + :ivar target_sku: + :vartype target_sku: ~azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSku + """ + + num_of_blocker_issues: Optional[int] = rest_field( + name="numOfBlockerIssues", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of blocker issues to fix before migrating this database to the target platform.""" + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = rest_field( + name="recommendationStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + impacted_objects_summary: Optional[list["_models.ImpactedObjectsInfo"]] = rest_field( + name="impactedObjectsSummary", visibility=["read"] + ) + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = rest_field( + name="monthlyCost", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly cost of the particular SKU.""" + monthly_cost_options: Optional[list["_models.SkuRecommendationResultsMonthlyCostOptionItem"]] = rest_field( + name="monthlyCostOptions", visibility=["read"] + ) + """The monthly cost for all different savings options applicable for the particular SKU.""" + target_sku: Optional["_models.SkuRecommendationSummaryTargetSku"] = rest_field( + name="targetSku", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + num_of_blocker_issues: Optional[int] = None, + recommendation_status: Optional[Union[str, "_models.RecommendationStatus"]] = None, + monthly_cost: Optional["_models.SkuRecommendationResultsMonthlyCost"] = None, + target_sku: Optional["_models.SkuRecommendationSummaryTargetSku"] = 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 SkuRecommendationSummaryTargetSku(_Model): + """SkuRecommendationSummaryTargetSku. + + :ivar category: + :vartype category: ~azure.mgmt.azurearcdata.models.SkuRecommendationSummaryTargetSkuCategory + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: max storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The max storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The max throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: Optional["_models.SkuRecommendationSummaryTargetSkuCategory"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + compute_size: Optional[int] = rest_field( + name="computeSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Compute Size in vCores.""" + storage_max_size_in_mb: Optional[float] = rest_field( + name="storageMaxSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """max storage for this particular SKU, in MB.""" + predicted_data_size_in_mb: Optional[float] = rest_field( + name="predictedDataSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predicted_log_size_in_mb: Optional[float] = rest_field( + name="predictedLogSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + max_storage_iops: Optional[float] = rest_field( + name="maxStorageIops", visibility=["read", "create", "update", "delete", "query"] + ) + """The max storage IOPS in Azure SQL, will impact the billing cost.""" + max_throughput_m_bps: Optional[float] = rest_field( + name="maxThroughputMBps", visibility=["read", "create", "update", "delete", "query"] + ) + """The max throughput in Azure SQL, will impact the billing cost.""" + + @overload + def __init__( + self, + *, + category: Optional["_models.SkuRecommendationSummaryTargetSkuCategory"] = None, + compute_size: Optional[int] = None, + storage_max_size_in_mb: Optional[float] = None, + predicted_data_size_in_mb: Optional[float] = None, + predicted_log_size_in_mb: Optional[float] = None, + max_storage_iops: Optional[float] = None, + max_throughput_m_bps: 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 SkuRecommendationSummaryTargetSkuCategory(_Model): # pylint: disable=name-too-long + """SkuRecommendationSummaryTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + compute_tier: Optional[str] = rest_field( + name="computeTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The compute tier of the target SKU.""" + hardware_type: Optional[str] = rest_field( + name="hardwareType", visibility=["read", "create", "update", "delete", "query"] + ) + """The hardware type of the target SKU.""" + sql_purchasing_model: Optional[str] = rest_field( + name="sqlPurchasingModel", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL purchasing model of the target SKU.""" + sql_service_tier: Optional[str] = rest_field( + name="sqlServiceTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL service tier of the target SKU.""" + zone_redundancy_available: Optional[bool] = rest_field( + name="zoneRedundancyAvailable", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if zone redundancy is available for the target SKU.""" + + @overload + def __init__( + self, + *, + compute_tier: Optional[str] = None, + hardware_type: Optional[str] = None, + sql_purchasing_model: Optional[str] = None, + sql_service_tier: Optional[str] = None, + zone_redundancy_available: Optional[bool] = 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 SqlAvailabilityGroupDatabaseReplicaResourceProperties(_Model): # pylint: disable=name-too-long + """The properties of Arc Sql availability group database replica resource. + + :ivar database_name: the database name. + :vartype database_name: str + :ivar replica_name: the database replica name. + :vartype replica_name: str + :ivar is_local: Whether the availability database is local. + :vartype is_local: bool + :ivar is_primary_replica: Returns 1 if the replica is primary, or 0 if it is a secondary + replica. + :vartype is_primary_replica: bool + :ivar synchronization_state_description: Description of the data-movement state. + :vartype synchronization_state_description: str + :ivar is_commit_participant: Whether this replica is transaction committer. + :vartype is_commit_participant: bool + :ivar synchronization_health_description: Description of the health of database. + :vartype synchronization_health_description: str + :ivar database_state_description: Description of the database state of the availability + replica. + :vartype database_state_description: str + :ivar is_suspended: Whether this data movement is suspended. + :vartype is_suspended: bool + :ivar suspend_reason_description: Description of the database suspended state reason. + :vartype suspend_reason_description: str + """ + + database_name: Optional[str] = rest_field( + name="databaseName", visibility=["read", "create", "update", "delete", "query"] + ) + """the database name.""" + replica_name: Optional[str] = rest_field(name="replicaName", visibility=["read"]) + """the database replica name.""" + is_local: Optional[bool] = rest_field(name="isLocal", visibility=["read"]) + """Whether the availability database is local.""" + is_primary_replica: Optional[bool] = rest_field(name="isPrimaryReplica", visibility=["read"]) + """Returns 1 if the replica is primary, or 0 if it is a secondary replica.""" + synchronization_state_description: Optional[str] = rest_field( + name="synchronizationStateDescription", visibility=["read"] + ) + """Description of the data-movement state.""" + is_commit_participant: Optional[bool] = rest_field(name="isCommitParticipant", visibility=["read"]) + """Whether this replica is transaction committer.""" + synchronization_health_description: Optional[str] = rest_field( + name="synchronizationHealthDescription", visibility=["read"] + ) + """Description of the health of database.""" + database_state_description: Optional[str] = rest_field(name="databaseStateDescription", visibility=["read"]) + """Description of the database state of the availability replica.""" + is_suspended: Optional[bool] = rest_field(name="isSuspended", visibility=["read"]) + """Whether this data movement is suspended.""" + suspend_reason_description: Optional[str] = rest_field(name="suspendReasonDescription", visibility=["read"]) + """Description of the database suspended state reason.""" + + @overload + def __init__( + self, + *, + database_name: 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 SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem(_Model): # pylint: disable=name-too-long + """SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem. + + :ivar ip_address: IPV4 address. + :vartype ip_address: str + :ivar mask: IPV4 netmask. + :vartype mask: str + """ + + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) + """IPV4 address.""" + mask: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """IPV4 netmask.""" + + @overload + def __init__( + self, + *, + ip_address: Optional[str] = None, + mask: 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 SqlAvailabilityGroupReplicaResourceProperties(_Model): # pylint: disable=name-too-long + """The properties of Arc Sql availability group replica resource. + + :ivar replica_id: ID GUID of the availability group. + :vartype replica_id: str + :ivar replica_name: The replica name. + :vartype replica_name: str + :ivar replica_resource_id: Resource id of this replica. This is required for a distributed + availability group, in which case it describes the location of the availability group that + hosts one replica in the DAG. In a non-distributed availability group this field is optional + but can be used to store the Azure resource id for AG. + :vartype replica_resource_id: str + :ivar configure: null. + :vartype configure: ~azure.mgmt.azurearcdata.models.AvailabilityGroupConfigure + :ivar state: null. + :vartype state: ~azure.mgmt.azurearcdata.models.AvailabilityGroupState + """ + + replica_id: Optional[str] = rest_field(name="replicaId", visibility=["read"]) + """ID GUID of the availability group.""" + replica_name: Optional[str] = rest_field( + name="replicaName", visibility=["read", "create", "update", "delete", "query"] + ) + """The replica name.""" + replica_resource_id: Optional[str] = rest_field( + name="replicaResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource id of this replica. This is required for a distributed availability group, in which + case it describes the location of the availability group that hosts one replica in the DAG. In + a non-distributed availability group this field is optional but can be used to store the Azure + resource id for AG.""" + configure: Optional["_models.AvailabilityGroupConfigure"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + state: Optional["_models.AvailabilityGroupState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + replica_name: Optional[str] = None, + replica_resource_id: Optional[str] = None, + configure: Optional["_models.AvailabilityGroupConfigure"] = None, + state: Optional["_models.AvailabilityGroupState"] = 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 SqlAvailabilityGroupStaticIPListenerProperties(_Model): # pylint: disable=name-too-long + """The properties of a static IP Arc Sql availability group listener. + + :ivar dns_name: the DNS name for the listener. + :vartype dns_name: str + :ivar ip_v4_addresses_and_masks: IP V4 Addresses and masks for the listener. + :vartype ip_v4_addresses_and_masks: + list[~azure.mgmt.azurearcdata.models.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem] + :ivar ip_v6_addresses: IP V6 Addresses for the listener. + :vartype ip_v6_addresses: list[str] + :ivar port: Network port for the listener. Default is 1433. + :vartype port: int + """ + + dns_name: Optional[str] = rest_field(name="dnsName", visibility=["read", "create", "update", "delete", "query"]) + """the DNS name for the listener.""" + ip_v4_addresses_and_masks: Optional[list["_models.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem"]] = ( + rest_field(name="ipV4AddressesAndMasks", visibility=["read", "create", "update", "delete", "query"]) + ) + """IP V4 Addresses and masks for the listener.""" + ip_v6_addresses: Optional[list[str]] = rest_field( + name="ipV6Addresses", visibility=["read", "create", "update", "delete", "query"] + ) + """IP V6 Addresses for the listener.""" + port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Network port for the listener. Default is 1433.""" + + @overload + def __init__( + self, + *, + dns_name: Optional[str] = None, + ip_v4_addresses_and_masks: Optional[ + list["_models.SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem"] + ] = None, + ip_v6_addresses: Optional[list[str]] = None, + port: Optional[int] = 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 SqlManagedInstance(TrackedResource): + """A SqlManagedInstance. + + :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.azurearcdata.models.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: null. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation + :ivar sku: Resource sku. + :vartype sku: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSku + """ + + properties: "_models.SqlManagedInstanceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null. Required.""" + extended_location: Optional["_models.ExtendedLocation"] = rest_field( + name="extendedLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The extendedLocation of the resource.""" + sku: Optional["_models.SqlManagedInstanceSku"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource sku.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.SqlManagedInstanceProperties", + tags: Optional[dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + sku: Optional["_models.SqlManagedInstanceSku"] = 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 SqlManagedInstanceK8SRaw(_Model): + """The raw kubernetes information. + + :ivar spec: The kubernetes spec information. + :vartype spec: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec + """ + + spec: Optional["_models.SqlManagedInstanceK8SSpec"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes spec information.""" + + @overload + def __init__( + self, + *, + spec: Optional["_models.SqlManagedInstanceK8SSpec"] = 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 SqlManagedInstanceK8SSpec(_Model): + """The kubernetes spec information. + + :ivar scheduling: The kubernetes scheduling information. + :vartype scheduling: ~azure.mgmt.azurearcdata.models.K8SScheduling + :ivar replicas: This option specifies the number of SQL Managed Instance replicas that will be + deployed in your Kubernetes cluster for high availability purposes. If sku.tier is + BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is + GeneralPurpose, replicas must be '1'. + :vartype replicas: int + :ivar security: The kubernetes security information. + :vartype security: ~azure.mgmt.azurearcdata.models.K8SSecurity + :ivar settings: The kubernetes settings information. + :vartype settings: ~azure.mgmt.azurearcdata.models.K8SSettings + """ + + scheduling: Optional["_models.K8SScheduling"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The kubernetes scheduling information.""" + replicas: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """This option specifies the number of SQL Managed Instance replicas that will be deployed in your + Kubernetes cluster for high availability purposes. If sku.tier is BusinessCritical, allowed + values are '2' or '3' with default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'.""" + security: Optional["_models.K8SSecurity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kubernetes security information.""" + settings: Optional["_models.K8SSettings"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The kubernetes settings information.""" + + @overload + def __init__( + self, + *, + scheduling: Optional["_models.K8SScheduling"] = None, + replicas: Optional[int] = None, + security: Optional["_models.K8SSecurity"] = None, + settings: Optional["_models.K8SSettings"] = 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 SqlManagedInstanceProperties(_Model): + """Properties of sqlManagedInstance. + + :ivar data_controller_id: null. + :vartype data_controller_id: str + :ivar admin: The instance admin user. + :vartype admin: str + :ivar start_time: The instance start time. + :vartype start_time: str + :ivar end_time: The instance end time. + :vartype end_time: str + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw + :ivar basic_login_information: Username and password for basic authentication. + :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: ~datetime.datetime + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Managed Instance + resource. + :vartype provisioning_state: str + :ivar active_directory_information: Active Directory information related to this SQL Managed + Instance. + :vartype active_directory_information: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryInformation + :ivar license_type: The license type to apply for this managed instance. Known values are: + "BasePrice", "LicenseIncluded", and "DisasterRecovery". + :vartype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType + :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :vartype cluster_id: str + :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :vartype extension_id: str + """ + + data_controller_id: Optional[str] = rest_field( + name="dataControllerId", visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + admin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The instance admin user.""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """The instance start time.""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"]) + """The instance end time.""" + k8_s_raw: Optional["_models.SqlManagedInstanceK8SRaw"] = rest_field( + name="k8sRaw", visibility=["read", "create", "update", "delete", "query"] + ) + """The raw kubernetes information.""" + basic_login_information: Optional["_models.BasicLoginInformation"] = rest_field( + name="basicLoginInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Username and password for basic authentication.""" + last_uploaded_date: Optional[datetime.datetime] = rest_field( + name="lastUploadedDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc-enabled SQL Managed Instance resource.""" + active_directory_information: Optional["_models.ActiveDirectoryInformation"] = rest_field( + name="activeDirectoryInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Active Directory information related to this SQL Managed Instance.""" + license_type: Optional[Union[str, "_models.ArcSqlManagedInstanceLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to apply for this managed instance. Known values are: \"BasePrice\", + \"LicenseIncluded\", and \"DisasterRecovery\".""" + cluster_id: Optional[str] = rest_field(name="clusterId", visibility=["read", "create", "update", "delete", "query"]) + """If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom + location belongs to.""" + extension_id: Optional[str] = rest_field( + name="extensionId", visibility=["read", "create", "update", "delete", "query"] + ) + """If a CustomLocation is provided, this contains the ARM id of the extension the custom location + belongs to.""" + + @overload + def __init__( + self, + *, + data_controller_id: Optional[str] = None, + admin: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + k8_s_raw: Optional["_models.SqlManagedInstanceK8SRaw"] = None, + basic_login_information: Optional["_models.BasicLoginInformation"] = None, + last_uploaded_date: Optional[datetime.datetime] = None, + active_directory_information: Optional["_models.ActiveDirectoryInformation"] = None, + license_type: Optional[Union[str, "_models.ArcSqlManagedInstanceLicenseType"]] = None, + cluster_id: Optional[str] = None, + extension_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 SqlManagedInstanceSku(_Model): + """The resource model definition representing SKU for Azure Managed Instance - Azure Arc. + + :ivar name: The name of the SKU. Required. Default value is "vCore". + :vartype name: str + :ivar tier: The pricing tier for the instance. Known values are: "GeneralPurpose" and + "BusinessCritical". + :vartype tier: str or ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: The SKU family. + :vartype family: str + :ivar capacity: The SKU capacity. + :vartype capacity: int + """ + + name: Literal["vCore"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU. Required. Default value is \"vCore\".""" + tier: Optional[Union[str, "_models.SqlManagedInstanceSkuTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The pricing tier for the instance. Known values are: \"GeneralPurpose\" and + \"BusinessCritical\".""" + dev: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether dev/test is enabled. When the dev field is set to true, the resource is used for + dev/test purpose.""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU family.""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU capacity.""" + + @overload + def __init__( + self, + *, + tier: Optional[Union[str, "_models.SqlManagedInstanceSkuTier"]] = None, + dev: Optional[bool] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = 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) + self.name: Literal["vCore"] = "vCore" + + +class SqlManagedInstanceUpdate(_Model): + """An update to a SQL Managed Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, 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 SqlServerAvailabilityGroupResource(TrackedResource): + """Arc Sql Server Availability 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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurearcdata.models.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: Properties of Arc Sql Server availability group. Required. + :vartype properties: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourceProperties + """ + + properties: "_models.SqlServerAvailabilityGroupResourceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of Arc Sql Server availability group. Required.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.SqlServerAvailabilityGroupResourceProperties", + tags: Optional[dict[str, 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 SqlServerAvailabilityGroupResourceProperties(_Model): # pylint: disable=name-too-long + """The properties of Arc Sql Server availability group resource. + + :ivar availability_group_id: ID GUID of the availability group. + :vartype availability_group_id: str + :ivar server_name: the SQL server name. + :vartype server_name: str + :ivar instance_name: the SQL Server Instance name. + :vartype instance_name: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar collection_timestamp: Timestamp for when the data was collected from the client machine. + :vartype collection_timestamp: ~datetime.datetime + :ivar info: Availability Group Info. + :vartype info: ~azure.mgmt.azurearcdata.models.AvailabilityGroupInfo + :ivar replicas: A list of Availability Group Replicas. + :vartype replicas: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesReplicas + :ivar databases: A list of Availability Group Database Replicas. + :vartype databases: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourcePropertiesDatabases + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server availability + group resource. + :vartype provisioning_state: str + """ + + availability_group_id: Optional[str] = rest_field(name="availabilityGroupId", visibility=["read"]) + """ID GUID of the availability group.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """the SQL server name.""" + instance_name: Optional[str] = rest_field(name="instanceName", visibility=["read"]) + """the SQL Server Instance name.""" + vm_id: Optional[str] = rest_field(name="vmId", visibility=["read"]) + """The unique ID of the hybrid machine that this resource belongs to.""" + collection_timestamp: Optional[datetime.datetime] = rest_field( + name="collectionTimestamp", visibility=["read"], format="rfc3339" + ) + """Timestamp for when the data was collected from the client machine.""" + info: Optional["_models.AvailabilityGroupInfo"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Availability Group Info.""" + replicas: Optional["_models.SqlServerAvailabilityGroupResourcePropertiesReplicas"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of Availability Group Replicas.""" + databases: Optional["_models.SqlServerAvailabilityGroupResourcePropertiesDatabases"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of Availability Group Database Replicas.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc-enabled SQL Server availability group resource.""" + + @overload + def __init__( + self, + *, + info: Optional["_models.AvailabilityGroupInfo"] = None, + replicas: Optional["_models.SqlServerAvailabilityGroupResourcePropertiesReplicas"] = None, + databases: Optional["_models.SqlServerAvailabilityGroupResourcePropertiesDatabases"] = 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 SqlServerAvailabilityGroupResourcePropertiesDatabases(_Model): # pylint: disable=name-too-long + """A list of Availability Group Database Replicas. + + :ivar value: Array of Availability Group Database Replicas. + :vartype value: + list[~azure.mgmt.azurearcdata.models.SqlAvailabilityGroupDatabaseReplicaResourceProperties] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + value: Optional[list["_models.SqlAvailabilityGroupDatabaseReplicaResourceProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Array of Availability Group Database Replicas.""" + next_link: Optional[str] = rest_field(name="nextLink", visibility=["read"]) + """Link to retrieve next page of results.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.SqlAvailabilityGroupDatabaseReplicaResourceProperties"]] = 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 SqlServerAvailabilityGroupResourcePropertiesReplicas(_Model): # pylint: disable=name-too-long + """A list of Availability Group Replicas. + + :ivar value: Array of Availability Group Replicas. + :vartype value: + list[~azure.mgmt.azurearcdata.models.SqlAvailabilityGroupReplicaResourceProperties] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + value: Optional[list["_models.SqlAvailabilityGroupReplicaResourceProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Array of Availability Group Replicas.""" + next_link: Optional[str] = rest_field(name="nextLink", visibility=["read"]) + """Link to retrieve next page of results.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.SqlAvailabilityGroupReplicaResourceProperties"]] = 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 SqlServerAvailabilityGroupUpdate(_Model): + """An update to availability group resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The Server Availability Group's properties. + :vartype properties: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResourceProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SqlServerAvailabilityGroupResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Server Availability Group's properties.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerAvailabilityGroupResourceProperties"] = 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 SqlServerDatabaseResource(TrackedResource): + """Arc Sql Server database. + + :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.azurearcdata.models.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: Properties of Arc Sql Server database. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResourceProperties + """ + + properties: "_models.SqlServerDatabaseResourceProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of Arc Sql Server database. Required.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.SqlServerDatabaseResourceProperties", + tags: Optional[dict[str, 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 SqlServerDatabaseResourceProperties(_Model): + """The properties of Arc Sql Server database resource. + + :ivar collation_name: Collation of the database. + :vartype collation_name: str + :ivar database_creation_date: Creation date of the database. + :vartype database_creation_date: ~datetime.datetime + :ivar compatibility_level: Compatibility level of the database. + :vartype compatibility_level: int + :ivar size_mb: Size of the database. + :vartype size_mb: float + :ivar log_file_size_mb: Total size in MB for the log (ldf) files for this database. + :vartype log_file_size_mb: float + :ivar data_file_size_mb: Total size in MB for the data (mdf and ndf) files for this database. + :vartype data_file_size_mb: float + :ivar space_available_mb: Space left of the database. + :vartype space_available_mb: float + :ivar state: State of the database. Known values are: "Online", "Restoring", "Recovering", + "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", and "OfflineSecondary". + :vartype state: str or ~azure.mgmt.azurearcdata.models.DatabaseState + :ivar is_read_only: Whether the database is read only or not. + :vartype is_read_only: bool + :ivar recovery_mode: Status of the database. Known values are: "Full", "Bulk-logged", and + "Simple". + :vartype recovery_mode: str or ~azure.mgmt.azurearcdata.models.RecoveryMode + :ivar database_options: List of features that are enabled for the database. + :vartype database_options: + ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesDatabaseOptions + :ivar backup_information: + :vartype backup_information: + ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResourcePropertiesBackupInformation + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: ~azure.mgmt.azurearcdata.models.BackupPolicy + :ivar earliest_restore_date: This records the earliest start date and time that restore is + available for this database (ISO8601 format). + :vartype earliest_restore_date: ~datetime.datetime + :ivar create_mode: Database create mode. PointInTimeRestore: Create a database by restoring a + point in time backup of an existing database. sourceDatabaseId and restorePointInTime must be + specified. Known values are: "Default" and "PointInTimeRestore". + :vartype create_mode: str or ~azure.mgmt.azurearcdata.models.DatabaseCreateMode + :ivar source_database_id: The name of the source database associated with create operation of + this database. + :vartype source_database_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is + required. Specifies the point in time (ISO8601 format) of the source database that will be + restored to create the new database. + :vartype restore_point_in_time: ~datetime.datetime + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server database + resource. + :vartype provisioning_state: str + :ivar last_database_upload_time: The time when last successful database upload was performed. + :vartype last_database_upload_time: ~datetime.datetime + :ivar migration: Migration related configuration. + :vartype migration: ~azure.mgmt.azurearcdata.models.DataBaseMigration + """ + + collation_name: Optional[str] = rest_field(name="collationName", visibility=["read", "create"]) + """Collation of the database.""" + database_creation_date: Optional[datetime.datetime] = rest_field( + name="databaseCreationDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Creation date of the database.""" + compatibility_level: Optional[int] = rest_field( + name="compatibilityLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Compatibility level of the database.""" + size_mb: Optional[float] = rest_field(name="sizeMB", visibility=["read", "create", "update", "delete", "query"]) + """Size of the database.""" + log_file_size_mb: Optional[float] = rest_field( + name="logFileSizeMB", visibility=["read", "create", "update", "delete", "query"] + ) + """Total size in MB for the log (ldf) files for this database.""" + data_file_size_mb: Optional[float] = rest_field( + name="dataFileSizeMB", visibility=["read", "create", "update", "delete", "query"] + ) + """Total size in MB for the data (mdf and ndf) files for this database.""" + space_available_mb: Optional[float] = rest_field( + name="spaceAvailableMB", visibility=["read", "create", "update", "delete", "query"] + ) + """Space left of the database.""" + state: Optional[Union[str, "_models.DatabaseState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """State of the database. Known values are: \"Online\", \"Restoring\", \"Recovering\", + \"RecoveryPending\", \"Suspect\", \"Emergency\", \"Offline\", \"Copying\", and + \"OfflineSecondary\".""" + is_read_only: Optional[bool] = rest_field( + name="isReadOnly", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the database is read only or not.""" + recovery_mode: Optional[Union[str, "_models.RecoveryMode"]] = rest_field( + name="recoveryMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Status of the database. Known values are: \"Full\", \"Bulk-logged\", and \"Simple\".""" + database_options: Optional["_models.SqlServerDatabaseResourcePropertiesDatabaseOptions"] = rest_field( + name="databaseOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """List of features that are enabled for the database.""" + backup_information: Optional["_models.SqlServerDatabaseResourcePropertiesBackupInformation"] = rest_field( + name="backupInformation", visibility=["read", "create", "update", "delete", "query"] + ) + backup_policy: Optional["_models.BackupPolicy"] = rest_field( + name="backupPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The backup profile for the SQL server.""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """This records the earliest start date and time that restore is available for this database + (ISO8601 format).""" + create_mode: Optional[Union[str, "_models.DatabaseCreateMode"]] = rest_field( + name="createMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Database create mode. PointInTimeRestore: Create a database by restoring a point in time backup + of an existing database. sourceDatabaseId and restorePointInTime must be specified. Known + values are: \"Default\" and \"PointInTimeRestore\".""" + source_database_id: Optional[str] = rest_field( + name="sourceDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the source database associated with create operation of this database.""" + vm_id: Optional[str] = rest_field(name="vmId", visibility=["read"]) + """The unique ID of the hybrid machine that this resource belongs to.""" + restore_point_in_time: Optional[datetime.datetime] = rest_field( + name="restorePointInTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point + in time (ISO8601 format) of the source database that will be restored to create the new + database.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc-enabled SQL Server database resource.""" + last_database_upload_time: Optional[datetime.datetime] = rest_field( + name="lastDatabaseUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when last successful database upload was performed.""" + migration: Optional["_models.DataBaseMigration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Migration related configuration.""" + + @overload + def __init__( + self, + *, + collation_name: Optional[str] = None, + database_creation_date: Optional[datetime.datetime] = None, + compatibility_level: Optional[int] = None, + size_mb: Optional[float] = None, + log_file_size_mb: Optional[float] = None, + data_file_size_mb: Optional[float] = None, + space_available_mb: Optional[float] = None, + state: Optional[Union[str, "_models.DatabaseState"]] = None, + is_read_only: Optional[bool] = None, + recovery_mode: Optional[Union[str, "_models.RecoveryMode"]] = None, + database_options: Optional["_models.SqlServerDatabaseResourcePropertiesDatabaseOptions"] = None, + backup_information: Optional["_models.SqlServerDatabaseResourcePropertiesBackupInformation"] = None, + backup_policy: Optional["_models.BackupPolicy"] = None, + create_mode: Optional[Union[str, "_models.DatabaseCreateMode"]] = None, + source_database_id: Optional[str] = None, + restore_point_in_time: Optional[datetime.datetime] = None, + migration: Optional["_models.DataBaseMigration"] = 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 SqlServerDatabaseResourcePropertiesBackupInformation(_Model): # pylint: disable=name-too-long + """SqlServerDatabaseResourcePropertiesBackupInformation. + + :ivar last_full_backup: Date time of last full backup. + :vartype last_full_backup: ~datetime.datetime + :ivar last_log_backup: Date time of last log backup. + :vartype last_log_backup: ~datetime.datetime + """ + + last_full_backup: Optional[datetime.datetime] = rest_field( + name="lastFullBackup", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Date time of last full backup.""" + last_log_backup: Optional[datetime.datetime] = rest_field( + name="lastLogBackup", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Date time of last log backup.""" + + @overload + def __init__( + self, + *, + last_full_backup: Optional[datetime.datetime] = None, + last_log_backup: Optional[datetime.datetime] = 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 SqlServerDatabaseResourcePropertiesDatabaseOptions(_Model): # pylint: disable=name-too-long + """List of features that are enabled for the database. + + :ivar is_auto_close_on: + :vartype is_auto_close_on: bool + :ivar is_auto_shrink_on: + :vartype is_auto_shrink_on: bool + :ivar is_auto_create_stats_on: + :vartype is_auto_create_stats_on: bool + :ivar is_auto_update_stats_on: + :vartype is_auto_update_stats_on: bool + :ivar is_remote_data_archive_enabled: + :vartype is_remote_data_archive_enabled: bool + :ivar is_memory_optimization_enabled: + :vartype is_memory_optimization_enabled: bool + :ivar is_encrypted: + :vartype is_encrypted: bool + :ivar is_trustworthy_on: + :vartype is_trustworthy_on: bool + :ivar is_hekaton_files_on: Whether the database uses the In-Memory OLTP feature for storing + in-memory objects. + :vartype is_hekaton_files_on: bool + :ivar number_of_hekaton_files: How many Hekaton files the DB has on disk, if it uses in-memory + OLTP objects. + :vartype number_of_hekaton_files: int + """ + + is_auto_close_on: Optional[bool] = rest_field( + name="isAutoCloseOn", visibility=["read", "create", "update", "delete", "query"] + ) + is_auto_shrink_on: Optional[bool] = rest_field( + name="isAutoShrinkOn", visibility=["read", "create", "update", "delete", "query"] + ) + is_auto_create_stats_on: Optional[bool] = rest_field( + name="isAutoCreateStatsOn", visibility=["read", "create", "update", "delete", "query"] + ) + is_auto_update_stats_on: Optional[bool] = rest_field( + name="isAutoUpdateStatsOn", visibility=["read", "create", "update", "delete", "query"] + ) + is_remote_data_archive_enabled: Optional[bool] = rest_field( + name="isRemoteDataArchiveEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + is_memory_optimization_enabled: Optional[bool] = rest_field( + name="isMemoryOptimizationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + is_encrypted: Optional[bool] = rest_field( + name="isEncrypted", visibility=["read", "create", "update", "delete", "query"] + ) + is_trustworthy_on: Optional[bool] = rest_field( + name="isTrustworthyOn", visibility=["read", "create", "update", "delete", "query"] + ) + is_hekaton_files_on: Optional[bool] = rest_field( + name="isHekatonFilesOn", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the database uses the In-Memory OLTP feature for storing in-memory objects.""" + number_of_hekaton_files: Optional[int] = rest_field( + name="numberOfHekatonFiles", visibility=["read", "create", "update", "delete", "query"] + ) + """How many Hekaton files the DB has on disk, if it uses in-memory OLTP objects.""" + + @overload + def __init__( + self, + *, + is_auto_close_on: Optional[bool] = None, + is_auto_shrink_on: Optional[bool] = None, + is_auto_create_stats_on: Optional[bool] = None, + is_auto_update_stats_on: Optional[bool] = None, + is_remote_data_archive_enabled: Optional[bool] = None, + is_memory_optimization_enabled: Optional[bool] = None, + is_encrypted: Optional[bool] = None, + is_trustworthy_on: Optional[bool] = None, + is_hekaton_files_on: Optional[bool] = None, + number_of_hekaton_files: Optional[int] = 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 SqlServerDatabaseUpdate(_Model): + """An update to database resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The data controller's properties. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResourceProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SqlServerDatabaseResourceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The data controller's properties.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerDatabaseResourceProperties"] = 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 SqlServerEsuLicense(TrackedResource): + """Describe SQL Server ESU license 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.azurearcdata.models.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: SQL Server ESU license properties. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseProperties + """ + + properties: "_models.SqlServerEsuLicenseProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server ESU license properties. Required.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.SqlServerEsuLicenseProperties", + tags: Optional[dict[str, 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 SqlServerEsuLicenseProperties(_Model): + """Properties of SQL Server ESU license. + + :ivar billing_plan: SQL Server ESU license type. Required. Known values are: "PAYG" and "Paid". + :vartype billing_plan: str or ~azure.mgmt.azurearcdata.models.BillingPlan + :ivar version: The SQL Server version the license covers. Required. Known values are: "SQL + Server 2012", "SQL Server 2014", and "SQL Server 2016". + :vartype version: str or ~azure.mgmt.azurearcdata.models.Version + :ivar unique_id: The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :vartype unique_id: str + :ivar physical_cores: The number of total cores of the license covers. Required. + :vartype physical_cores: int + :ivar activation_state: The activation state of the license. Required. Known values are: + "Inactive", "Active", "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", + and "Suspended". + :vartype activation_state: str or ~azure.mgmt.azurearcdata.models.State + :ivar scope_type: The Azure scope to which the license will apply. Required. Known values are: + "Tenant", "Subscription", and "ResourceGroup". + :vartype scope_type: str or ~azure.mgmt.azurearcdata.models.ScopeType + :ivar activated_at: The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype activated_at: ~datetime.datetime + :ivar terminated_at: The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype terminated_at: ~datetime.datetime + :ivar tenant_id: The tenantId the SQL Server ESU license resource subscription resides in. + :vartype tenant_id: str + """ + + billing_plan: Union[str, "_models.BillingPlan"] = rest_field( + name="billingPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server ESU license type. Required. Known values are: \"PAYG\" and \"Paid\".""" + version: Union[str, "_models.Version"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SQL Server version the license covers. Required. Known values are: \"SQL Server 2012\", + \"SQL Server 2014\", and \"SQL Server 2016\".""" + unique_id: Optional[str] = rest_field(name="uniqueId", visibility=["read"]) + """The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000).""" + physical_cores: int = rest_field(name="physicalCores", visibility=["read", "create", "update", "delete", "query"]) + """The number of total cores of the license covers. Required.""" + activation_state: Union[str, "_models.State"] = rest_field( + name="activationState", visibility=["read", "create", "update", "delete", "query"] + ) + """The activation state of the license. Required. Known values are: \"Inactive\", \"Active\", + \"Terminated\", \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and + \"Suspended\".""" + scope_type: Union[str, "_models.ScopeType"] = rest_field( + name="scopeType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure scope to which the license will apply. Required. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + activated_at: Optional[datetime.datetime] = rest_field(name="activatedAt", visibility=["read"], format="rfc3339") + """The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 date-time format.""" + terminated_at: Optional[datetime.datetime] = rest_field(name="terminatedAt", visibility=["read"], format="rfc3339") + """The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 date-time format.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenantId the SQL Server ESU license resource subscription resides in.""" + + @overload + def __init__( + self, + *, + billing_plan: Union[str, "_models.BillingPlan"], + version: Union[str, "_models.Version"], + physical_cores: int, + activation_state: Union[str, "_models.State"], + scope_type: Union[str, "_models.ScopeType"], + ) -> 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 SqlServerEsuLicenseUpdate(_Model): + """An update to a SQL Server ESU license resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SqlServerEsuLicenseUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerEsuLicenseUpdateProperties"] = 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 SqlServerEsuLicenseUpdateProperties(_Model): + """Properties of update SqlServerEsuLicense. + + :ivar billing_plan: SQL Server ESU license type. Known values are: "PAYG" and "Paid". + :vartype billing_plan: str or ~azure.mgmt.azurearcdata.models.BillingPlan + :ivar version: The SQL Server version the license covers. Known values are: "SQL Server 2012", + "SQL Server 2014", and "SQL Server 2016". + :vartype version: str or ~azure.mgmt.azurearcdata.models.Version + :ivar unique_id: The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :vartype unique_id: str + :ivar physical_cores: The number of total cores of the license covers. + :vartype physical_cores: int + :ivar activation_state: The activation state of the license. Known values are: "Inactive", + "Active", "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", and + "Suspended". + :vartype activation_state: str or ~azure.mgmt.azurearcdata.models.State + :ivar scope_type: The Azure scope to which the license will apply. Known values are: "Tenant", + "Subscription", and "ResourceGroup". + :vartype scope_type: str or ~azure.mgmt.azurearcdata.models.ScopeType + :ivar activated_at: The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype activated_at: ~datetime.datetime + :ivar terminated_at: The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype terminated_at: ~datetime.datetime + :ivar tenant_id: The tenantId the SQL Server ESU license resource subscription resides in. + :vartype tenant_id: str + """ + + billing_plan: Optional[Union[str, "_models.BillingPlan"]] = rest_field( + name="billingPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server ESU license type. Known values are: \"PAYG\" and \"Paid\".""" + version: Optional[Union[str, "_models.Version"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The SQL Server version the license covers. Known values are: \"SQL Server 2012\", \"SQL Server + 2014\", and \"SQL Server 2016\".""" + unique_id: Optional[str] = rest_field(name="uniqueId", visibility=["read"]) + """The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000).""" + physical_cores: Optional[int] = rest_field( + name="physicalCores", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of total cores of the license covers.""" + activation_state: Optional[Union[str, "_models.State"]] = rest_field( + name="activationState", visibility=["read", "create", "update", "delete", "query"] + ) + """The activation state of the license. Known values are: \"Inactive\", \"Active\", + \"Terminated\", \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and + \"Suspended\".""" + scope_type: Optional[Union[str, "_models.ScopeType"]] = rest_field( + name="scopeType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure scope to which the license will apply. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + activated_at: Optional[datetime.datetime] = rest_field(name="activatedAt", visibility=["read"], format="rfc3339") + """The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 date-time format.""" + terminated_at: Optional[datetime.datetime] = rest_field(name="terminatedAt", visibility=["read"], format="rfc3339") + """The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 date-time format.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenantId the SQL Server ESU license resource subscription resides in.""" + + @overload + def __init__( + self, + *, + billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None, + version: Optional[Union[str, "_models.Version"]] = None, + physical_cores: Optional[int] = None, + activation_state: Optional[Union[str, "_models.State"]] = None, + scope_type: Optional[Union[str, "_models.ScopeType"]] = 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 SqlServerInstance(TrackedResource): + """A SqlServerInstance. + + :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.azurearcdata.models.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: null. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerInstanceProperties + """ + + properties: Optional["_models.SqlServerInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerInstanceProperties"] = 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 SqlServerInstanceBpaColumn(_Model): + """The SQL best practices assessment result column. + + :ivar name: The name of the result column. + :vartype name: str + :ivar type: The type of the result column. Known values are: "bool", "datetime", "int", "long", + "double", "string", "guid", and "timespan". + :vartype type: str or ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaColumnType + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the result column.""" + type: Optional[Union[str, "_models.SqlServerInstanceBpaColumnType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the result column. Known values are: \"bool\", \"datetime\", \"int\", \"long\", + \"double\", \"string\", \"guid\", and \"timespan\".""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.SqlServerInstanceBpaColumnType"]] = 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 SqlServerInstanceBpaRequest(_Model): + """The request for retrieving SQL best practices assessment results. + + :ivar report_type: The report type that needs to be fetched. If not specified, the default is + AssessmentSummary. Known values are: "AssessmentDataPoint" and "AssessmentSummary". + :vartype report_type: str or ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaReportType + :ivar report_id: The GUID of the report to return best practices assessment results for. If not + specified, summaries for all reports will be returned. + :vartype report_id: str + :ivar skip_token: The opaque token to use to skip to a specific page of the report. If not + specified, the first page will be returned. + :vartype skip_token: str + :ivar query_type: The type of query to run for summarizing the best practices assessment + results. If not specified, the default is 'Basic'. Known values are: "Basic" and + "HistoricalTrends". + :vartype query_type: str or ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaQueryType + """ + + report_type: Optional[Union[str, "_models.SqlServerInstanceBpaReportType"]] = rest_field( + name="reportType", visibility=["read", "create", "update", "delete", "query"] + ) + """The report type that needs to be fetched. If not specified, the default is AssessmentSummary. + Known values are: \"AssessmentDataPoint\" and \"AssessmentSummary\".""" + report_id: Optional[str] = rest_field(name="reportId", visibility=["read", "create", "update", "delete", "query"]) + """The GUID of the report to return best practices assessment results for. If not specified, + summaries for all reports will be returned.""" + skip_token: Optional[str] = rest_field(name="skipToken", visibility=["read", "create", "update", "delete", "query"]) + """The opaque token to use to skip to a specific page of the report. If not specified, the first + page will be returned.""" + query_type: Optional[Union[str, "_models.SqlServerInstanceBpaQueryType"]] = rest_field( + name="queryType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of query to run for summarizing the best practices assessment results. If not + specified, the default is 'Basic'. Known values are: \"Basic\" and \"HistoricalTrends\".""" + + @overload + def __init__( + self, + *, + report_type: Optional[Union[str, "_models.SqlServerInstanceBpaReportType"]] = None, + report_id: Optional[str] = None, + skip_token: Optional[str] = None, + query_type: Optional[Union[str, "_models.SqlServerInstanceBpaQueryType"]] = 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 SqlServerInstanceJob(_Model): + """The job running on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: ~azure.mgmt.azurearcdata.models.BackgroundJob + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list[~azure.mgmt.azurearcdata.models.SequencerAction] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the job.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the SQL Server instance.""" + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field( + name="jobStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + job_exception: Optional[str] = rest_field( + name="jobException", visibility=["read", "create", "update", "delete", "query"] + ) + """The exception message if the job failed.""" + background_job: Optional["_models.BackgroundJob"] = rest_field( + name="backgroundJob", visibility=["read", "create", "update", "delete", "query"] + ) + """The background job details.""" + sequencer_actions: Optional[list["_models.SequencerAction"]] = rest_field( + name="sequencerActions", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of sequencer actions.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + instance_name: Optional[str] = None, + job_status: Optional[Union[str, "_models.JobStatus"]] = None, + job_exception: Optional[str] = None, + background_job: Optional["_models.BackgroundJob"] = None, + sequencer_actions: Optional[list["_models.SequencerAction"]] = 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 SqlServerInstanceJobsRequest(_Model): + """The request for the jobs running on the SQL Server instance. + + :ivar feature_name: The name of the feature to retrieve the jobs for. + :vartype feature_name: str + :ivar job_type: The type of the job to retrieve the jobs for. + :vartype job_type: str + """ + + feature_name: Optional[str] = rest_field( + name="featureName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the feature to retrieve the jobs for.""" + job_type: Optional[str] = rest_field(name="jobType", visibility=["read", "create", "update", "delete", "query"]) + """The type of the job to retrieve the jobs for.""" + + @overload + def __init__( + self, + *, + feature_name: Optional[str] = None, + job_type: 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 SqlServerInstanceJobsResponse(_Model): + """The response for the jobs running on the SQL Server instance. + + :ivar jobs: The list of jobs running on the SQL Server instance. + :vartype jobs: list[~azure.mgmt.azurearcdata.models.SqlServerInstanceJob] + """ + + jobs: Optional[list["_models.SqlServerInstanceJob"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of jobs running on the SQL Server instance.""" + + @overload + def __init__( + self, + *, + jobs: Optional[list["_models.SqlServerInstanceJob"]] = 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 SqlServerInstanceJobsStatusRequest(_Model): + """The request for the status of the jobs running on the SQL Server instance. + + :ivar feature_name: The name of the feature to retrieve the job status for. + :vartype feature_name: str + :ivar job_type: The type of the job to retrieve the status for. + :vartype job_type: str + """ + + feature_name: Optional[str] = rest_field( + name="featureName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the feature to retrieve the job status for.""" + job_type: Optional[str] = rest_field(name="jobType", visibility=["read", "create", "update", "delete", "query"]) + """The type of the job to retrieve the status for.""" + + @overload + def __init__( + self, + *, + feature_name: Optional[str] = None, + job_type: 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 SqlServerInstanceJobsStatusResponse(_Model): + """The response for the status of the jobs running on the SQL Server instance. + + :ivar jobs_status: The list of jobs status running on the SQL Server instance. + :vartype jobs_status: list[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobStatus] + """ + + jobs_status: Optional[list["_models.SqlServerInstanceJobStatus"]] = rest_field( + name="jobsStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of jobs status running on the SQL Server instance.""" + + @overload + def __init__( + self, + *, + jobs_status: Optional[list["_models.SqlServerInstanceJobStatus"]] = 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 SqlServerInstanceJobStatus(_Model): + """The status of the job running on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: ~azure.mgmt.azurearcdata.models.BackgroundJob + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list[~azure.mgmt.azurearcdata.models.SequencerAction] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the job.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the SQL Server instance.""" + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field( + name="jobStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + job_exception: Optional[str] = rest_field( + name="jobException", visibility=["read", "create", "update", "delete", "query"] + ) + """The exception message if the job failed.""" + background_job: Optional["_models.BackgroundJob"] = rest_field( + name="backgroundJob", visibility=["read", "create", "update", "delete", "query"] + ) + """The background job details.""" + sequencer_actions: Optional[list["_models.SequencerAction"]] = rest_field( + name="sequencerActions", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of sequencer actions.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + instance_name: Optional[str] = None, + job_status: Optional[Union[str, "_models.JobStatus"]] = None, + job_exception: Optional[str] = None, + background_job: Optional["_models.BackgroundJob"] = None, + sequencer_actions: Optional[list["_models.SequencerAction"]] = 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 SqlServerInstanceManagedInstanceLinkAssessment(_Model): # pylint: disable=name-too-long + """The status of an individual requirement for MI Link. + + :ivar name: The name of the requirement. + :vartype name: str + :ivar category: Validation category for the MI Link prerequisites assessment. Known values are: + "SqlInstance", "SqlInstanceDatabase", "ManagedInstance", "ManagedInstanceDatabase", + "ManagedInstanceCrossValidation", "Certificates", "BoxToMiNetworkConnectivity", + "MiToBoxNetworkConnectivity", "SqlInstanceAg", and "DagCrossValidation". + :vartype category: str or ~azure.mgmt.azurearcdata.models.MiLinkAssessmentCategory + :ivar status: The status of the requirement. Known values are: "Success", "Warning", and + "Failure". + :vartype status: str or ~azure.mgmt.azurearcdata.models.AssessmentStatus + :ivar information: The information text about requirement. + :vartype information: str + :ivar additional_information: Additional details about the check, including any recommended + actions. + :vartype additional_information: str + :ivar failing_dbs: List of names of databases that are failing the given assessment. + :vartype failing_dbs: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the requirement.""" + category: Optional[Union[str, "_models.MiLinkAssessmentCategory"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Validation category for the MI Link prerequisites assessment. Known values are: + \"SqlInstance\", \"SqlInstanceDatabase\", \"ManagedInstance\", \"ManagedInstanceDatabase\", + \"ManagedInstanceCrossValidation\", \"Certificates\", \"BoxToMiNetworkConnectivity\", + \"MiToBoxNetworkConnectivity\", \"SqlInstanceAg\", and \"DagCrossValidation\".""" + status: Optional[Union[str, "_models.AssessmentStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the requirement. Known values are: \"Success\", \"Warning\", and \"Failure\".""" + information: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The information text about requirement.""" + additional_information: Optional[str] = rest_field( + name="additionalInformation", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the check, including any recommended actions.""" + failing_dbs: Optional[list[str]] = rest_field( + name="failingDbs", visibility=["read", "create", "update", "delete", "query"] + ) + """List of names of databases that are failing the given assessment.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + category: Optional[Union[str, "_models.MiLinkAssessmentCategory"]] = None, + status: Optional[Union[str, "_models.AssessmentStatus"]] = None, + information: Optional[str] = None, + additional_information: Optional[str] = None, + failing_dbs: Optional[list[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 SqlServerInstanceManagedInstanceLinkAssessmentRequest(_Model): # pylint: disable=name-too-long + """The MI Link assessment request for the SQL Server instance. + + :ivar azure_managed_instance_resource_id: The Azure SQL Managed Instance resource ID to link + with the SQL Server instance. Required. + :vartype azure_managed_instance_resource_id: str + :ivar azure_managed_instance_role: The role of managed instance in a distributed availability + group, can be Primary or Secondary. Known values are: "Primary" and "Secondary". + :vartype azure_managed_instance_role: str or + ~azure.mgmt.azurearcdata.models.AzureManagedInstanceRole + :ivar database_names: An array of strings, where each value represents the name of a database + to be replicated to the Azure SQL Managed Instance. Required. + :vartype database_names: list[str] + :ivar availability_group_name: The name of the availability group to be used for the database + replication. Required. + :vartype availability_group_name: str + :ivar distributed_availability_group_name: The name of the DAG to be used for the database + replication. Also referred to as Link Name. Required. + :vartype distributed_availability_group_name: str + :ivar assessment_categories: An array of strings, where each value represents the category of + the assessment to be run. If this field is not provided, all assessment categories will be run. + :vartype assessment_categories: list[str or + ~azure.mgmt.azurearcdata.models.MiLinkAssessmentCategory] + :ivar sql_server_ip_address: The IP address of the SQL Server instance. + :vartype sql_server_ip_address: str + """ + + azure_managed_instance_resource_id: str = rest_field( + name="azureManagedInstanceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure SQL Managed Instance resource ID to link with the SQL Server instance. Required.""" + azure_managed_instance_role: Optional[Union[str, "_models.AzureManagedInstanceRole"]] = rest_field( + name="azureManagedInstanceRole", visibility=["read", "create", "update", "delete", "query"] + ) + """The role of managed instance in a distributed availability group, can be Primary or Secondary. + Known values are: \"Primary\" and \"Secondary\".""" + database_names: list[str] = rest_field( + name="databaseNames", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of strings, where each value represents the name of a database to be replicated to the + Azure SQL Managed Instance. Required.""" + availability_group_name: str = rest_field( + name="availabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the availability group to be used for the database replication. Required.""" + distributed_availability_group_name: str = rest_field( + name="distributedAvailabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the DAG to be used for the database replication. Also referred to as Link Name. + Required.""" + assessment_categories: Optional[list[Union[str, "_models.MiLinkAssessmentCategory"]]] = rest_field( + name="assessmentCategories", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of strings, where each value represents the category of the assessment to be run. If + this field is not provided, all assessment categories will be run.""" + sql_server_ip_address: Optional[str] = rest_field( + name="sqlServerIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """The IP address of the SQL Server instance.""" + + @overload + def __init__( + self, + *, + azure_managed_instance_resource_id: str, + database_names: list[str], + availability_group_name: str, + distributed_availability_group_name: str, + azure_managed_instance_role: Optional[Union[str, "_models.AzureManagedInstanceRole"]] = None, + assessment_categories: Optional[list[Union[str, "_models.MiLinkAssessmentCategory"]]] = None, + sql_server_ip_address: 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 SqlServerInstanceManagedInstanceLinkAssessmentResponse(_Model): # pylint: disable=name-too-long + """The response containing the results of the MI Link assessment. + + :ivar assessments: The list of the results for MI Link assessment. + :vartype assessments: + list[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessment] + """ + + assessments: Optional[list["_models.SqlServerInstanceManagedInstanceLinkAssessment"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the results for MI Link assessment.""" + + @overload + def __init__( + self, + *, + assessments: Optional[list["_models.SqlServerInstanceManagedInstanceLinkAssessment"]] = 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 SqlServerInstanceMigrationReadinessReportResponse(_Model): # pylint: disable=name-too-long + """Represents the response containing the SQL Server Instance Migration Readiness report. + + :ivar report: The migration readiness report as a serialized JSON string. When isCompressed is + true, the value is base64-encoded GZip-compressed and must be decoded and decompressed before + parsing. + :vartype report: str + :ivar is_compressed: Indicates whether the report field contains base64-encoded GZip-compressed + JSON. + :vartype is_compressed: bool + :ivar created_time: The UTC timestamp in ISO 8601 format indicating when the migration + readiness report was created. + :vartype created_time: ~datetime.datetime + """ + + report: Optional[str] = rest_field(visibility=["read"]) + """The migration readiness report as a serialized JSON string. When isCompressed is true, the + value is base64-encoded GZip-compressed and must be decoded and decompressed before parsing.""" + is_compressed: Optional[bool] = rest_field(name="isCompressed", visibility=["read"]) + """Indicates whether the report field contains base64-encoded GZip-compressed JSON.""" + created_time: Optional[datetime.datetime] = rest_field(name="createdTime", visibility=["read"], format="rfc3339") + """The UTC timestamp in ISO 8601 format indicating when the migration readiness report was + created.""" + + +class SqlServerInstanceProperties(_Model): + """Properties of SqlServerInstance. + + :ivar version: SQL Server version. Known values are: "Unknown", "SQL Server 2012", "SQL Server + 2014", "SQL Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "SQL + Server 2025". + :vartype version: str or ~azure.mgmt.azurearcdata.models.SqlVersion + :ivar edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", + "Web", "Developer", "Express", "Business Intelligence", "Standard Developer", and "Unknown". + :vartype edition: str or ~azure.mgmt.azurearcdata.models.EditionType + :ivar container_resource_id: ARM Resource id of the container resource (Azure Arc for Servers). + :vartype container_resource_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :ivar v_core: The number of logical processors used by the SQL Server instance. + :vartype v_core: str + :ivar cores: The number of total cores of the Operating System Environment (OSE) hosting the + SQL Server instance. + :vartype cores: str + :ivar status: The cloud connectivity status. Known values are: "Connected", "Disconnected", + "Registered", "Discovered", and "Unknown". + :vartype status: str or ~azure.mgmt.azurearcdata.models.ConnectionStatus + :ivar discovery_source: Indicates the discovery agent or client for this instance. Known values + are: "Azure Arc", "Azure Migrate", "ADS", "SSMS", "SSMA", "Import", "DMS-Portal", "DMS-PS", + "DMS-CLI", "DMS-SDK", and "Other". + :vartype discovery_source: str or ~azure.mgmt.azurearcdata.models.DiscoverySource + :ivar patch_level: SQL Server update level. + :vartype patch_level: str + :ivar collation: SQL Server collation. + :vartype collation: str + :ivar db_master_key_exists: Indicates whether database master key exists in SQL Server. + :vartype db_master_key_exists: bool + :ivar is_hadr_enabled: Indicates whether always On availability groups is enabled in SQL + Server. + :vartype is_hadr_enabled: bool + :ivar trace_flags: An array of integers, where each value represents the enabled trace flags in + SQL Server. + :vartype trace_flags: list[int] + :ivar current_version: SQL Server current version. + :vartype current_version: str + :ivar instance_name: SQL Server instance name. + :vartype instance_name: str + :ivar tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :vartype tcp_dynamic_ports: str + :ivar tcp_static_ports: Static TCP ports used by SQL Server. + :vartype tcp_static_ports: str + :ivar product_id: SQL Server product ID. + :vartype product_id: str + :ivar license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", + "ServerCAL", "LicenseOnly", "PAYG", "Paid", and "FabricCapacity". + :vartype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType + :ivar azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :vartype azure_defender_status_last_updated: ~datetime.datetime + :ivar azure_defender_status: Status of Azure Defender. Known values are: "Protected", + "Unprotected", and "Unknown". + :vartype azure_defender_status: str or ~azure.mgmt.azurearcdata.models.DefenderStatus + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server resource. + :vartype provisioning_state: str + :ivar last_inventory_upload_time: The time when last successful inventory upload was performed. + :vartype last_inventory_upload_time: ~datetime.datetime + :ivar last_usage_upload_time: The time when last successful usage upload was performed. + :vartype last_usage_upload_time: ~datetime.datetime + :ivar host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual + Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual + Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", + "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual + Machine", "Hyper-V Virtual Machine", and "Other". + :vartype host_type: str or ~azure.mgmt.azurearcdata.models.HostType + :ivar always_on_role: The role of the SQL Server, based on availability. Known values are: + "None", "FailoverClusterInstance", "FailoverClusterNode", and "AvailabilityGroupReplica". + :vartype always_on_role: str or ~azure.mgmt.azurearcdata.models.AlwaysOnRole + :ivar database_mirroring_endpoint: Database mirroring endpoint related properties. + :vartype database_mirroring_endpoint: ~azure.mgmt.azurearcdata.models.DBMEndpoint + :ivar failover_cluster: Failover Cluster Instance properties. + :vartype failover_cluster: ~azure.mgmt.azurearcdata.models.FailoverCluster + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: ~azure.mgmt.azurearcdata.models.BackupPolicy + :ivar upgrade_locked_until: Upgrade Action for this resource is locked until it expires. The + Expiration time indicated by this value. It is not locked when it is empty. + :vartype upgrade_locked_until: ~datetime.datetime + :ivar monitoring: The monitoring configuration. + :vartype monitoring: ~azure.mgmt.azurearcdata.models.Monitoring + :ivar migration: Migration related configuration and status. + :vartype migration: ~azure.mgmt.azurearcdata.models.Migration + :ivar best_practices_assessment: The configuration related to SQL best practices assessment. + :vartype best_practices_assessment: ~azure.mgmt.azurearcdata.models.BestPracticesAssessment + :ivar client_connection: Client connection related configuration. + :vartype client_connection: ~azure.mgmt.azurearcdata.models.ClientConnection + :ivar service_type: Indicates if the resource represents a SQL Server engine or a SQL Server + component service installed on the host. Known values are: "Engine", "SSRS", "SSAS", "SSIS", + and "PBIRS". + :vartype service_type: str or ~azure.mgmt.azurearcdata.models.ServiceType + :ivar max_server_memory_mb: maximum server memory (MB) value configured for this instance. + :vartype max_server_memory_mb: int + :ivar is_microsoft_pki_cert_trust_configured: Indicates whether Microsoft PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_microsoft_pki_cert_trust_configured: bool + :ivar is_digi_cert_pki_cert_trust_configured: Indicates whether DigiCert PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_digi_cert_pki_cert_trust_configured: bool + :ivar authentication: Authentication related configuration for the SQL Server Instance. + :vartype authentication: ~azure.mgmt.azurearcdata.models.Authentication + """ + + version: Optional[Union[str, "_models.SqlVersion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server version. Known values are: \"Unknown\", \"SQL Server 2012\", \"SQL Server 2014\", + \"SQL Server 2016\", \"SQL Server 2017\", \"SQL Server 2019\", \"SQL Server 2022\", and \"SQL + Server 2025\".""" + edition: Optional[Union[str, "_models.EditionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server edition. Known values are: \"Evaluation\", \"Enterprise\", \"Standard\", \"Web\", + \"Developer\", \"Express\", \"Business Intelligence\", \"Standard Developer\", and \"Unknown\".""" + container_resource_id: Optional[str] = rest_field(name="containerResourceId", visibility=["read"]) + """ARM Resource id of the container resource (Azure Arc for Servers).""" + vm_id: Optional[str] = rest_field(name="vmId", visibility=["read"]) + """The unique ID of the hybrid machine that this resource belongs to.""" + create_time: Optional[str] = rest_field(name="createTime", visibility=["read"]) + """The time when the resource was created.""" + v_core: Optional[str] = rest_field(name="vCore", visibility=["read"]) + """The number of logical processors used by the SQL Server instance.""" + cores: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of total cores of the Operating System Environment (OSE) hosting the SQL Server + instance.""" + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(visibility=["read"]) + """The cloud connectivity status. Known values are: \"Connected\", \"Disconnected\", + \"Registered\", \"Discovered\", and \"Unknown\".""" + discovery_source: Optional[Union[str, "_models.DiscoverySource"]] = rest_field( + name="discoverySource", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the discovery agent or client for this instance. Known values are: \"Azure Arc\", + \"Azure Migrate\", \"ADS\", \"SSMS\", \"SSMA\", \"Import\", \"DMS-Portal\", \"DMS-PS\", + \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + patch_level: Optional[str] = rest_field(name="patchLevel", visibility=["read"]) + """SQL Server update level.""" + collation: Optional[str] = rest_field(visibility=["read"]) + """SQL Server collation.""" + db_master_key_exists: Optional[bool] = rest_field(name="dbMasterKeyExists", visibility=["read"]) + """Indicates whether database master key exists in SQL Server.""" + is_hadr_enabled: Optional[bool] = rest_field(name="isHadrEnabled", visibility=["read"]) + """Indicates whether always On availability groups is enabled in SQL Server.""" + trace_flags: Optional[list[int]] = rest_field(name="traceFlags", visibility=["read"]) + """An array of integers, where each value represents the enabled trace flags in SQL Server.""" + current_version: Optional[str] = rest_field(name="currentVersion", visibility=["read"]) + """SQL Server current version.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server instance name.""" + tcp_dynamic_ports: Optional[str] = rest_field(name="tcpDynamicPorts", visibility=["read"]) + """Dynamic TCP ports used by SQL Server.""" + tcp_static_ports: Optional[str] = rest_field(name="tcpStaticPorts", visibility=["read"]) + """Static TCP ports used by SQL Server.""" + product_id: Optional[str] = rest_field(name="productId", visibility=["read"]) + """SQL Server product ID.""" + license_type: Optional[Union[str, "_models.ArcSqlServerLicenseType"]] = rest_field( + name="licenseType", visibility=["read"] + ) + """SQL Server license type. Known values are: \"Undefined\", \"Free\", \"HADR\", \"ServerCAL\", + \"LicenseOnly\", \"PAYG\", \"Paid\", and \"FabricCapacity\".""" + azure_defender_status_last_updated: Optional[datetime.datetime] = rest_field( + name="azureDefenderStatusLastUpdated", visibility=["read"], format="rfc3339" + ) + """Timestamp of last Azure Defender status update.""" + azure_defender_status: Optional[Union[str, "_models.DefenderStatus"]] = rest_field( + name="azureDefenderStatus", visibility=["read"] + ) + """Status of Azure Defender. Known values are: \"Protected\", \"Unprotected\", and \"Unknown\".""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc-enabled SQL Server resource.""" + last_inventory_upload_time: Optional[datetime.datetime] = rest_field( + name="lastInventoryUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when last successful inventory upload was performed.""" + last_usage_upload_time: Optional[datetime.datetime] = rest_field( + name="lastUsageUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when last successful usage upload was performed.""" + host_type: Optional[Union[str, "_models.HostType"]] = rest_field( + name="hostType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of host for Azure Arc SQL Server. Known values are: \"Azure Virtual Machine\", \"Azure + VMWare Virtual Machine\", \"Azure Kubernetes Service\", \"AWS VMWare Virtual Machine\", \"AWS + Kubernetes Service\", \"GCP VMWare Virtual Machine\", \"GCP Kubernetes Service\", + \"Container\", \"Virtual Machine\", \"Physical Server\", \"AWS Virtual Machine\", \"GCP Virtual + Machine\", \"Hyper-V Virtual Machine\", and \"Other\".""" + always_on_role: Optional[Union[str, "_models.AlwaysOnRole"]] = rest_field(name="alwaysOnRole", visibility=["read"]) + """The role of the SQL Server, based on availability. Known values are: \"None\", + \"FailoverClusterInstance\", \"FailoverClusterNode\", and \"AvailabilityGroupReplica\".""" + database_mirroring_endpoint: Optional["_models.DBMEndpoint"] = rest_field( + name="databaseMirroringEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Database mirroring endpoint related properties.""" + failover_cluster: Optional["_models.FailoverCluster"] = rest_field( + name="failoverCluster", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover Cluster Instance properties.""" + backup_policy: Optional["_models.BackupPolicy"] = rest_field( + name="backupPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The backup profile for the SQL server.""" + upgrade_locked_until: Optional[datetime.datetime] = rest_field( + name="upgradeLockedUntil", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Upgrade Action for this resource is locked until it expires. The Expiration time indicated by + this value. It is not locked when it is empty.""" + monitoring: Optional["_models.Monitoring"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The monitoring configuration.""" + migration: Optional["_models.Migration"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Migration related configuration and status.""" + best_practices_assessment: Optional["_models.BestPracticesAssessment"] = rest_field( + name="bestPracticesAssessment", visibility=["read", "create", "update", "delete", "query"] + ) + """The configuration related to SQL best practices assessment.""" + client_connection: Optional["_models.ClientConnection"] = rest_field( + name="clientConnection", visibility=["read", "create", "update", "delete", "query"] + ) + """Client connection related configuration.""" + service_type: Optional[Union[str, "_models.ServiceType"]] = rest_field( + name="serviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if the resource represents a SQL Server engine or a SQL Server component service + installed on the host. Known values are: \"Engine\", \"SSRS\", \"SSAS\", \"SSIS\", and + \"PBIRS\".""" + max_server_memory_mb: Optional[int] = rest_field(name="maxServerMemoryMB", visibility=["read"]) + """maximum server memory (MB) value configured for this instance.""" + is_microsoft_pki_cert_trust_configured: Optional[bool] = rest_field( + name="isMicrosoftPkiCertTrustConfigured", visibility=["read"] + ) + """Indicates whether Microsoft PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + is_digi_cert_pki_cert_trust_configured: Optional[bool] = rest_field( + name="isDigiCertPkiCertTrustConfigured", visibility=["read"] + ) + """Indicates whether DigiCert PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + authentication: Optional["_models.Authentication"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Authentication related configuration for the SQL Server Instance.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + version: Optional[Union[str, "_models.SqlVersion"]] = None, + edition: Optional[Union[str, "_models.EditionType"]] = None, + cores: Optional[str] = None, + discovery_source: Optional[Union[str, "_models.DiscoverySource"]] = None, + instance_name: Optional[str] = None, + host_type: Optional[Union[str, "_models.HostType"]] = None, + database_mirroring_endpoint: Optional["_models.DBMEndpoint"] = None, + failover_cluster: Optional["_models.FailoverCluster"] = None, + backup_policy: Optional["_models.BackupPolicy"] = None, + upgrade_locked_until: Optional[datetime.datetime] = None, + monitoring: Optional["_models.Monitoring"] = None, + migration: Optional["_models.Migration"] = None, + best_practices_assessment: Optional["_models.BestPracticesAssessment"] = None, + client_connection: Optional["_models.ClientConnection"] = None, + service_type: Optional[Union[str, "_models.ServiceType"]] = None, + authentication: Optional["_models.Authentication"] = 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 SqlServerInstanceRunBestPracticesAssessmentResponse(_Model): # pylint: disable=name-too-long + """The response object for the request to run SQL best practices assessment. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: ~azure.mgmt.azurearcdata.models.BackgroundJob + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list[~azure.mgmt.azurearcdata.models.SequencerAction] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the job.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the SQL Server instance.""" + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field( + name="jobStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + job_exception: Optional[str] = rest_field( + name="jobException", visibility=["read", "create", "update", "delete", "query"] + ) + """The exception message if the job failed.""" + background_job: Optional["_models.BackgroundJob"] = rest_field( + name="backgroundJob", visibility=["read", "create", "update", "delete", "query"] + ) + """The background job details.""" + sequencer_actions: Optional[list["_models.SequencerAction"]] = rest_field( + name="sequencerActions", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of sequencer actions.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + instance_name: Optional[str] = None, + job_status: Optional[Union[str, "_models.JobStatus"]] = None, + job_exception: Optional[str] = None, + background_job: Optional["_models.BackgroundJob"] = None, + sequencer_actions: Optional[list["_models.SequencerAction"]] = 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 SqlServerInstanceRunMigrationAssessmentResponse(_Model): # pylint: disable=name-too-long + """The response for running migration assessment on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: ~azure.mgmt.azurearcdata.models.BackgroundJob + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list[~azure.mgmt.azurearcdata.models.SequencerAction] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the job.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the SQL Server instance.""" + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field( + name="jobStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + job_exception: Optional[str] = rest_field( + name="jobException", visibility=["read", "create", "update", "delete", "query"] + ) + """The exception message if the job failed.""" + background_job: Optional["_models.BackgroundJob"] = rest_field( + name="backgroundJob", visibility=["read", "create", "update", "delete", "query"] + ) + """The background job details.""" + sequencer_actions: Optional[list["_models.SequencerAction"]] = rest_field( + name="sequencerActions", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of sequencer actions.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + instance_name: Optional[str] = None, + job_status: Optional[Union[str, "_models.JobStatus"]] = None, + job_exception: Optional[str] = None, + background_job: Optional["_models.BackgroundJob"] = None, + sequencer_actions: Optional[list["_models.SequencerAction"]] = 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 SqlServerInstanceRunMigrationReadinessAssessmentResponse(_Model): # pylint: disable=name-too-long + """The response object for the request to run migration readiness assessment. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: ~azure.mgmt.azurearcdata.models.BackgroundJob + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list[~azure.mgmt.azurearcdata.models.SequencerAction] + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier of the job.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the SQL Server instance.""" + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field( + name="jobStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + job_exception: Optional[str] = rest_field( + name="jobException", visibility=["read", "create", "update", "delete", "query"] + ) + """The exception message if the job failed.""" + background_job: Optional["_models.BackgroundJob"] = rest_field( + name="backgroundJob", visibility=["read", "create", "update", "delete", "query"] + ) + """The background job details.""" + sequencer_actions: Optional[list["_models.SequencerAction"]] = rest_field( + name="sequencerActions", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of sequencer actions.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + instance_name: Optional[str] = None, + job_status: Optional[Union[str, "_models.JobStatus"]] = None, + job_exception: Optional[str] = None, + background_job: Optional["_models.BackgroundJob"] = None, + sequencer_actions: Optional[list["_models.SequencerAction"]] = 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 SqlServerInstanceRunTargetRecommendationJobRequest(_Model): # pylint: disable=name-too-long + """The request for running a SQL Server Instance target recommendation job. + + :ivar resource_update_mode: Controls whether the SQL Server instance resource is updated with + the target recommendation details after the job completes. Known values are: + "UpdateAllTargetRecommendationDetails" and "SkipResourceUpdate". + :vartype resource_update_mode: str or ~azure.mgmt.azurearcdata.models.ResourceUpdateMode + :ivar include_file_level_requirements: Specifies whether to include file-level requirements in + the target recommendation report. + :vartype include_file_level_requirements: bool + :ivar target_location: The Azure region used for target SKU pricing and availability (e.g., + 'westus', 'eastus2', 'westeurope'). + :vartype target_location: str + :ivar percentile: The percentile of performance data points used for aggregation (Range: + 1-100). + :vartype percentile: int + :ivar lookback_period_in_days: The lookback period in days for performance data used in the + target recommendation. + :vartype lookback_period_in_days: int + """ + + resource_update_mode: Optional[Union[str, "_models.ResourceUpdateMode"]] = rest_field( + name="resourceUpdateMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Controls whether the SQL Server instance resource is updated with the target recommendation + details after the job completes. Known values are: \"UpdateAllTargetRecommendationDetails\" and + \"SkipResourceUpdate\".""" + include_file_level_requirements: Optional[bool] = rest_field( + name="includeFileLevelRequirements", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether to include file-level requirements in the target recommendation report.""" + target_location: Optional[str] = rest_field( + name="targetLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure region used for target SKU pricing and availability (e.g., 'westus', 'eastus2', + 'westeurope').""" + percentile: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The percentile of performance data points used for aggregation (Range: 1-100).""" + lookback_period_in_days: Optional[int] = rest_field( + name="lookbackPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The lookback period in days for performance data used in the target recommendation.""" + + @overload + def __init__( + self, + *, + resource_update_mode: Optional[Union[str, "_models.ResourceUpdateMode"]] = None, + include_file_level_requirements: Optional[bool] = None, + target_location: Optional[str] = None, + percentile: Optional[int] = None, + lookback_period_in_days: Optional[int] = 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 SqlServerInstanceRunTargetRecommendationJobResponse(_Model): # pylint: disable=name-too-long + """Represents the response of a SQL Server Instance target recommendation job execution. + + :ivar job_status: Represents the current status of the target recommendation job. Known values + are: "NotStarted", "InProgress", "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + """ + + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field(name="jobStatus", visibility=["read"]) + """Represents the current status of the target recommendation job. Known values are: + \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\".""" + + +class SqlServerInstanceTargetRecommendationReport(_Model): # pylint: disable=name-too-long + """Represents a target recommendation report for a SQL Server instance. + + :ivar report_id: The identifier of the target recommendation report. + :vartype report_id: str + :ivar created_time: The UTC timestamp in ISO 8601 format indicating when the target + recommendation report was generated. + :vartype created_time: ~datetime.datetime + :ivar sections: Collection of sections included in the report. + :vartype sections: + list[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSection] + """ + + report_id: Optional[str] = rest_field(name="reportId", visibility=["read"]) + """The identifier of the target recommendation report.""" + created_time: Optional[datetime.datetime] = rest_field(name="createdTime", visibility=["read"], format="rfc3339") + """The UTC timestamp in ISO 8601 format indicating when the target recommendation report was + generated.""" + sections: Optional[list["_models.SqlServerInstanceTargetRecommendationReportSection"]] = rest_field( + visibility=["read"] + ) + """Collection of sections included in the report.""" + + +class SqlServerInstanceTargetRecommendationReportSection(_Model): # pylint: disable=name-too-long + """Represents a section within a target recommendation report. + + :ivar data: Serialized JSON representation of the section data. If isCompressed is true, the + value contains base64-encoded GZip-compressed JSON. + :vartype data: str + :ivar type: The type of this section. Requirements sections contain source server performance + metrics, while recommendation sections contain suggested Azure target SKUs. Known values are: + "RequirementsPerInstance", "RequirementsPerDatabase", "FileRequirementsPerDatabase", + "SqlVmTargetRecommendationPerInstance", "SqlMiTargetRecommendationPerInstance", and + "SqlDbTargetRecommendationPerDatabase". + :vartype type: str or + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSectionType + :ivar database_name: The name of the database to which this section applies. An empty string + indicates that the section contains instance-level data rather than database-level data. + :vartype database_name: str + :ivar is_compressed: Indicates whether the data field contains base64-encoded GZip-compressed + JSON. + :vartype is_compressed: bool + """ + + data: Optional[str] = rest_field(visibility=["read"]) + """Serialized JSON representation of the section data. If isCompressed is true, the value contains + base64-encoded GZip-compressed JSON.""" + type: Optional[Union[str, "_models.SqlServerInstanceTargetRecommendationReportSectionType"]] = rest_field( + visibility=["read"] + ) + """The type of this section. Requirements sections contain source server performance metrics, + while recommendation sections contain suggested Azure target SKUs. Known values are: + \"RequirementsPerInstance\", \"RequirementsPerDatabase\", \"FileRequirementsPerDatabase\", + \"SqlVmTargetRecommendationPerInstance\", \"SqlMiTargetRecommendationPerInstance\", and + \"SqlDbTargetRecommendationPerDatabase\".""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database to which this section applies. An empty string indicates that the + section contains instance-level data rather than database-level data.""" + is_compressed: Optional[bool] = rest_field(name="isCompressed", visibility=["read"]) + """Indicates whether the data field contains base64-encoded GZip-compressed JSON.""" + + +class SqlServerInstanceTargetRecommendationReportsRequest(_Model): # pylint: disable=name-too-long + """The request for retrieving SQL Server Instance target recommendation reports. + + :ivar report_offset: Zero-based offset indicating where to continue reading reports in the + overall list of reports. Defaults to 0 if not provided. This value must be used together with + the corresponding sectionOffset to resume pagination. The reportOffset advances only after all + sections of the current report have been retrieved. To retrieve subsequent pages, use the + nextReportOffset and nextSectionOffset values from the previous response. + :vartype report_offset: int + :ivar section_offset: Zero-based offset indicating where to continue reading sections within + the current report. Defaults to 0 if not provided. This value must be used together with the + corresponding reportOffset to resume pagination. To retrieve subsequent pages, use the + nextReportOffset and nextSectionOffset values from the previous response. + :vartype section_offset: int + :ivar section_type: Filters the report to a specific section type. If not specified, all + section types are returned. Section types are grouped into two categories: requirements + sections contain performance and resource metrics collected from the source SQL Server, while + recommendation sections contain suggested Azure target SKUs derived from those requirements. + Known values are: "RequirementsPerInstance", "RequirementsPerDatabase", + "FileRequirementsPerDatabase", "SqlVmTargetRecommendationPerInstance", + "SqlMiTargetRecommendationPerInstance", and "SqlDbTargetRecommendationPerDatabase". + :vartype section_type: str or + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportSectionType + :ivar database_names: The list of database names to filter the report sections by. If not + specified, sections for all databases are returned. + :vartype database_names: list[str] + """ + + report_offset: Optional[int] = rest_field( + name="reportOffset", visibility=["read", "create", "update", "delete", "query"] + ) + """Zero-based offset indicating where to continue reading reports in the overall list of reports. + Defaults to 0 if not provided. This value must be used together with the corresponding + sectionOffset to resume pagination. The reportOffset advances only after all sections of the + current report have been retrieved. To retrieve subsequent pages, use the nextReportOffset and + nextSectionOffset values from the previous response.""" + section_offset: Optional[int] = rest_field( + name="sectionOffset", visibility=["read", "create", "update", "delete", "query"] + ) + """Zero-based offset indicating where to continue reading sections within the current report. + Defaults to 0 if not provided. This value must be used together with the corresponding + reportOffset to resume pagination. To retrieve subsequent pages, use the nextReportOffset and + nextSectionOffset values from the previous response.""" + section_type: Optional[Union[str, "_models.SqlServerInstanceTargetRecommendationReportSectionType"]] = rest_field( + name="sectionType", visibility=["read", "create", "update", "delete", "query"] + ) + """Filters the report to a specific section type. If not specified, all section types are + returned. Section types are grouped into two categories: requirements sections contain + performance and resource metrics collected from the source SQL Server, while recommendation + sections contain suggested Azure target SKUs derived from those requirements. Known values are: + \"RequirementsPerInstance\", \"RequirementsPerDatabase\", \"FileRequirementsPerDatabase\", + \"SqlVmTargetRecommendationPerInstance\", \"SqlMiTargetRecommendationPerInstance\", and + \"SqlDbTargetRecommendationPerDatabase\".""" + database_names: Optional[list[str]] = rest_field( + name="databaseNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of database names to filter the report sections by. If not specified, sections for all + databases are returned.""" + + @overload + def __init__( + self, + *, + report_offset: Optional[int] = None, + section_offset: Optional[int] = None, + section_type: Optional[Union[str, "_models.SqlServerInstanceTargetRecommendationReportSectionType"]] = None, + database_names: Optional[list[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 SqlServerInstanceTargetRecommendationReportsResponse(_Model): # pylint: disable=name-too-long + """Represents the response containing SQL Server Instance target recommendation reports. + + :ivar job_status: Represents the status of the latest target recommendation job. Report records + are returned only when the job status is Succeeded. Known values are: "NotStarted", + "InProgress", "Succeeded", and "Failed". + :vartype job_status: str or ~azure.mgmt.azurearcdata.models.JobStatus + :ivar reports: A collection of target recommendation reports. Returned only when the job status + is Succeeded. + :vartype reports: + list[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReport] + :ivar total_report_count: The total number of target recommendation reports available for + retrieval. Currently, only the latest report is returned, so this value is always 1. + :vartype total_report_count: int + :ivar next_report_offset: The report offset to use in the next request along with + nextSectionOffset to continue retrieving data. This value remains the same until all sections + of the current report have been retrieved. Present only when there is more data to retrieve. + When both nextReportOffset and nextSectionOffset are absent, all data has been returned. + :vartype next_report_offset: int + :ivar next_section_offset: The section offset to use in the next request along with + nextReportOffset to continue retrieving sections of the current report. Present only when there + is more data to retrieve. When both nextReportOffset and nextSectionOffset are absent, all data + has been returned. + :vartype next_section_offset: int + """ + + job_status: Optional[Union[str, "_models.JobStatus"]] = rest_field(name="jobStatus", visibility=["read"]) + """Represents the status of the latest target recommendation job. Report records are returned only + when the job status is Succeeded. Known values are: \"NotStarted\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + reports: Optional[list["_models.SqlServerInstanceTargetRecommendationReport"]] = rest_field(visibility=["read"]) + """A collection of target recommendation reports. Returned only when the job status is Succeeded.""" + total_report_count: Optional[int] = rest_field(name="totalReportCount", visibility=["read"]) + """The total number of target recommendation reports available for retrieval. Currently, only the + latest report is returned, so this value is always 1.""" + next_report_offset: Optional[int] = rest_field(name="nextReportOffset", visibility=["read"]) + """The report offset to use in the next request along with nextSectionOffset to continue + retrieving data. This value remains the same until all sections of the current report have been + retrieved. Present only when there is more data to retrieve. When both nextReportOffset and + nextSectionOffset are absent, all data has been returned.""" + next_section_offset: Optional[int] = rest_field(name="nextSectionOffset", visibility=["read"]) + """The section offset to use in the next request along with nextReportOffset to continue + retrieving sections of the current report. Present only when there is more data to retrieve. + When both nextReportOffset and nextSectionOffset are absent, all data has been returned.""" + + +class SqlServerInstanceTelemetryColumn(_Model): + """The telemetry column for the SQL Server instance. + + :ivar name: The name of the telemetry column. + :vartype name: str + :ivar type: The type of the telemetry column. Known values are: "bool", "datetime", "int", + "long", "double", "string", "guid", and "timespan". + :vartype type: str or ~azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryColumnType + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the telemetry column.""" + type: Optional[Union[str, "_models.SqlServerInstanceTelemetryColumnType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the telemetry column. Known values are: \"bool\", \"datetime\", \"int\", \"long\", + \"double\", \"string\", \"guid\", and \"timespan\".""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.SqlServerInstanceTelemetryColumnType"]] = 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 SqlServerInstanceTelemetryRequest(_Model): + """The Arc SQL Server instance telemetry retrieval request. + + :ivar dataset_name: The name of the telemetry dataset to retrieve. Required. + :vartype dataset_name: str + :ivar start_time: The start time for the time range to fetch telemetry for. If not specified, + the current time minus 1 hour is used. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time for the time range to fetch telemetry for. If not specified, the + current time is used. + :vartype end_time: ~datetime.datetime + :ivar interval: The time granularity to fetch telemetry for. This is an ISO8601 duration. + Examples: PT15M, PT1H, P1D. + :vartype interval: ~datetime.timedelta + :ivar aggregation_type: The aggregation type to use for the numerical columns in the dataset. + Known values are: "Average", "Minimum", "Maximum", "Sum", and "Count". + :vartype aggregation_type: str or ~azure.mgmt.azurearcdata.models.AggregationType + :ivar database_names: The list of database names to return telemetry for. If not specified, + telemetry for all databases will be aggregated and returned. + :vartype database_names: list[str] + """ + + dataset_name: str = rest_field(name="datasetName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the telemetry dataset to retrieve. Required.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time for the time range to fetch telemetry for. If not specified, the current time + minus 1 hour is used.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time for the time range to fetch telemetry for. If not specified, the current time is + used.""" + interval: Optional[datetime.timedelta] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The time granularity to fetch telemetry for. This is an ISO8601 duration. Examples: PT15M, + PT1H, P1D.""" + aggregation_type: Optional[Union[str, "_models.AggregationType"]] = rest_field( + name="aggregationType", visibility=["read", "create", "update", "delete", "query"] + ) + """The aggregation type to use for the numerical columns in the dataset. Known values are: + \"Average\", \"Minimum\", \"Maximum\", \"Sum\", and \"Count\".""" + database_names: Optional[list[str]] = rest_field( + name="databaseNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of database names to return telemetry for. If not specified, telemetry for all + databases will be aggregated and returned.""" + + @overload + def __init__( + self, + *, + dataset_name: str, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + interval: Optional[datetime.timedelta] = None, + aggregation_type: Optional[Union[str, "_models.AggregationType"]] = None, + database_names: Optional[list[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 SqlServerInstanceUpdate(_Model): + """An update to a SQL Server Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SqlServerInstanceUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerInstanceUpdateProperties"] = 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 SqlServerInstanceUpdateProperties(_Model): + """Properties of update SqlServerInstance. + + :ivar version: SQL Server version. Known values are: "Unknown", "SQL Server 2012", "SQL Server + 2014", "SQL Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "SQL + Server 2025". + :vartype version: str or ~azure.mgmt.azurearcdata.models.SqlVersion + :ivar edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", + "Web", "Developer", "Express", "Business Intelligence", "Standard Developer", and "Unknown". + :vartype edition: str or ~azure.mgmt.azurearcdata.models.EditionType + :ivar container_resource_id: ARM Resource id of the container resource (Azure Arc for Servers). + :vartype container_resource_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :ivar v_core: The number of logical processors used by the SQL Server instance. + :vartype v_core: str + :ivar cores: The number of total cores of the Operating System Environment (OSE) hosting the + SQL Server instance. + :vartype cores: str + :ivar status: The cloud connectivity status. Known values are: "Connected", "Disconnected", + "Registered", "Discovered", and "Unknown". + :vartype status: str or ~azure.mgmt.azurearcdata.models.ConnectionStatus + :ivar discovery_source: Indicates the discovery agent or client for this instance. Default is + Azure Arc. Known values are: "Azure Arc", "Azure Migrate", "ADS", "SSMS", "SSMA", "Import", + "DMS-Portal", "DMS-PS", "DMS-CLI", "DMS-SDK", and "Other". + :vartype discovery_source: str or ~azure.mgmt.azurearcdata.models.DiscoverySource + :ivar patch_level: SQL Server update level. + :vartype patch_level: str + :ivar collation: SQL Server collation. + :vartype collation: str + :ivar db_master_key_exists: Indicates whether database master key exists in SQL Server. + :vartype db_master_key_exists: bool + :ivar is_hadr_enabled: Indicates whether always On availability groups is enabled in SQL + Server. + :vartype is_hadr_enabled: bool + :ivar trace_flags: An array of integers, where each value represents the enabled trace flags in + SQL Server. + :vartype trace_flags: list[int] + :ivar current_version: SQL Server current version. + :vartype current_version: str + :ivar instance_name: SQL Server instance name. + :vartype instance_name: str + :ivar tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :vartype tcp_dynamic_ports: str + :ivar tcp_static_ports: Static TCP ports used by SQL Server. + :vartype tcp_static_ports: str + :ivar product_id: SQL Server product ID. + :vartype product_id: str + :ivar license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", + "ServerCAL", "LicenseOnly", "PAYG", "Paid", and "FabricCapacity". + :vartype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType + :ivar azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :vartype azure_defender_status_last_updated: ~datetime.datetime + :ivar azure_defender_status: Status of Azure Defender. Known values are: "Protected", + "Unprotected", and "Unknown". + :vartype azure_defender_status: str or ~azure.mgmt.azurearcdata.models.DefenderStatus + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server resource. + :vartype provisioning_state: str + :ivar last_inventory_upload_time: The time when last successful inventory upload was performed. + :vartype last_inventory_upload_time: ~datetime.datetime + :ivar last_usage_upload_time: The time when last successful usage upload was performed. + :vartype last_usage_upload_time: ~datetime.datetime + :ivar host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual + Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual + Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", + "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual + Machine", "Hyper-V Virtual Machine", and "Other". + :vartype host_type: str or ~azure.mgmt.azurearcdata.models.HostType + :ivar always_on_role: The role of the SQL Server, based on availability. Known values are: + "None", "FailoverClusterInstance", "FailoverClusterNode", and "AvailabilityGroupReplica". + :vartype always_on_role: str or ~azure.mgmt.azurearcdata.models.AlwaysOnRole + :ivar failover_cluster: Failover Cluster Instance properties. + :vartype failover_cluster: ~azure.mgmt.azurearcdata.models.FailoverCluster + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: ~azure.mgmt.azurearcdata.models.BackupPolicy + :ivar upgrade_locked_until: Upgrade Action for this resource is locked until it expires. The + Expiration time indicated by this value. It is not locked when it is empty. + :vartype upgrade_locked_until: ~datetime.datetime + :ivar monitoring: The monitoring configuration. + :vartype monitoring: ~azure.mgmt.azurearcdata.models.Monitoring + :ivar migration: Migration related configuration. + :vartype migration: ~azure.mgmt.azurearcdata.models.Migration + :ivar best_practices_assessment: The configuration related to SQL best practices assessment. + :vartype best_practices_assessment: ~azure.mgmt.azurearcdata.models.BestPracticesAssessment + :ivar client_connection: Client connection related configuration. + :vartype client_connection: ~azure.mgmt.azurearcdata.models.ClientConnection + :ivar service_type: Indicates if the resource represents a SQL Server engine or a SQL Server + component service installed on the host. Known values are: "Engine", "SSRS", "SSAS", "SSIS", + and "PBIRS". + :vartype service_type: str or ~azure.mgmt.azurearcdata.models.ServiceType + :ivar authentication: Authentication related configuration for the SQL Server Instance. + :vartype authentication: ~azure.mgmt.azurearcdata.models.Authentication + :ivar database_mirroring_endpoint: Database mirroring endpoint related properties. + :vartype database_mirroring_endpoint: ~azure.mgmt.azurearcdata.models.DBMEndpoint + :ivar is_microsoft_pki_cert_trust_configured: Indicates whether Microsoft PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_microsoft_pki_cert_trust_configured: bool + :ivar is_digi_cert_pki_cert_trust_configured: Indicates whether DigiCert PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_digi_cert_pki_cert_trust_configured: bool + :ivar max_server_memory_mb: maximum server memory (MB) value configured for this instance. + :vartype max_server_memory_mb: int + """ + + version: Optional[Union[str, "_models.SqlVersion"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server version. Known values are: \"Unknown\", \"SQL Server 2012\", \"SQL Server 2014\", + \"SQL Server 2016\", \"SQL Server 2017\", \"SQL Server 2019\", \"SQL Server 2022\", and \"SQL + Server 2025\".""" + edition: Optional[Union[str, "_models.EditionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server edition. Known values are: \"Evaluation\", \"Enterprise\", \"Standard\", \"Web\", + \"Developer\", \"Express\", \"Business Intelligence\", \"Standard Developer\", and \"Unknown\".""" + container_resource_id: Optional[str] = rest_field(name="containerResourceId", visibility=["read"]) + """ARM Resource id of the container resource (Azure Arc for Servers).""" + vm_id: Optional[str] = rest_field(name="vmId", visibility=["read"]) + """The unique ID of the hybrid machine that this resource belongs to.""" + create_time: Optional[str] = rest_field(name="createTime", visibility=["read"]) + """The time when the resource was created.""" + v_core: Optional[str] = rest_field(name="vCore", visibility=["read"]) + """The number of logical processors used by the SQL Server instance.""" + cores: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of total cores of the Operating System Environment (OSE) hosting the SQL Server + instance.""" + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field(visibility=["read"]) + """The cloud connectivity status. Known values are: \"Connected\", \"Disconnected\", + \"Registered\", \"Discovered\", and \"Unknown\".""" + discovery_source: Optional[Union[str, "_models.DiscoverySource"]] = rest_field( + name="discoverySource", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the discovery agent or client for this instance. Default is Azure Arc. Known values + are: \"Azure Arc\", \"Azure Migrate\", \"ADS\", \"SSMS\", \"SSMA\", \"Import\", \"DMS-Portal\", + \"DMS-PS\", \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + patch_level: Optional[str] = rest_field(name="patchLevel", visibility=["read"]) + """SQL Server update level.""" + collation: Optional[str] = rest_field(visibility=["read"]) + """SQL Server collation.""" + db_master_key_exists: Optional[bool] = rest_field(name="dbMasterKeyExists", visibility=["read"]) + """Indicates whether database master key exists in SQL Server.""" + is_hadr_enabled: Optional[bool] = rest_field(name="isHadrEnabled", visibility=["read"]) + """Indicates whether always On availability groups is enabled in SQL Server.""" + trace_flags: Optional[list[int]] = rest_field(name="traceFlags", visibility=["read"]) + """An array of integers, where each value represents the enabled trace flags in SQL Server.""" + current_version: Optional[str] = rest_field(name="currentVersion", visibility=["read"]) + """SQL Server current version.""" + instance_name: Optional[str] = rest_field( + name="instanceName", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server instance name.""" + tcp_dynamic_ports: Optional[str] = rest_field(name="tcpDynamicPorts", visibility=["read"]) + """Dynamic TCP ports used by SQL Server.""" + tcp_static_ports: Optional[str] = rest_field(name="tcpStaticPorts", visibility=["read"]) + """Static TCP ports used by SQL Server.""" + product_id: Optional[str] = rest_field(name="productId", visibility=["read"]) + """SQL Server product ID.""" + license_type: Optional[Union[str, "_models.ArcSqlServerLicenseType"]] = rest_field( + name="licenseType", visibility=["read"] + ) + """SQL Server license type. Known values are: \"Undefined\", \"Free\", \"HADR\", \"ServerCAL\", + \"LicenseOnly\", \"PAYG\", \"Paid\", and \"FabricCapacity\".""" + azure_defender_status_last_updated: Optional[datetime.datetime] = rest_field( + name="azureDefenderStatusLastUpdated", visibility=["read"], format="rfc3339" + ) + """Timestamp of last Azure Defender status update.""" + azure_defender_status: Optional[Union[str, "_models.DefenderStatus"]] = rest_field( + name="azureDefenderStatus", visibility=["read"] + ) + """Status of Azure Defender. Known values are: \"Protected\", \"Unprotected\", and \"Unknown\".""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The provisioning state of the Arc-enabled SQL Server resource.""" + last_inventory_upload_time: Optional[datetime.datetime] = rest_field( + name="lastInventoryUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when last successful inventory upload was performed.""" + last_usage_upload_time: Optional[datetime.datetime] = rest_field( + name="lastUsageUploadTime", visibility=["read"], format="rfc3339" + ) + """The time when last successful usage upload was performed.""" + host_type: Optional[Union[str, "_models.HostType"]] = rest_field( + name="hostType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of host for Azure Arc SQL Server. Known values are: \"Azure Virtual Machine\", \"Azure + VMWare Virtual Machine\", \"Azure Kubernetes Service\", \"AWS VMWare Virtual Machine\", \"AWS + Kubernetes Service\", \"GCP VMWare Virtual Machine\", \"GCP Kubernetes Service\", + \"Container\", \"Virtual Machine\", \"Physical Server\", \"AWS Virtual Machine\", \"GCP Virtual + Machine\", \"Hyper-V Virtual Machine\", and \"Other\".""" + always_on_role: Optional[Union[str, "_models.AlwaysOnRole"]] = rest_field(name="alwaysOnRole", visibility=["read"]) + """The role of the SQL Server, based on availability. Known values are: \"None\", + \"FailoverClusterInstance\", \"FailoverClusterNode\", and \"AvailabilityGroupReplica\".""" + failover_cluster: Optional["_models.FailoverCluster"] = rest_field( + name="failoverCluster", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover Cluster Instance properties.""" + backup_policy: Optional["_models.BackupPolicy"] = rest_field( + name="backupPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The backup profile for the SQL server.""" + upgrade_locked_until: Optional[datetime.datetime] = rest_field( + name="upgradeLockedUntil", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Upgrade Action for this resource is locked until it expires. The Expiration time indicated by + this value. It is not locked when it is empty.""" + monitoring: Optional["_models.Monitoring"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The monitoring configuration.""" + migration: Optional["_models.Migration"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Migration related configuration.""" + best_practices_assessment: Optional["_models.BestPracticesAssessment"] = rest_field( + name="bestPracticesAssessment", visibility=["read", "create", "update", "delete", "query"] + ) + """The configuration related to SQL best practices assessment.""" + client_connection: Optional["_models.ClientConnection"] = rest_field( + name="clientConnection", visibility=["read", "create", "update", "delete", "query"] + ) + """Client connection related configuration.""" + service_type: Optional[Union[str, "_models.ServiceType"]] = rest_field( + name="serviceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates if the resource represents a SQL Server engine or a SQL Server component service + installed on the host. Known values are: \"Engine\", \"SSRS\", \"SSAS\", \"SSIS\", and + \"PBIRS\".""" + authentication: Optional["_models.Authentication"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Authentication related configuration for the SQL Server Instance.""" + database_mirroring_endpoint: Optional["_models.DBMEndpoint"] = rest_field( + name="databaseMirroringEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Database mirroring endpoint related properties.""" + is_microsoft_pki_cert_trust_configured: Optional[bool] = rest_field( + name="isMicrosoftPkiCertTrustConfigured", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether Microsoft PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + is_digi_cert_pki_cert_trust_configured: Optional[bool] = rest_field( + name="isDigiCertPkiCertTrustConfigured", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether DigiCert PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + max_server_memory_mb: Optional[int] = rest_field( + name="maxServerMemoryMB", visibility=["read", "create", "update", "delete", "query"] + ) + """maximum server memory (MB) value configured for this instance.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + version: Optional[Union[str, "_models.SqlVersion"]] = None, + edition: Optional[Union[str, "_models.EditionType"]] = None, + cores: Optional[str] = None, + discovery_source: Optional[Union[str, "_models.DiscoverySource"]] = None, + instance_name: Optional[str] = None, + host_type: Optional[Union[str, "_models.HostType"]] = None, + failover_cluster: Optional["_models.FailoverCluster"] = None, + backup_policy: Optional["_models.BackupPolicy"] = None, + upgrade_locked_until: Optional[datetime.datetime] = None, + monitoring: Optional["_models.Monitoring"] = None, + migration: Optional["_models.Migration"] = None, + best_practices_assessment: Optional["_models.BestPracticesAssessment"] = None, + client_connection: Optional["_models.ClientConnection"] = None, + service_type: Optional[Union[str, "_models.ServiceType"]] = None, + authentication: Optional["_models.Authentication"] = None, + database_mirroring_endpoint: Optional["_models.DBMEndpoint"] = None, + is_microsoft_pki_cert_trust_configured: Optional[bool] = None, + is_digi_cert_pki_cert_trust_configured: Optional[bool] = None, + max_server_memory_mb: Optional[int] = 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 SqlServerLicense(TrackedResource): + """Describe SQL Server license 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.azurearcdata.models.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: SQL Server license properties. Required. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerLicenseProperties + """ + + properties: "_models.SqlServerLicenseProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server license properties. Required.""" + + @overload + def __init__( + self, + *, + location: str, + properties: "_models.SqlServerLicenseProperties", + tags: Optional[dict[str, 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 SqlServerLicenseProperties(_Model): + """Properties of SQL Server License. + + :ivar billing_plan: SQL Server license type. Required. Known values are: "PAYG" and "Paid". + :vartype billing_plan: str or ~azure.mgmt.azurearcdata.models.BillingPlan + :ivar physical_cores: The number of total cores of the license covers. Required. + :vartype physical_cores: int + :ivar license_category: This property represents the choice between SQL Server Core and ESU + licenses. Required. "Core" + :vartype license_category: str or ~azure.mgmt.azurearcdata.models.LicenseCategory + :ivar activation_state: The activation state of the license. Required. Known values are: + "Activated" and "Deactivated". + :vartype activation_state: str or ~azure.mgmt.azurearcdata.models.ActivationState + :ivar scope_type: The Azure scope to which the license will apply. Required. Known values are: + "Tenant", "Subscription", and "ResourceGroup". + :vartype scope_type: str or ~azure.mgmt.azurearcdata.models.ScopeType + :ivar last_activated_at: The timestamp of the most recent activation of the SqlServerLicense. + :vartype last_activated_at: ~datetime.datetime + :ivar last_deactivated_at: The timestamp of the most recent deactivation of the + SqlServerLicense. + :vartype last_deactivated_at: ~datetime.datetime + :ivar tenant_id: The tenantId the SQL Server license resource subscription resides in. + :vartype tenant_id: str + """ + + billing_plan: Union[str, "_models.BillingPlan"] = rest_field( + name="billingPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server license type. Required. Known values are: \"PAYG\" and \"Paid\".""" + physical_cores: int = rest_field(name="physicalCores", visibility=["read", "create", "update", "delete", "query"]) + """The number of total cores of the license covers. Required.""" + license_category: Union[str, "_models.LicenseCategory"] = rest_field( + name="licenseCategory", visibility=["read", "create"] + ) + """This property represents the choice between SQL Server Core and ESU licenses. Required. + \"Core\"""" + activation_state: Union[str, "_models.ActivationState"] = rest_field( + name="activationState", visibility=["read", "create", "update", "delete", "query"] + ) + """The activation state of the license. Required. Known values are: \"Activated\" and + \"Deactivated\".""" + scope_type: Union[str, "_models.ScopeType"] = rest_field( + name="scopeType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure scope to which the license will apply. Required. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + last_activated_at: Optional[datetime.datetime] = rest_field( + name="lastActivatedAt", visibility=["read"], format="rfc3339" + ) + """The timestamp of the most recent activation of the SqlServerLicense.""" + last_deactivated_at: Optional[datetime.datetime] = rest_field( + name="lastDeactivatedAt", visibility=["read"], format="rfc3339" + ) + """The timestamp of the most recent deactivation of the SqlServerLicense.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenantId the SQL Server license resource subscription resides in.""" + + @overload + def __init__( + self, + *, + billing_plan: Union[str, "_models.BillingPlan"], + physical_cores: int, + license_category: Union[str, "_models.LicenseCategory"], + activation_state: Union[str, "_models.ActivationState"], + scope_type: Union[str, "_models.ScopeType"], + ) -> 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 SqlServerLicenseUpdate(_Model): + """An update to a SQL Server license resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerLicenseUpdateProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.SqlServerLicenseUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """null.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SqlServerLicenseUpdateProperties"] = 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 SqlServerLicenseUpdateProperties(_Model): + """Properties of update SqlServerLicense. + + :ivar billing_plan: SQL Server license type. Known values are: "PAYG" and "Paid". + :vartype billing_plan: str or ~azure.mgmt.azurearcdata.models.BillingPlan + :ivar physical_cores: The number of total cores of the license covers. + :vartype physical_cores: int + :ivar license_category: This property represents the choice between SQL Server Core and ESU + licenses. "Core" + :vartype license_category: str or ~azure.mgmt.azurearcdata.models.LicenseCategory + :ivar activation_state: The activation state of the license. Known values are: "Activated" and + "Deactivated". + :vartype activation_state: str or ~azure.mgmt.azurearcdata.models.ActivationState + :ivar scope_type: The Azure scope to which the license will apply. Known values are: "Tenant", + "Subscription", and "ResourceGroup". + :vartype scope_type: str or ~azure.mgmt.azurearcdata.models.ScopeType + :ivar last_activated_at: The timestamp of the most recent activation of the SqlServerLicense. + :vartype last_activated_at: ~datetime.datetime + :ivar last_deactivated_at: The timestamp of the most recent deactivation of the + SqlServerLicense. + :vartype last_deactivated_at: ~datetime.datetime + :ivar tenant_id: The tenantId the SQL Server license resource subscription resides in. + :vartype tenant_id: str + """ + + billing_plan: Optional[Union[str, "_models.BillingPlan"]] = rest_field( + name="billingPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server license type. Known values are: \"PAYG\" and \"Paid\".""" + physical_cores: Optional[int] = rest_field( + name="physicalCores", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of total cores of the license covers.""" + license_category: Optional[Union[str, "_models.LicenseCategory"]] = rest_field( + name="licenseCategory", visibility=["read", "create"] + ) + """This property represents the choice between SQL Server Core and ESU licenses. \"Core\"""" + activation_state: Optional[Union[str, "_models.ActivationState"]] = rest_field( + name="activationState", visibility=["read", "create", "update", "delete", "query"] + ) + """The activation state of the license. Known values are: \"Activated\" and \"Deactivated\".""" + scope_type: Optional[Union[str, "_models.ScopeType"]] = rest_field( + name="scopeType", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure scope to which the license will apply. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + last_activated_at: Optional[datetime.datetime] = rest_field( + name="lastActivatedAt", visibility=["read"], format="rfc3339" + ) + """The timestamp of the most recent activation of the SqlServerLicense.""" + last_deactivated_at: Optional[datetime.datetime] = rest_field( + name="lastDeactivatedAt", visibility=["read"], format="rfc3339" + ) + """The timestamp of the most recent deactivation of the SqlServerLicense.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenantId the SQL Server license resource subscription resides in.""" + + @overload + def __init__( + self, + *, + billing_plan: Optional[Union[str, "_models.BillingPlan"]] = None, + physical_cores: Optional[int] = None, + license_category: Optional[Union[str, "_models.LicenseCategory"]] = None, + activation_state: Optional[Union[str, "_models.ActivationState"]] = None, + scope_type: Optional[Union[str, "_models.ScopeType"]] = 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 SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = 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 TargetReadiness(_Model): + """The target readiness for migration for this database. + + :ivar azure_sql_database: The SKU recommendation summary. + :vartype azure_sql_database: ~azure.mgmt.azurearcdata.models.SkuRecommendationSummary + :ivar azure_sql_managed_instance: The SKU recommendation summary. + :vartype azure_sql_managed_instance: ~azure.mgmt.azurearcdata.models.SkuRecommendationSummary + :ivar azure_sql_virtual_machine: The SKU recommendation summary. + :vartype azure_sql_virtual_machine: ~azure.mgmt.azurearcdata.models.SkuRecommendationSummary + """ + + azure_sql_database: Optional["_models.SkuRecommendationSummary"] = rest_field( + name="azureSqlDatabase", visibility=["read", "create", "update", "delete", "query"] + ) + """The SKU recommendation summary.""" + azure_sql_managed_instance: Optional["_models.SkuRecommendationSummary"] = rest_field( + name="azureSqlManagedInstance", visibility=["read", "create", "update", "delete", "query"] + ) + """The SKU recommendation summary.""" + azure_sql_virtual_machine: Optional["_models.SkuRecommendationSummary"] = rest_field( + name="azureSqlVirtualMachine", visibility=["read", "create", "update", "delete", "query"] + ) + """The SKU recommendation summary.""" + + @overload + def __init__( + self, + *, + azure_sql_database: Optional["_models.SkuRecommendationSummary"] = None, + azure_sql_managed_instance: Optional["_models.SkuRecommendationSummary"] = None, + azure_sql_virtual_machine: Optional["_models.SkuRecommendationSummary"] = 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 UploadServicePrincipal(_Model): + """Service principal for uploading billing, metrics and logs. + + :ivar client_id: Client ID of the service principal for uploading data. + :vartype client_id: str + :ivar tenant_id: Tenant ID of the service principal. + :vartype tenant_id: str + :ivar authority: Authority for the service principal. Example: + `https://login.microsoftonline.com/ `_. + :vartype authority: str + :ivar client_secret: Secret of the service principal. + :vartype client_secret: str + """ + + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """Client ID of the service principal for uploading data.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the service principal.""" + authority: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authority for the service principal. Example: `https://login.microsoftonline.com/ + `_.""" + client_secret: Optional[str] = rest_field(name="clientSecret", visibility=["create", "update"]) + """Secret of the service principal.""" + + @overload + def __init__( + self, + *, + client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + authority: Optional[str] = None, + client_secret: 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 UploadWatermark(_Model): + """Properties on upload watermark. Mostly timestamp for each upload data type. + + :ivar metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current date + time. + :vartype metrics: ~datetime.datetime + :ivar logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date time. + :vartype logs: ~datetime.datetime + :ivar usages: Last uploaded date for usages from kubernetes cluster. Defaults to current date + time. + :vartype usages: ~datetime.datetime + """ + + metrics: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date for metrics from kubernetes cluster. Defaults to current date time.""" + logs: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date for logs from kubernetes cluster. Defaults to current date time.""" + usages: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last uploaded date for usages from kubernetes cluster. Defaults to current date time.""" + + @overload + def __init__( + self, + *, + metrics: Optional[datetime.datetime] = None, + logs: Optional[datetime.datetime] = None, + usages: Optional[datetime.datetime] = 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) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py deleted file mode 100644 index aa564c0632f0..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_models_py3.py +++ /dev/null @@ -1,2501 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from collections.abc import MutableMapping -import datetime -from typing import Any, Literal, Optional, TYPE_CHECKING, Union - -from .._utils import serialization as _serialization - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] - - -class ActiveDirectoryConnectorDNSDetails(_serialization.Model): - """DNS server details. - - All required parameters must be populated in order to send to server. - - :ivar domain_name: DNS domain name for which DNS lookups should be forwarded to the Active - Directory DNS servers. - :vartype domain_name: str - :ivar nameserver_ip_addresses: List of Active Directory DNS server IP addresses. Required. - :vartype nameserver_ip_addresses: list[str] - :ivar replicas: Replica count for DNS proxy service. Default value is 1. - :vartype replicas: int - :ivar prefer_k8_s_dns_for_ptr_lookups: Flag indicating whether to prefer Kubernetes DNS server - response over AD DNS server response for IP address lookups. - :vartype prefer_k8_s_dns_for_ptr_lookups: bool - """ - - _validation = { - "nameserver_ip_addresses": {"required": True}, - } - - _attribute_map = { - "domain_name": {"key": "domainName", "type": "str"}, - "nameserver_ip_addresses": {"key": "nameserverIPAddresses", "type": "[str]"}, - "replicas": {"key": "replicas", "type": "int"}, - "prefer_k8_s_dns_for_ptr_lookups": {"key": "preferK8sDnsForPtrLookups", "type": "bool"}, - } - - def __init__( - self, - *, - nameserver_ip_addresses: list[str], - domain_name: Optional[str] = None, - replicas: int = 1, - prefer_k8_s_dns_for_ptr_lookups: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword domain_name: DNS domain name for which DNS lookups should be forwarded to the Active - Directory DNS servers. - :paramtype domain_name: str - :keyword nameserver_ip_addresses: List of Active Directory DNS server IP addresses. Required. - :paramtype nameserver_ip_addresses: list[str] - :keyword replicas: Replica count for DNS proxy service. Default value is 1. - :paramtype replicas: int - :keyword prefer_k8_s_dns_for_ptr_lookups: Flag indicating whether to prefer Kubernetes DNS - server response over AD DNS server response for IP address lookups. - :paramtype prefer_k8_s_dns_for_ptr_lookups: bool - """ - super().__init__(**kwargs) - self.domain_name = domain_name - self.nameserver_ip_addresses = nameserver_ip_addresses - self.replicas = replicas - self.prefer_k8_s_dns_for_ptr_lookups = prefer_k8_s_dns_for_ptr_lookups - - -class ActiveDirectoryConnectorDomainDetails(_serialization.Model): - """Active Directory domain details. - - All required parameters must be populated in order to send to server. - - :ivar realm: Name (uppercase) of the Active Directory domain that this AD connector will be - associated with. Required. - :vartype realm: str - :ivar netbios_domain_name: NETBIOS name of the Active Directory domain. - :vartype netbios_domain_name: str - :ivar service_account_provisioning: The service account provisioning mode for this Active - Directory connector. Known values are: "automatic" and "manual". - :vartype service_account_provisioning: str or - ~azure.mgmt.azurearcdata.models.AccountProvisioningMode - :ivar ou_distinguished_name: The distinguished name of the Active Directory Organizational - Unit. - :vartype ou_distinguished_name: str - :ivar domain_controllers: null. Required. - :vartype domain_controllers: ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers - """ - - _validation = { - "realm": {"required": True}, - "domain_controllers": {"required": True}, - } - - _attribute_map = { - "realm": {"key": "realm", "type": "str"}, - "netbios_domain_name": {"key": "netbiosDomainName", "type": "str"}, - "service_account_provisioning": {"key": "serviceAccountProvisioning", "type": "str"}, - "ou_distinguished_name": {"key": "ouDistinguishedName", "type": "str"}, - "domain_controllers": {"key": "domainControllers", "type": "ActiveDirectoryDomainControllers"}, - } - - def __init__( - self, - *, - realm: str, - domain_controllers: "_models.ActiveDirectoryDomainControllers", - netbios_domain_name: Optional[str] = None, - service_account_provisioning: Union[str, "_models.AccountProvisioningMode"] = "manual", - ou_distinguished_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword realm: Name (uppercase) of the Active Directory domain that this AD connector will be - associated with. Required. - :paramtype realm: str - :keyword netbios_domain_name: NETBIOS name of the Active Directory domain. - :paramtype netbios_domain_name: str - :keyword service_account_provisioning: The service account provisioning mode for this Active - Directory connector. Known values are: "automatic" and "manual". - :paramtype service_account_provisioning: str or - ~azure.mgmt.azurearcdata.models.AccountProvisioningMode - :keyword ou_distinguished_name: The distinguished name of the Active Directory Organizational - Unit. - :paramtype ou_distinguished_name: str - :keyword domain_controllers: null. Required. - :paramtype domain_controllers: ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainControllers - """ - super().__init__(**kwargs) - self.realm = realm - self.netbios_domain_name = netbios_domain_name - self.service_account_provisioning = service_account_provisioning - self.ou_distinguished_name = ou_distinguished_name - self.domain_controllers = domain_controllers - - -class ActiveDirectoryConnectorListResult(_serialization.Model): - """A list of active directory connectors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ActiveDirectoryConnectorResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ActiveDirectoryConnectorResource"]] = None - self.next_link: Optional[str] = None - - -class ActiveDirectoryConnectorProperties(_serialization.Model): - """The properties of an Active Directory connector resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar domain_service_account_login_information: Username and password for domain service - account authentication. - :vartype domain_service_account_login_information: - ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar provisioning_state: The provisioning state of the Active Directory connector resource. - :vartype provisioning_state: str - :ivar spec: null. Required. - :vartype spec: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec - :ivar status: null. - :vartype status: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "spec": {"required": True}, - } - - _attribute_map = { - "domain_service_account_login_information": { - "key": "domainServiceAccountLoginInformation", - "type": "BasicLoginInformation", - }, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "spec": {"key": "spec", "type": "ActiveDirectoryConnectorSpec"}, - "status": {"key": "status", "type": "ActiveDirectoryConnectorStatus"}, - } - - def __init__( - self, - *, - spec: "_models.ActiveDirectoryConnectorSpec", - domain_service_account_login_information: Optional["_models.BasicLoginInformation"] = None, - status: Optional["_models.ActiveDirectoryConnectorStatus"] = None, - **kwargs: Any - ) -> None: - """ - :keyword domain_service_account_login_information: Username and password for domain service - account authentication. - :paramtype domain_service_account_login_information: - ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword spec: null. Required. - :paramtype spec: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorSpec - :keyword status: null. - :paramtype status: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorStatus - """ - super().__init__(**kwargs) - self.domain_service_account_login_information = domain_service_account_login_information - self.provisioning_state: Optional[str] = None - self.spec = spec - self.status = status - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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.azurearcdata.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.system_data: Optional["_models.SystemData"] = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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.azurearcdata.models.SystemData - """ - - -class ActiveDirectoryConnectorResource(ProxyResource): - """Active directory connector resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.SystemData - :ivar properties: null. Required. - :vartype properties: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ActiveDirectoryConnectorProperties"}, - } - - def __init__(self, *, properties: "_models.ActiveDirectoryConnectorProperties", **kwargs: Any) -> None: - """ - :keyword properties: null. Required. - :paramtype properties: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ActiveDirectoryConnectorSpec(_serialization.Model): - """The specifications of the AD Kubernetes resource. - - All required parameters must be populated in order to send to server. - - :ivar active_directory: null. Required. - :vartype active_directory: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails - :ivar dns: null. Required. - :vartype dns: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails - """ - - _validation = { - "active_directory": {"required": True}, - "dns": {"required": True}, - } - - _attribute_map = { - "active_directory": {"key": "activeDirectory", "type": "ActiveDirectoryConnectorDomainDetails"}, - "dns": {"key": "dns", "type": "ActiveDirectoryConnectorDNSDetails"}, - } - - def __init__( - self, - *, - active_directory: "_models.ActiveDirectoryConnectorDomainDetails", - dns: "_models.ActiveDirectoryConnectorDNSDetails", - **kwargs: Any - ) -> None: - """ - :keyword active_directory: null. Required. - :paramtype active_directory: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDomainDetails - :keyword dns: null. Required. - :paramtype dns: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorDNSDetails - """ - super().__init__(**kwargs) - self.active_directory = active_directory - self.dns = dns - - -class ActiveDirectoryConnectorStatus(_serialization.Model): - """The status of the Kubernetes custom resource. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar last_update_time: The time that the custom resource was last updated. - :vartype last_update_time: str - :ivar observed_generation: The version of the replicaSet associated with the AD connector - custom resource. - :vartype observed_generation: int - :ivar state: The state of the AD connector custom resource. - :vartype state: str - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "last_update_time": {"key": "lastUpdateTime", "type": "str"}, - "observed_generation": {"key": "observedGeneration", "type": "int"}, - "state": {"key": "state", "type": "str"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - last_update_time: Optional[str] = None, - observed_generation: Optional[int] = None, - state: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword last_update_time: The time that the custom resource was last updated. - :paramtype last_update_time: str - :keyword observed_generation: The version of the replicaSet associated with the AD connector - custom resource. - :paramtype observed_generation: int - :keyword state: The state of the AD connector custom resource. - :paramtype state: str - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.last_update_time = last_update_time - self.observed_generation = observed_generation - self.state = state - - -class ActiveDirectoryDomainController(_serialization.Model): - """Information about a domain controller in the AD domain. - - All required parameters must be populated in order to send to server. - - :ivar hostname: Fully-qualified domain name of a domain controller in the AD domain. Required. - :vartype hostname: str - """ - - _validation = { - "hostname": {"required": True}, - } - - _attribute_map = { - "hostname": {"key": "hostname", "type": "str"}, - } - - def __init__(self, *, hostname: str, **kwargs: Any) -> None: - """ - :keyword hostname: Fully-qualified domain name of a domain controller in the AD domain. - Required. - :paramtype hostname: str - """ - super().__init__(**kwargs) - self.hostname = hostname - - -class ActiveDirectoryDomainControllers(_serialization.Model): - """Details about the Active Directory domain controllers associated with this AD connector - instance. - - :ivar primary_domain_controller: Information about the Primary Domain Controller (PDC) in the - AD domain. - :vartype primary_domain_controller: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController - :ivar secondary_domain_controllers: null. - :vartype secondary_domain_controllers: - list[~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController] - """ - - _attribute_map = { - "primary_domain_controller": {"key": "primaryDomainController", "type": "ActiveDirectoryDomainController"}, - "secondary_domain_controllers": { - "key": "secondaryDomainControllers", - "type": "[ActiveDirectoryDomainController]", - }, - } - - def __init__( - self, - *, - primary_domain_controller: Optional["_models.ActiveDirectoryDomainController"] = None, - secondary_domain_controllers: Optional[list["_models.ActiveDirectoryDomainController"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_domain_controller: Information about the Primary Domain Controller (PDC) in - the AD domain. - :paramtype primary_domain_controller: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController - :keyword secondary_domain_controllers: null. - :paramtype secondary_domain_controllers: - list[~azure.mgmt.azurearcdata.models.ActiveDirectoryDomainController] - """ - super().__init__(**kwargs) - self.primary_domain_controller = primary_domain_controller - self.secondary_domain_controllers = secondary_domain_controllers - - -class ActiveDirectoryInformation(_serialization.Model): - """Active Directory information that related to the resource. - - :ivar keytab_information: Keytab information that is used for the Sql Managed Instance when - Active Directory authentication is used. - :vartype keytab_information: ~azure.mgmt.azurearcdata.models.KeytabInformation - """ - - _attribute_map = { - "keytab_information": {"key": "keytabInformation", "type": "KeytabInformation"}, - } - - def __init__(self, *, keytab_information: Optional["_models.KeytabInformation"] = None, **kwargs: Any) -> None: - """ - :keyword keytab_information: Keytab information that is used for the Sql Managed Instance when - Active Directory authentication is used. - :paramtype keytab_information: ~azure.mgmt.azurearcdata.models.KeytabInformation - """ - super().__init__(**kwargs) - self.keytab_information = keytab_information - - -class BasicLoginInformation(_serialization.Model): - """Username and password for basic login authentication. - - :ivar username: Login username. - :vartype username: str - :ivar password: Login password. - :vartype password: str - """ - - _attribute_map = { - "username": {"key": "username", "type": "str"}, - "password": {"key": "password", "type": "str"}, - } - - def __init__(self, *, username: Optional[str] = None, password: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword username: Login username. - :paramtype username: str - :keyword password: Login password. - :paramtype password: str - """ - super().__init__(**kwargs) - self.username = username - self.password = password - - -class CommonSku(_serialization.Model): - """The resource model definition representing SKU for ARM resources. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the SKU. It is typically a letter+number code. Required. - :vartype name: str - :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used - for dev/test purpose. - :vartype dev: bool - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "dev": {"key": "dev", "type": "bool"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - } - - def __init__( - self, - *, - name: str, - dev: bool = True, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the SKU. It is typically a letter+number code. Required. - :paramtype name: str - :keyword dev: Whether dev/test is enabled. When the dev field is set to true, the resource is - used for dev/test purpose. - :paramtype dev: bool - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - """ - super().__init__(**kwargs) - self.name = name - self.dev = dev - self.size = size - self.family = family - self.capacity = capacity - - -class DataControllerProperties(_serialization.Model): - """The data controller properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar infrastructure: The infrastructure the data controller is running on. Known values are: - "azure", "gcp", "aws", "alibaba", "onpremises", and "other". - :vartype infrastructure: str or ~azure.mgmt.azurearcdata.models.Infrastructure - :ivar on_premise_property: Properties from the Kubernetes data controller. - :vartype on_premise_property: ~azure.mgmt.azurearcdata.models.OnPremiseProperty - :ivar k8_s_raw: The raw kubernetes information. - :vartype k8_s_raw: JSON - :ivar upload_watermark: Properties on upload watermark. Mostly timestamp for each upload data - type. - :vartype upload_watermark: ~azure.mgmt.azurearcdata.models.UploadWatermark - :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date - time. - :vartype last_uploaded_date: ~datetime.datetime - :ivar basic_login_information: Deprecated. Azure Arc Data Services data controller no longer - expose any endpoint. All traffic are exposed through Kubernetes native API. - :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar metrics_dashboard_credential: Login credential for metrics dashboard on the Kubernetes - cluster. - :vartype metrics_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar logs_dashboard_credential: Login credential for logs dashboard on the Kubernetes cluster. - :vartype logs_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar log_analytics_workspace_config: Log analytics workspace id and primary key. - :vartype log_analytics_workspace_config: - ~azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig - :ivar upload_service_principal: Deprecated. Service principal is deprecated in favor of Arc - Kubernetes service extension managed identity. - :vartype upload_service_principal: ~azure.mgmt.azurearcdata.models.UploadServicePrincipal - :ivar provisioning_state: The provisioning state of the Arc Data Controller resource. - :vartype provisioning_state: str - :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected - cluster the custom location belongs to. - :vartype cluster_id: str - :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension - the custom location belongs to. - :vartype extension_id: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "infrastructure": {"key": "infrastructure", "type": "str"}, - "on_premise_property": {"key": "onPremiseProperty", "type": "OnPremiseProperty"}, - "k8_s_raw": {"key": "k8sRaw", "type": "object"}, - "upload_watermark": {"key": "uploadWatermark", "type": "UploadWatermark"}, - "last_uploaded_date": {"key": "lastUploadedDate", "type": "iso-8601"}, - "basic_login_information": {"key": "basicLoginInformation", "type": "BasicLoginInformation"}, - "metrics_dashboard_credential": {"key": "metricsDashboardCredential", "type": "BasicLoginInformation"}, - "logs_dashboard_credential": {"key": "logsDashboardCredential", "type": "BasicLoginInformation"}, - "log_analytics_workspace_config": {"key": "logAnalyticsWorkspaceConfig", "type": "LogAnalyticsWorkspaceConfig"}, - "upload_service_principal": {"key": "uploadServicePrincipal", "type": "UploadServicePrincipal"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "str"}, - "extension_id": {"key": "extensionId", "type": "str"}, - } - - def __init__( - self, - *, - infrastructure: Union[str, "_models.Infrastructure"] = "other", - on_premise_property: Optional["_models.OnPremiseProperty"] = None, - k8_s_raw: Optional[JSON] = None, - upload_watermark: Optional["_models.UploadWatermark"] = None, - last_uploaded_date: Optional[datetime.datetime] = None, - basic_login_information: Optional["_models.BasicLoginInformation"] = None, - metrics_dashboard_credential: Optional["_models.BasicLoginInformation"] = None, - logs_dashboard_credential: Optional["_models.BasicLoginInformation"] = None, - log_analytics_workspace_config: Optional["_models.LogAnalyticsWorkspaceConfig"] = None, - upload_service_principal: Optional["_models.UploadServicePrincipal"] = None, - cluster_id: Optional[str] = None, - extension_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword infrastructure: The infrastructure the data controller is running on. Known values - are: "azure", "gcp", "aws", "alibaba", "onpremises", and "other". - :paramtype infrastructure: str or ~azure.mgmt.azurearcdata.models.Infrastructure - :keyword on_premise_property: Properties from the Kubernetes data controller. - :paramtype on_premise_property: ~azure.mgmt.azurearcdata.models.OnPremiseProperty - :keyword k8_s_raw: The raw kubernetes information. - :paramtype k8_s_raw: JSON - :keyword upload_watermark: Properties on upload watermark. Mostly timestamp for each upload - data type. - :paramtype upload_watermark: ~azure.mgmt.azurearcdata.models.UploadWatermark - :keyword last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current - date time. - :paramtype last_uploaded_date: ~datetime.datetime - :keyword basic_login_information: Deprecated. Azure Arc Data Services data controller no longer - expose any endpoint. All traffic are exposed through Kubernetes native API. - :paramtype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword metrics_dashboard_credential: Login credential for metrics dashboard on the Kubernetes - cluster. - :paramtype metrics_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword logs_dashboard_credential: Login credential for logs dashboard on the Kubernetes - cluster. - :paramtype logs_dashboard_credential: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword log_analytics_workspace_config: Log analytics workspace id and primary key. - :paramtype log_analytics_workspace_config: - ~azure.mgmt.azurearcdata.models.LogAnalyticsWorkspaceConfig - :keyword upload_service_principal: Deprecated. Service principal is deprecated in favor of Arc - Kubernetes service extension managed identity. - :paramtype upload_service_principal: ~azure.mgmt.azurearcdata.models.UploadServicePrincipal - :keyword cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected - cluster the custom location belongs to. - :paramtype cluster_id: str - :keyword extension_id: If a CustomLocation is provided, this contains the ARM id of the - extension the custom location belongs to. - :paramtype extension_id: str - """ - super().__init__(**kwargs) - self.infrastructure = infrastructure - self.on_premise_property = on_premise_property - self.k8_s_raw = k8_s_raw - self.upload_watermark = upload_watermark - self.last_uploaded_date = last_uploaded_date - self.basic_login_information = basic_login_information - self.metrics_dashboard_credential = metrics_dashboard_credential - self.logs_dashboard_credential = logs_dashboard_credential - self.log_analytics_workspace_config = log_analytics_workspace_config - self.upload_service_principal = upload_service_principal - self.provisioning_state: Optional[str] = None - self.cluster_id = cluster_id - self.extension_id = extension_id - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class DataControllerResource(TrackedResource): - """Data controller resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar extended_location: The extendedLocation of the resource. - :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :ivar properties: The data controller's properties. Required. - :vartype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "properties": {"key": "properties", "type": "DataControllerProperties"}, - } - - def __init__( - self, - *, - location: str, - properties: "_models.DataControllerProperties", - tags: Optional[dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword extended_location: The extendedLocation of the resource. - :paramtype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :keyword properties: The data controller's properties. Required. - :paramtype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.extended_location = extended_location - self.properties = properties - - -class DataControllerUpdate(_serialization.Model): - """Used for updating a data controller resource. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The data controller's properties. - :vartype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "DataControllerProperties"}, - } - - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.DataControllerProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The data controller's properties. - :paramtype properties: ~azure.mgmt.azurearcdata.models.DataControllerProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class ErrorResponse(_serialization.Model): - """An error response from the Azure Data on Azure Arc service. - - :ivar error: null. - :vartype error: ~azure.mgmt.azurearcdata.models.ErrorResponseBody - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorResponseBody"}, - } - - def __init__(self, *, error: Optional["_models.ErrorResponseBody"] = None, **kwargs: Any) -> None: - """ - :keyword error: null. - :paramtype error: ~azure.mgmt.azurearcdata.models.ErrorResponseBody - """ - super().__init__(**kwargs) - self.error = error - - -class ErrorResponseBody(_serialization.Model): - """An error response from the Batch service. - - :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :vartype code: str - :ivar message: A message describing the error, intended to be suitable for display in a user - interface. - :vartype message: str - :ivar target: The target of the particular error. For example, the name of the property in - error. - :vartype target: str - :ivar details: A list of additional details about the error. - :vartype details: list[~azure.mgmt.azurearcdata.models.ErrorResponseBody] - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorResponseBody]"}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[list["_models.ErrorResponseBody"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :paramtype code: str - :keyword message: A message describing the error, intended to be suitable for display in a user - interface. - :paramtype message: str - :keyword target: The target of the particular error. For example, the name of the property in - error. - :paramtype target: str - :keyword details: A list of additional details about the error. - :paramtype details: list[~azure.mgmt.azurearcdata.models.ErrorResponseBody] - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - -class ExtendedLocation(_serialization.Model): - """The complex type of the extended location. - - :ivar name: The name of the extended location. - :vartype name: str - :ivar type: The type of the extended location. "CustomLocation" - :vartype type: str or ~azure.mgmt.azurearcdata.models.ExtendedLocationTypes - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the extended location. - :paramtype name: str - :keyword type: The type of the extended location. "CustomLocation" - :paramtype type: str or ~azure.mgmt.azurearcdata.models.ExtendedLocationTypes - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class K8SResourceRequirements(_serialization.Model): - """The kubernetes resource limits and requests used to restrict or reserve resource usage. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' - request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default - 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and - maximum 'memory' is '128Gi'. - :vartype requests: dict[str, str] - :ivar limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request - must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' - is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum - 'memory' is '128Gi'. - :vartype limits: dict[str, str] - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "requests": {"key": "requests", "type": "{str}"}, - "limits": {"key": "limits", "type": "{str}"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - requests: Optional[dict[str, str]] = None, - limits: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' - request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default - 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and - maximum 'memory' is '128Gi'. - :paramtype requests: dict[str, str] - :keyword limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request - must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' - is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum - 'memory' is '128Gi'. - :paramtype limits: dict[str, str] - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.requests = requests - self.limits = limits - - -class K8SScheduling(_serialization.Model): - """The kubernetes scheduling information. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar default: The kubernetes scheduling options. It describes restrictions used to help - Kubernetes select appropriate nodes to host the database service. - :vartype default: ~azure.mgmt.azurearcdata.models.K8SSchedulingOptions - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "default": {"key": "default", "type": "K8SSchedulingOptions"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - default: Optional["_models.K8SSchedulingOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword default: The kubernetes scheduling options. It describes restrictions used to help - Kubernetes select appropriate nodes to host the database service. - :paramtype default: ~azure.mgmt.azurearcdata.models.K8SSchedulingOptions - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.default = default - - -class K8SSchedulingOptions(_serialization.Model): - """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select - appropriate nodes to host the database service. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar resources: The kubernetes resource limits and requests used to restrict or reserve - resource usage. - :vartype resources: ~azure.mgmt.azurearcdata.models.K8SResourceRequirements - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "resources": {"key": "resources", "type": "K8SResourceRequirements"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - resources: Optional["_models.K8SResourceRequirements"] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword resources: The kubernetes resource limits and requests used to restrict or reserve - resource usage. - :paramtype resources: ~azure.mgmt.azurearcdata.models.K8SResourceRequirements - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.resources = resources - - -class KeytabInformation(_serialization.Model): - """Keytab used for authenticate with Active Directory. - - :ivar keytab: A base64-encoded keytab. - :vartype keytab: str - """ - - _attribute_map = { - "keytab": {"key": "keytab", "type": "str"}, - } - - def __init__(self, *, keytab: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword keytab: A base64-encoded keytab. - :paramtype keytab: str - """ - super().__init__(**kwargs) - self.keytab = keytab - - -class LogAnalyticsWorkspaceConfig(_serialization.Model): - """Log analytics workspace id and primary key. - - :ivar workspace_id: Azure Log Analytics workspace ID. - :vartype workspace_id: str - :ivar primary_key: Primary key of the workspace. - :vartype primary_key: str - """ - - _attribute_map = { - "workspace_id": {"key": "workspaceId", "type": "str"}, - "primary_key": {"key": "primaryKey", "type": "str"}, - } - - def __init__(self, *, workspace_id: Optional[str] = None, primary_key: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword workspace_id: Azure Log Analytics workspace ID. - :paramtype workspace_id: str - :keyword primary_key: Primary key of the workspace. - :paramtype primary_key: str - """ - super().__init__(**kwargs) - self.workspace_id = workspace_id - self.primary_key = primary_key - - -class OnPremiseProperty(_serialization.Model): - """Properties from the Kubernetes data controller. - - All required parameters must be populated in order to send to server. - - :ivar id: A globally unique ID identifying the associated Kubernetes cluster. Required. - :vartype id: str - :ivar public_signing_key: Certificate that contains the Kubernetes cluster public key used to - verify signing. Required. - :vartype public_signing_key: str - :ivar signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the - certificate being uploaded. - :vartype signing_certificate_thumbprint: str - """ - - _validation = { - "id": {"required": True}, - "public_signing_key": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "public_signing_key": {"key": "publicSigningKey", "type": "str"}, - "signing_certificate_thumbprint": {"key": "signingCertificateThumbprint", "type": "str"}, - } - - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - public_signing_key: str, - signing_certificate_thumbprint: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: A globally unique ID identifying the associated Kubernetes cluster. Required. - :paramtype id: str - :keyword public_signing_key: Certificate that contains the Kubernetes cluster public key used - to verify signing. Required. - :paramtype public_signing_key: str - :keyword signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the - certificate being uploaded. - :paramtype signing_certificate_thumbprint: str - """ - super().__init__(**kwargs) - self.id = id - self.public_signing_key = public_signing_key - self.signing_certificate_thumbprint = signing_certificate_thumbprint - - -class Operation(_serialization.Model): - """Azure Data Services on Azure Arc operation definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the operation being performed on this particular object. Required. - :vartype name: str - :ivar display: The localized display information for this particular operation / action. - Required. - :vartype display: ~azure.mgmt.azurearcdata.models.OperationDisplay - :ivar origin: The intended executor of the operation. Known values are: "user" and "system". - :vartype origin: str or ~azure.mgmt.azurearcdata.models.OperationOrigin - :ivar is_data_action: Indicates whether the operation is a data action. Required. - :vartype is_data_action: bool - :ivar properties: Additional descriptions for the operation. - :vartype properties: dict[str, any] - """ - - _validation = { - "name": {"required": True}, - "display": {"required": True}, - "origin": {"readonly": True}, - "is_data_action": {"required": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "properties": {"key": "properties", "type": "{object}"}, - } - - def __init__(self, *, name: str, display: "_models.OperationDisplay", is_data_action: bool, **kwargs: Any) -> None: - """ - :keyword name: The name of the operation being performed on this particular object. Required. - :paramtype name: str - :keyword display: The localized display information for this particular operation / action. - Required. - :paramtype display: ~azure.mgmt.azurearcdata.models.OperationDisplay - :keyword is_data_action: Indicates whether the operation is a data action. Required. - :paramtype is_data_action: bool - """ - super().__init__(**kwargs) - self.name = name - self.display = display - self.origin: Optional[Union[str, "_models.OperationOrigin"]] = None - self.is_data_action = is_data_action - self.properties: Optional[dict[str, Any]] = None - - -class OperationDisplay(_serialization.Model): - """Display metadata associated with the operation. - - All required parameters must be populated in order to send to server. - - :ivar provider: The localized friendly form of the resource provider name. Required. - :vartype provider: str - :ivar resource: The localized friendly form of the resource type related to this - action/operation. Required. - :vartype resource: str - :ivar operation: The localized friendly name for the operation. Required. - :vartype operation: str - :ivar description: The localized friendly description for the operation. Required. - :vartype description: str - """ - - _validation = { - "provider": {"required": True}, - "resource": {"required": True}, - "operation": {"required": True}, - "description": {"required": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, *, provider: str, resource: str, operation: str, description: str, **kwargs: Any) -> None: - """ - :keyword provider: The localized friendly form of the resource provider name. Required. - :paramtype provider: str - :keyword resource: The localized friendly form of the resource type related to this - action/operation. Required. - :paramtype resource: str - :keyword operation: The localized friendly name for the operation. Required. - :paramtype operation: str - :keyword description: The localized friendly description for the operation. Required. - :paramtype description: str - """ - super().__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationListResult(_serialization.Model): - """Result of the request to list Azure Data Services on Azure Arc operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.Operation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Operation"]] = None - self.next_link: Optional[str] = None - - -class PageOfDataControllerResource(_serialization.Model): - """A list of data controllers. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.DataControllerResource] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[DataControllerResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[list["_models.DataControllerResource"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: Array of results. - :paramtype value: list[~azure.mgmt.azurearcdata.models.DataControllerResource] - :keyword next_link: Link to retrieve next page of results. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PostgresInstance(TrackedResource): - """A Postgres Instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar extended_location: The extendedLocation of the resource. - :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :ivar properties: null. Required. - :vartype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties - :ivar sku: Resource sku. - :vartype sku: ~azure.mgmt.azurearcdata.models.PostgresInstanceSku - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "properties": {"key": "properties", "type": "PostgresInstanceProperties"}, - "sku": {"key": "sku", "type": "PostgresInstanceSku"}, - } - - def __init__( - self, - *, - location: str, - properties: "_models.PostgresInstanceProperties", - tags: Optional[dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - sku: Optional["_models.PostgresInstanceSku"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword extended_location: The extendedLocation of the resource. - :paramtype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :keyword properties: null. Required. - :paramtype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties - :keyword sku: Resource sku. - :paramtype sku: ~azure.mgmt.azurearcdata.models.PostgresInstanceSku - """ - super().__init__(tags=tags, location=location, **kwargs) - self.extended_location = extended_location - self.properties = properties - self.sku = sku - - -class PostgresInstanceListResult(_serialization.Model): - """A list of PostgresInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.PostgresInstance] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[PostgresInstance]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.PostgresInstance"]] = None - self.next_link: Optional[str] = None - - -class PostgresInstanceProperties(_serialization.Model): - """Postgres Instance properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar data_controller_id: The data controller id. - :vartype data_controller_id: str - :ivar admin: The instance admin. - :vartype admin: str - :ivar basic_login_information: Username and password for basic authentication. - :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar k8_s_raw: The raw kubernetes information. - :vartype k8_s_raw: JSON - :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date - time. - :vartype last_uploaded_date: ~datetime.datetime - :ivar provisioning_state: The provisioning state of the Azure Arc-enabled PostgreSQL instance. - :vartype provisioning_state: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "data_controller_id": {"key": "dataControllerId", "type": "str"}, - "admin": {"key": "admin", "type": "str"}, - "basic_login_information": {"key": "basicLoginInformation", "type": "BasicLoginInformation"}, - "k8_s_raw": {"key": "k8sRaw", "type": "object"}, - "last_uploaded_date": {"key": "lastUploadedDate", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - data_controller_id: Optional[str] = None, - admin: Optional[str] = None, - basic_login_information: Optional["_models.BasicLoginInformation"] = None, - k8_s_raw: Optional[JSON] = None, - last_uploaded_date: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_controller_id: The data controller id. - :paramtype data_controller_id: str - :keyword admin: The instance admin. - :paramtype admin: str - :keyword basic_login_information: Username and password for basic authentication. - :paramtype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword k8_s_raw: The raw kubernetes information. - :paramtype k8_s_raw: JSON - :keyword last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current - date time. - :paramtype last_uploaded_date: ~datetime.datetime - """ - super().__init__(**kwargs) - self.data_controller_id = data_controller_id - self.admin = admin - self.basic_login_information = basic_login_information - self.k8_s_raw = k8_s_raw - self.last_uploaded_date = last_uploaded_date - self.provisioning_state: Optional[str] = None - - -class PostgresInstanceSku(CommonSku): - """The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the SKU. It is typically a letter+number code. Required. - :vartype name: str - :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used - for dev/test purpose. - :vartype dev: bool - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. - If scale out/in is not possible for the resource this may be omitted. - :vartype capacity: int - :ivar tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier. Default value is "Hyperscale". - :vartype tier: str - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "dev": {"key": "dev", "type": "bool"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__( - self, - *, - name: str, - dev: bool = True, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - tier: Literal["Hyperscale"] = "Hyperscale", - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the SKU. It is typically a letter+number code. Required. - :paramtype name: str - :keyword dev: Whether dev/test is enabled. When the dev field is set to true, the resource is - used for dev/test purpose. - :paramtype dev: bool - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: If the SKU supports scale out/in then the capacity integer should be - included. If scale out/in is not possible for the resource this may be omitted. - :paramtype capacity: int - :keyword tier: This field is required to be implemented by the Resource Provider if the service - has more than one tier. Default value is "Hyperscale". - :paramtype tier: str - """ - super().__init__(name=name, dev=dev, size=size, family=family, capacity=capacity, **kwargs) - self.tier = tier - - -class PostgresInstanceUpdate(_serialization.Model): - """An update to a Postgres Instance. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: Postgres Instance properties. - :vartype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "PostgresInstanceProperties"}, - } - - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.PostgresInstanceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: Postgres Instance properties. - :paramtype properties: ~azure.mgmt.azurearcdata.models.PostgresInstanceProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class SqlManagedInstance(TrackedResource): - """A SqlManagedInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.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: null. Required. - :vartype properties: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties - :ivar extended_location: The extendedLocation of the resource. - :vartype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :ivar sku: Resource sku. - :vartype sku: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSku - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "SqlManagedInstanceProperties"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "sku": {"key": "sku", "type": "SqlManagedInstanceSku"}, - } - - def __init__( - self, - *, - location: str, - properties: "_models.SqlManagedInstanceProperties", - tags: Optional[dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - sku: Optional["_models.SqlManagedInstanceSku"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: null. Required. - :paramtype properties: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceProperties - :keyword extended_location: The extendedLocation of the resource. - :paramtype extended_location: ~azure.mgmt.azurearcdata.models.ExtendedLocation - :keyword sku: Resource sku. - :paramtype sku: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSku - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.extended_location = extended_location - self.sku = sku - - -class SqlManagedInstanceK8SRaw(_serialization.Model): - """The raw kubernetes information. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar spec: The kubernetes spec information. - :vartype spec: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "spec": {"key": "spec", "type": "SqlManagedInstanceK8SSpec"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - spec: Optional["_models.SqlManagedInstanceK8SSpec"] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword spec: The kubernetes spec information. - :paramtype spec: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SSpec - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.spec = spec - - -class SqlManagedInstanceK8SSpec(_serialization.Model): - """The kubernetes spec information. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar scheduling: The kubernetes scheduling information. - :vartype scheduling: ~azure.mgmt.azurearcdata.models.K8SScheduling - :ivar replicas: This option specifies the number of SQL Managed Instance replicas that will be - deployed in your Kubernetes cluster for high availability purposes. If sku.tier is - BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is - GeneralPurpose, replicas must be '1'. - :vartype replicas: int - """ - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "scheduling": {"key": "scheduling", "type": "K8SScheduling"}, - "replicas": {"key": "replicas", "type": "int"}, - } - - def __init__( - self, - *, - additional_properties: Optional[dict[str, Any]] = None, - scheduling: Optional["_models.K8SScheduling"] = None, - replicas: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword scheduling: The kubernetes scheduling information. - :paramtype scheduling: ~azure.mgmt.azurearcdata.models.K8SScheduling - :keyword replicas: This option specifies the number of SQL Managed Instance replicas that will - be deployed in your Kubernetes cluster for high availability purposes. If sku.tier is - BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is - GeneralPurpose, replicas must be '1'. - :paramtype replicas: int - """ - super().__init__(**kwargs) - self.additional_properties = additional_properties - self.scheduling = scheduling - self.replicas = replicas - - -class SqlManagedInstanceListResult(_serialization.Model): - """A list of SqlManagedInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SqlManagedInstance]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SqlManagedInstance"]] = None - self.next_link: Optional[str] = None - - -class SqlManagedInstanceProperties(_serialization.Model): - """Properties of sqlManagedInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar data_controller_id: null. - :vartype data_controller_id: str - :ivar admin: The instance admin user. - :vartype admin: str - :ivar start_time: The instance start time. - :vartype start_time: str - :ivar end_time: The instance end time. - :vartype end_time: str - :ivar k8_s_raw: The raw kubernetes information. - :vartype k8_s_raw: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw - :ivar basic_login_information: Username and password for basic authentication. - :vartype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date - time. - :vartype last_uploaded_date: ~datetime.datetime - :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Managed Instance - resource. - :vartype provisioning_state: str - :ivar active_directory_information: Active Directory information related to this SQL Managed - Instance. - :vartype active_directory_information: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryInformation - :ivar license_type: The license type to apply for this managed instance. Known values are: - "BasePrice", "LicenseIncluded", and "DisasterRecovery". - :vartype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType - :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected - cluster the custom location belongs to. - :vartype cluster_id: str - :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension - the custom location belongs to. - :vartype extension_id: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "data_controller_id": {"key": "dataControllerId", "type": "str"}, - "admin": {"key": "admin", "type": "str"}, - "start_time": {"key": "startTime", "type": "str"}, - "end_time": {"key": "endTime", "type": "str"}, - "k8_s_raw": {"key": "k8sRaw", "type": "SqlManagedInstanceK8SRaw"}, - "basic_login_information": {"key": "basicLoginInformation", "type": "BasicLoginInformation"}, - "last_uploaded_date": {"key": "lastUploadedDate", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "active_directory_information": {"key": "activeDirectoryInformation", "type": "ActiveDirectoryInformation"}, - "license_type": {"key": "licenseType", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "str"}, - "extension_id": {"key": "extensionId", "type": "str"}, - } - - def __init__( - self, - *, - data_controller_id: Optional[str] = None, - admin: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - k8_s_raw: Optional["_models.SqlManagedInstanceK8SRaw"] = None, - basic_login_information: Optional["_models.BasicLoginInformation"] = None, - last_uploaded_date: Optional[datetime.datetime] = None, - active_directory_information: Optional["_models.ActiveDirectoryInformation"] = None, - license_type: Union[str, "_models.ArcSqlManagedInstanceLicenseType"] = "BasePrice", - cluster_id: Optional[str] = None, - extension_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_controller_id: null. - :paramtype data_controller_id: str - :keyword admin: The instance admin user. - :paramtype admin: str - :keyword start_time: The instance start time. - :paramtype start_time: str - :keyword end_time: The instance end time. - :paramtype end_time: str - :keyword k8_s_raw: The raw kubernetes information. - :paramtype k8_s_raw: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceK8SRaw - :keyword basic_login_information: Username and password for basic authentication. - :paramtype basic_login_information: ~azure.mgmt.azurearcdata.models.BasicLoginInformation - :keyword last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current - date time. - :paramtype last_uploaded_date: ~datetime.datetime - :keyword active_directory_information: Active Directory information related to this SQL Managed - Instance. - :paramtype active_directory_information: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryInformation - :keyword license_type: The license type to apply for this managed instance. Known values are: - "BasePrice", "LicenseIncluded", and "DisasterRecovery". - :paramtype license_type: str or - ~azure.mgmt.azurearcdata.models.ArcSqlManagedInstanceLicenseType - :keyword cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected - cluster the custom location belongs to. - :paramtype cluster_id: str - :keyword extension_id: If a CustomLocation is provided, this contains the ARM id of the - extension the custom location belongs to. - :paramtype extension_id: str - """ - super().__init__(**kwargs) - self.data_controller_id = data_controller_id - self.admin = admin - self.start_time = start_time - self.end_time = end_time - self.k8_s_raw = k8_s_raw - self.basic_login_information = basic_login_information - self.last_uploaded_date = last_uploaded_date - self.provisioning_state: Optional[str] = None - self.active_directory_information = active_directory_information - self.license_type = license_type - self.cluster_id = cluster_id - self.extension_id = extension_id - - -class SqlManagedInstanceSku(_serialization.Model): - """The resource model definition representing SKU for Azure Managed Instance - Azure Arc. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the SKU. Required. Default value is "vCore". - :vartype name: str - :ivar tier: The pricing tier for the instance. Known values are: "GeneralPurpose" and - "BusinessCritical". - :vartype tier: str or ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier - :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used - for dev/test purpose. - :vartype dev: bool - :ivar size: The SKU size. When the name field is the combination of tier and some other value, - this would be the standalone code. - :vartype size: str - :ivar family: The SKU family. - :vartype family: str - :ivar capacity: The SKU capacity. - :vartype capacity: int - """ - - _validation = { - "name": {"required": True, "constant": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "dev": {"key": "dev", "type": "bool"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - } - - name = "vCore" - - def __init__( - self, - *, - tier: Union[str, "_models.SqlManagedInstanceSkuTier"] = "GeneralPurpose", - dev: bool = True, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword tier: The pricing tier for the instance. Known values are: "GeneralPurpose" and - "BusinessCritical". - :paramtype tier: str or ~azure.mgmt.azurearcdata.models.SqlManagedInstanceSkuTier - :keyword dev: Whether dev/test is enabled. When the dev field is set to true, the resource is - used for dev/test purpose. - :paramtype dev: bool - :keyword size: The SKU size. When the name field is the combination of tier and some other - value, this would be the standalone code. - :paramtype size: str - :keyword family: The SKU family. - :paramtype family: str - :keyword capacity: The SKU capacity. - :paramtype capacity: int - """ - super().__init__(**kwargs) - self.tier = tier - self.dev = dev - self.size = size - self.family = family - self.capacity = capacity - - -class SqlManagedInstanceUpdate(_serialization.Model): - """An update to a SQL Managed Instance. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class SqlServerInstance(TrackedResource): - """A SqlServerInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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.azurearcdata.models.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: null. - :vartype properties: ~azure.mgmt.azurearcdata.models.SqlServerInstanceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "SqlServerInstanceProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - properties: Optional["_models.SqlServerInstanceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: null. - :paramtype properties: ~azure.mgmt.azurearcdata.models.SqlServerInstanceProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class SqlServerInstanceListResult(_serialization.Model): - """A list of SqlServerInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SqlServerInstance]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SqlServerInstance"]] = None - self.next_link: Optional[str] = None - - -class SqlServerInstanceProperties(_serialization.Model): - """Properties of SqlServerInstance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar version: SQL Server version. Known values are: "SQL Server 2012", "SQL Server 2014", "SQL - Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "Unknown". - :vartype version: str or ~azure.mgmt.azurearcdata.models.SqlVersion - :ivar edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", - "Web", "Developer", and "Express". - :vartype edition: str or ~azure.mgmt.azurearcdata.models.EditionType - :ivar container_resource_id: ARM Resource id of the container resource (Azure Arc for Servers). - Required. - :vartype container_resource_id: str - :ivar create_time: The time when the resource was created. - :vartype create_time: str - :ivar v_core: The number of logical processors used by the SQL Server instance. - :vartype v_core: str - :ivar status: The cloud connectivity status. Required. Known values are: "Connected", - "Disconnected", "Registered", and "Unknown". - :vartype status: str or ~azure.mgmt.azurearcdata.models.ConnectionStatus - :ivar patch_level: SQL Server update level. - :vartype patch_level: str - :ivar collation: SQL Server collation. - :vartype collation: str - :ivar current_version: SQL Server current version. - :vartype current_version: str - :ivar instance_name: SQL Server instance name. - :vartype instance_name: str - :ivar tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. - :vartype tcp_dynamic_ports: str - :ivar tcp_static_ports: Static TCP ports used by SQL Server. - :vartype tcp_static_ports: str - :ivar product_id: SQL Server product ID. - :vartype product_id: str - :ivar license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", - "ServerCAL", "LicenseOnly", "PAYG", and "Paid". - :vartype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType - :ivar azure_defender_status_last_updated: Timestamp of last Azure Defender status update. - :vartype azure_defender_status_last_updated: ~datetime.datetime - :ivar azure_defender_status: Status of Azure Defender. Known values are: "Protected", - "Unprotected", and "Unknown". - :vartype azure_defender_status: str or ~azure.mgmt.azurearcdata.models.DefenderStatus - :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server resource. - :vartype provisioning_state: str - :ivar host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual - Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual - Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", - "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual - Machine", and "Other". - :vartype host_type: str or ~azure.mgmt.azurearcdata.models.HostType - """ - - _validation = { - "container_resource_id": {"required": True}, - "create_time": {"readonly": True}, - "status": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "edition": {"key": "edition", "type": "str"}, - "container_resource_id": {"key": "containerResourceId", "type": "str"}, - "create_time": {"key": "createTime", "type": "str"}, - "v_core": {"key": "vCore", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "patch_level": {"key": "patchLevel", "type": "str"}, - "collation": {"key": "collation", "type": "str"}, - "current_version": {"key": "currentVersion", "type": "str"}, - "instance_name": {"key": "instanceName", "type": "str"}, - "tcp_dynamic_ports": {"key": "tcpDynamicPorts", "type": "str"}, - "tcp_static_ports": {"key": "tcpStaticPorts", "type": "str"}, - "product_id": {"key": "productId", "type": "str"}, - "license_type": {"key": "licenseType", "type": "str"}, - "azure_defender_status_last_updated": {"key": "azureDefenderStatusLastUpdated", "type": "iso-8601"}, - "azure_defender_status": {"key": "azureDefenderStatus", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "host_type": {"key": "hostType", "type": "str"}, - } - - def __init__( - self, - *, - container_resource_id: str, - status: Union[str, "_models.ConnectionStatus"], - version: Optional[Union[str, "_models.SqlVersion"]] = None, - edition: Optional[Union[str, "_models.EditionType"]] = None, - v_core: Optional[str] = None, - patch_level: Optional[str] = None, - collation: Optional[str] = None, - current_version: Optional[str] = None, - instance_name: Optional[str] = None, - tcp_dynamic_ports: Optional[str] = None, - tcp_static_ports: Optional[str] = None, - product_id: Optional[str] = None, - license_type: Optional[Union[str, "_models.ArcSqlServerLicenseType"]] = None, - azure_defender_status_last_updated: Optional[datetime.datetime] = None, - azure_defender_status: Optional[Union[str, "_models.DefenderStatus"]] = None, - host_type: Optional[Union[str, "_models.HostType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword version: SQL Server version. Known values are: "SQL Server 2012", "SQL Server 2014", - "SQL Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "Unknown". - :paramtype version: str or ~azure.mgmt.azurearcdata.models.SqlVersion - :keyword edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", - "Web", "Developer", and "Express". - :paramtype edition: str or ~azure.mgmt.azurearcdata.models.EditionType - :keyword container_resource_id: ARM Resource id of the container resource (Azure Arc for - Servers). Required. - :paramtype container_resource_id: str - :keyword v_core: The number of logical processors used by the SQL Server instance. - :paramtype v_core: str - :keyword status: The cloud connectivity status. Required. Known values are: "Connected", - "Disconnected", "Registered", and "Unknown". - :paramtype status: str or ~azure.mgmt.azurearcdata.models.ConnectionStatus - :keyword patch_level: SQL Server update level. - :paramtype patch_level: str - :keyword collation: SQL Server collation. - :paramtype collation: str - :keyword current_version: SQL Server current version. - :paramtype current_version: str - :keyword instance_name: SQL Server instance name. - :paramtype instance_name: str - :keyword tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. - :paramtype tcp_dynamic_ports: str - :keyword tcp_static_ports: Static TCP ports used by SQL Server. - :paramtype tcp_static_ports: str - :keyword product_id: SQL Server product ID. - :paramtype product_id: str - :keyword license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", - "ServerCAL", "LicenseOnly", "PAYG", and "Paid". - :paramtype license_type: str or ~azure.mgmt.azurearcdata.models.ArcSqlServerLicenseType - :keyword azure_defender_status_last_updated: Timestamp of last Azure Defender status update. - :paramtype azure_defender_status_last_updated: ~datetime.datetime - :keyword azure_defender_status: Status of Azure Defender. Known values are: "Protected", - "Unprotected", and "Unknown". - :paramtype azure_defender_status: str or ~azure.mgmt.azurearcdata.models.DefenderStatus - :keyword host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual - Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual - Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", - "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual - Machine", and "Other". - :paramtype host_type: str or ~azure.mgmt.azurearcdata.models.HostType - """ - super().__init__(**kwargs) - self.version = version - self.edition = edition - self.container_resource_id = container_resource_id - self.create_time: Optional[str] = None - self.v_core = v_core - self.status = status - self.patch_level = patch_level - self.collation = collation - self.current_version = current_version - self.instance_name = instance_name - self.tcp_dynamic_ports = tcp_dynamic_ports - self.tcp_static_ports = tcp_static_ports - self.product_id = product_id - self.license_type = license_type - self.azure_defender_status_last_updated = azure_defender_status_last_updated - self.azure_defender_status = azure_defender_status - self.provisioning_state: Optional[str] = None - self.host_type = host_type - - -class SqlServerInstanceUpdate(_serialization.Model): - """An update to a SQL Server Instance. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.azurearcdata.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class UploadServicePrincipal(_serialization.Model): - """Service principal for uploading billing, metrics and logs. - - :ivar client_id: Client ID of the service principal for uploading data. - :vartype client_id: str - :ivar tenant_id: Tenant ID of the service principal. - :vartype tenant_id: str - :ivar authority: Authority for the service principal. Example: - https://login.microsoftonline.com/. - :vartype authority: str - :ivar client_secret: Secret of the service principal. - :vartype client_secret: str - """ - - _attribute_map = { - "client_id": {"key": "clientId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "authority": {"key": "authority", "type": "str"}, - "client_secret": {"key": "clientSecret", "type": "str"}, - } - - def __init__( - self, - *, - client_id: Optional[str] = None, - tenant_id: Optional[str] = None, - authority: Optional[str] = None, - client_secret: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword client_id: Client ID of the service principal for uploading data. - :paramtype client_id: str - :keyword tenant_id: Tenant ID of the service principal. - :paramtype tenant_id: str - :keyword authority: Authority for the service principal. Example: - https://login.microsoftonline.com/. - :paramtype authority: str - :keyword client_secret: Secret of the service principal. - :paramtype client_secret: str - """ - super().__init__(**kwargs) - self.client_id = client_id - self.tenant_id = tenant_id - self.authority = authority - self.client_secret = client_secret - - -class UploadWatermark(_serialization.Model): - """Properties on upload watermark. Mostly timestamp for each upload data type. - - :ivar metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current date - time. - :vartype metrics: ~datetime.datetime - :ivar logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date time. - :vartype logs: ~datetime.datetime - :ivar usages: Last uploaded date for usages from kubernetes cluster. Defaults to current date - time. - :vartype usages: ~datetime.datetime - """ - - _attribute_map = { - "metrics": {"key": "metrics", "type": "iso-8601"}, - "logs": {"key": "logs", "type": "iso-8601"}, - "usages": {"key": "usages", "type": "iso-8601"}, - } - - def __init__( - self, - *, - metrics: Optional[datetime.datetime] = None, - logs: Optional[datetime.datetime] = None, - usages: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current - date time. - :paramtype metrics: ~datetime.datetime - :keyword logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date - time. - :paramtype logs: ~datetime.datetime - :keyword usages: Last uploaded date for usages from kubernetes cluster. Defaults to current - date time. - :paramtype usages: ~datetime.datetime - """ - super().__init__(**kwargs) - self.metrics = metrics - self.logs = logs - self.usages = usages diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_patch.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_patch.py index 5755fd181b3f..87676c65a8f0 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_patch.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/models/_patch.py @@ -1,16 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - - +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py index 237cd4378c1f..7a8d371b1591 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,11 +13,16 @@ from ._patch import * # pylint: disable=unused-wildcard-import from ._operations import Operations # type: ignore -from ._sql_managed_instances_operations import SqlManagedInstancesOperations # type: ignore -from ._sql_server_instances_operations import SqlServerInstancesOperations # type: ignore -from ._data_controllers_operations import DataControllersOperations # type: ignore -from ._active_directory_connectors_operations import ActiveDirectoryConnectorsOperations # type: ignore -from ._postgres_instances_operations import PostgresInstancesOperations # type: ignore +from ._operations import SqlManagedInstancesOperations # type: ignore +from ._operations import SqlServerInstancesOperations # type: ignore +from ._operations import SqlServerLicensesOperations # type: ignore +from ._operations import PostgresInstancesOperations # type: ignore +from ._operations import SqlServerEsuLicensesOperations # type: ignore +from ._operations import FailoverGroupsOperations # type: ignore +from ._operations import SqlServerAvailabilityGroupsOperations # type: ignore +from ._operations import DataControllersOperations # type: ignore +from ._operations import ActiveDirectoryConnectorsOperations # type: ignore +from ._operations import SqlServerDatabasesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -27,9 +32,14 @@ "Operations", "SqlManagedInstancesOperations", "SqlServerInstancesOperations", + "SqlServerLicensesOperations", + "PostgresInstancesOperations", + "SqlServerEsuLicensesOperations", + "FailoverGroupsOperations", + "SqlServerAvailabilityGroupsOperations", "DataControllersOperations", "ActiveDirectoryConnectorsOperations", - "PostgresInstancesOperations", + "SqlServerDatabasesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_active_directory_connectors_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_active_directory_connectors_operations.py deleted file mode 100644 index 5559df9a2b31..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_active_directory_connectors_operations.py +++ /dev/null @@ -1,695 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import AzureArcDataManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, data_controller_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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) - - -def build_create_request( - resource_group_name: str, - data_controller_name: str, - active_directory_connector_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), - "activeDirectoryConnectorName": _SERIALIZER.url( - "active_directory_connector_name", active_directory_connector_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 - 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_delete_request( - resource_group_name: str, - data_controller_name: str, - active_directory_connector_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), - "activeDirectoryConnectorName": _SERIALIZER.url( - "active_directory_connector_name", active_directory_connector_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - data_controller_name: str, - active_directory_connector_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), - "activeDirectoryConnectorName": _SERIALIZER.url( - "active_directory_connector_name", active_directory_connector_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 ActiveDirectoryConnectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`active_directory_connectors` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> ItemPaged["_models.ActiveDirectoryConnectorResource"]: - """List the active directory connectors associated with the given data controller. - - List the active directory connectors associated with the given data controller. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: An iterator like instance of either ActiveDirectoryConnectorResource or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActiveDirectoryConnectorListResult] = 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_list_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ActiveDirectoryConnectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_initial( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: Union[_models.ActiveDirectoryConnectorResource, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(active_directory_connector_resource, (IOBase, bytes)): - _content = active_directory_connector_resource - else: - _json = self._serialize.body(active_directory_connector_resource, "ActiveDirectoryConnectorResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: _models.ActiveDirectoryConnectorResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Required. - :type active_directory_connector_resource: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource - :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 either ActiveDirectoryConnectorResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Required. - :type active_directory_connector_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 either ActiveDirectoryConnectorResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - data_controller_name: str, - active_directory_connector_name: str, - active_directory_connector_resource: Union[_models.ActiveDirectoryConnectorResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: - """Creates or replaces an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :param active_directory_connector_resource: desc. Is either a ActiveDirectoryConnectorResource - type or a IO[bytes] type. Required. - :type active_directory_connector_resource: - ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource or IO[bytes] - :return: An instance of LROPoller that returns either ActiveDirectoryConnectorResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ActiveDirectoryConnectorResource] = 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._create_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - active_directory_connector_resource=active_directory_connector_resource, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ActiveDirectoryConnectorResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ActiveDirectoryConnectorResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ActiveDirectoryConnectorResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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 get( - self, resource_group_name: str, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any - ) -> _models.ActiveDirectoryConnectorResource: - """Retrieves an Active Directory connector resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param active_directory_connector_name: The name of the Active Directory connector instance. - Required. - :type active_directory_connector_name: str - :return: ActiveDirectoryConnectorResource or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ActiveDirectoryConnectorResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - active_directory_connector_name=active_directory_connector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ActiveDirectoryConnectorResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py deleted file mode 100644 index 5953eb832572..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_data_controllers_operations.py +++ /dev/null @@ -1,974 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import AzureArcDataManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_in_subscription_request(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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_list_in_group_request(resource_group_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) - - -def build_put_data_controller_request( - resource_group_name: str, data_controller_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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 - 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_delete_data_controller_request( - resource_group_name: str, data_controller_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_data_controller_request( - resource_group_name: str, data_controller_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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) - - -def build_patch_data_controller_request( - resource_group_name: str, data_controller_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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 - 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataControllersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`data_controllers` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list_in_subscription(self, **kwargs: Any) -> ItemPaged["_models.DataControllerResource"]: - """List dataController resources in the subscription. - - List dataController resources in the subscription. - - :return: An iterator like instance of either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PageOfDataControllerResource] = 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_list_in_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PageOfDataControllerResource", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_in_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.DataControllerResource"]: - """List dataController resources in the resource group. - - List dataController resources in the resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PageOfDataControllerResource] = 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_list_in_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PageOfDataControllerResource", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _put_data_controller_initial( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerResource, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(data_controller_resource, (IOBase, bytes)): - _content = data_controller_resource - else: - _json = self._serialize.body(data_controller_resource, "DataControllerResource") - - _request = build_put_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: _models.DataControllerResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource - :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 either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Required. - :type data_controller_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 either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_put_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Creates or replaces a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: desc. Is either a DataControllerResource type or a IO[bytes] - type. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource or - IO[bytes] - :return: An instance of LROPoller that returns either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataControllerResource] = 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._put_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - data_controller_resource=data_controller_resource, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DataControllerResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DataControllerResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_data_controller_initial( - self, resource_group_name: str, data_controller_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_data_controller( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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 get_data_controller( - self, resource_group_name: str, data_controller_name: str, **kwargs: Any - ) -> _models.DataControllerResource: - """Retrieves a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :return: DataControllerResource or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.DataControllerResource - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataControllerResource] = kwargs.pop("cls", None) - - _request = build_get_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _patch_data_controller_initial( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerUpdate, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(data_controller_resource, (IOBase, bytes)): - _content = data_controller_resource - else: - _json = self._serialize.body(data_controller_resource, "DataControllerUpdate") - - _request = build_patch_data_controller_request( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: _models.DataControllerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate - :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 either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Required. - :type data_controller_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 either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_patch_data_controller( - self, - resource_group_name: str, - data_controller_name: str, - data_controller_resource: Union[_models.DataControllerUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DataControllerResource]: - """Updates a dataController resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param data_controller_name: The name of the data controller. Required. - :type data_controller_name: str - :param data_controller_resource: The update data controller resource. Is either a - DataControllerUpdate type or a IO[bytes] type. Required. - :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate or - IO[bytes] - :return: An instance of LROPoller that returns either DataControllerResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataControllerResource] = 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._patch_data_controller_initial( - resource_group_name=resource_group_name, - data_controller_name=data_controller_name, - data_controller_resource=data_controller_resource, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DataControllerResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DataControllerResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DataControllerResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py index cbcd8676a8cd..92e8437e33ba 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_operations.py @@ -1,12 +1,15 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -16,17 +19,22 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict 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 AzureArcDataManagementClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") @@ -37,15 +45,2326 @@ _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +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", "2022-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.AzureArcData/operations") + _url = "/providers/Microsoft.AzureArcData/operations" + + # 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_sql_managed_instances_get_request( + resource_group_name: str, sql_managed_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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) + + +def build_sql_managed_instances_create_request( # pylint: disable=name-too-long + resource_group_name: str, sql_managed_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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 + 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_sql_managed_instances_update_request( # pylint: disable=name-too-long + resource_group_name: str, sql_managed_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_managed_instances_delete_request( # pylint: disable=name-too-long + resource_group_name: str, sql_managed_instance_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_name, "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_sql_managed_instances_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_sql_managed_instances_list_request(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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_sql_server_instances_get_request( + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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) + + +def build_sql_server_instances_create_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + 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_sql_server_instances_update_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_delete_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "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_sql_server_instances_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_sql_server_instances_list_request(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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_sql_server_instances_get_telemetry_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getTelemetry" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_get_best_practices_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getBestPracticesAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_run_migration_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runMigrationAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_run_target_recommendation_job_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runTargetRecommendationJob" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_get_target_recommendation_reports_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getTargetRecommendationReports" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_get_migration_readiness_report_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getMigrationReadinessReport" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_run_best_practices_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runBestPracticesAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_run_best_practice_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runBestPracticeAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_run_migration_readiness_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runMigrationReadinessAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_get_jobs_status_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getJobsStatus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_get_jobs_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getJobs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_pre_upgrade_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/preUpgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_post_upgrade_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/postUpgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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_sql_server_instances_run_managed_instance_link_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/runManagedInstanceLinkAssessment" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_instances_get_all_availability_groups_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/getAllAvailabilityGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_licenses_get_request( + resource_group_name: str, sql_server_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerLicenses/{sqlServerLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerLicenseName": _SERIALIZER.url("sql_server_license_name", sql_server_license_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) + + +def build_sql_server_licenses_create_request( + resource_group_name: str, sql_server_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerLicenses/{sqlServerLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerLicenseName": _SERIALIZER.url("sql_server_license_name", sql_server_license_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 + 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_sql_server_licenses_update_request( + resource_group_name: str, sql_server_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerLicenses/{sqlServerLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerLicenseName": _SERIALIZER.url("sql_server_license_name", sql_server_license_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_licenses_delete_request( + resource_group_name: str, sql_server_license_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerLicenses/{sqlServerLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerLicenseName": _SERIALIZER.url("sql_server_license_name", sql_server_license_name, "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_sql_server_licenses_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerLicenses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_sql_server_licenses_list_request(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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerLicenses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_postgres_instances_get_request( + resource_group_name: str, postgres_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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) + + +def build_postgres_instances_create_request( + resource_group_name: str, postgres_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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 + 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_postgres_instances_update_request( + resource_group_name: str, postgres_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_postgres_instances_delete_request( + resource_group_name: str, postgres_instance_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_name, "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_postgres_instances_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_postgres_instances_list_request(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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/postgresInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_sql_server_esu_licenses_get_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_esu_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses/{sqlServerEsuLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerEsuLicenseName": _SERIALIZER.url("sql_server_esu_license_name", sql_server_esu_license_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) + + +def build_sql_server_esu_licenses_create_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_esu_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses/{sqlServerEsuLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerEsuLicenseName": _SERIALIZER.url("sql_server_esu_license_name", sql_server_esu_license_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 + 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_sql_server_esu_licenses_update_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_esu_license_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses/{sqlServerEsuLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerEsuLicenseName": _SERIALIZER.url("sql_server_esu_license_name", sql_server_esu_license_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_esu_licenses_delete_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_esu_license_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses/{sqlServerEsuLicenseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerEsuLicenseName": _SERIALIZER.url("sql_server_esu_license_name", sql_server_esu_license_name, "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_sql_server_esu_licenses_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_sql_server_esu_licenses_list_request( # pylint: disable=name-too-long + 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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerEsuLicenses" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_failover_groups_get_request( + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_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) + + +def build_failover_groups_create_request( + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_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 + 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_failover_groups_delete_request( + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "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_failover_groups_list_request( + resource_group_name: str, sql_managed_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}/failoverGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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) + + +def build_sql_server_availability_groups_create_availability_group_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/createAvailabilityGroup" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_create_distributed_availability_group_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/createDistributedAvailabilityGroup" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_create_managed_instance_link_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/createManagedInstanceLink" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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) + + +def build_sql_server_availability_groups_create_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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 + 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_sql_server_availability_groups_update_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_name, "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_sql_server_availability_groups_list_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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) + + +def build_sql_server_availability_groups_detail_view_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/getDetailView" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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_sql_server_availability_groups_failover_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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_sql_server_availability_groups_force_failover_allow_data_loss_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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_sql_server_availability_groups_add_databases_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/addDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_failover_mi_link_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/failoverMiLink" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_availability_groups_delete_mi_link_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/deleteMiLink" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_name, "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="POST", url=_url, params=_params, **kwargs) + + +def build_sql_server_availability_groups_remove_databases_request( # pylint: disable=name-too-long + resource_group_name: str, + sql_server_instance_name: str, + availability_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/availabilityGroups/{availabilityGroupName}/removeDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "availabilityGroupName": _SERIALIZER.url("availability_group_name", availability_group_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_controllers_get_data_controller_request( # pylint: disable=name-too-long + resource_group_name: str, data_controller_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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) + + +def build_data_controllers_put_data_controller_request( # pylint: disable=name-too-long + resource_group_name: str, data_controller_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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 + 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_data_controllers_patch_data_controller_request( # pylint: disable=name-too-long + resource_group_name: str, data_controller_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_controllers_delete_data_controller_request( # pylint: disable=name-too-long + resource_group_name: str, data_controller_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "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_data_controllers_list_in_group_request( # pylint: disable=name-too-long + resource_group_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) + + +def build_data_controllers_list_in_subscription_request( # pylint: disable=name-too-long + 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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/dataControllers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_active_directory_connectors_get_request( # pylint: disable=name-too-long + resource_group_name: str, + data_controller_name: str, + active_directory_connector_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), + "activeDirectoryConnectorName": _SERIALIZER.url( + "active_directory_connector_name", active_directory_connector_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) + + +def build_active_directory_connectors_create_request( # pylint: disable=name-too-long + resource_group_name: str, + data_controller_name: str, + active_directory_connector_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), + "activeDirectoryConnectorName": _SERIALIZER.url( + "active_directory_connector_name", active_directory_connector_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 + 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_active_directory_connectors_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + data_controller_name: str, + active_directory_connector_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors/{activeDirectoryConnectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_name, "str"), + "activeDirectoryConnectorName": _SERIALIZER.url( + "active_directory_connector_name", active_directory_connector_name, "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_active_directory_connectors_list_request( # pylint: disable=name-too-long + resource_group_name: str, data_controller_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/dataControllers/{dataControllerName}/activeDirectoryConnectors" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "dataControllerName": _SERIALIZER.url("data_controller_name", data_controller_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) + + +def build_sql_server_databases_get_request( + resource_group_name: str, sql_server_instance_name: str, database_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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) + + +def build_sql_server_databases_create_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_name: str, database_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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 + 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_sql_server_databases_update_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_name: str, database_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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 + 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_server_databases_delete_request( # pylint: disable=name-too-long + resource_group_name: str, sql_server_instance_name: str, database_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-03-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "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_sql_server_databases_list_request( + resource_group_name: str, sql_server_instance_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-03-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -63,11 +2382,11563 @@ class Operations: Instead, you should access the following operations through :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`operations` attribute. + :attr:`operations` 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: AzureArcDataManagementClientConfiguration = ( + 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 list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """Lists all of the available Azure Data Services on Azure Arc API operations. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = 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_operations_list_request( + 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.Operation], + 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 SqlManagedInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_managed_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_managed_instance_name: str, **kwargs: Any + ) -> _models.SqlManagedInstance: + """Retrieves a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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.SqlManagedInstance] = kwargs.pop("cls", None) + + _request = build_sql_managed_instances_get_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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.SqlManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: Union[_models.SqlManagedInstance, _types.SqlManagedInstance, 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(sql_managed_instance, (IOBase, bytes)): + _content = sql_managed_instance + else: + _content = json.dumps(sql_managed_instance, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_managed_instances_create_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: _models.SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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 SqlManagedInstance. The SqlManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: _types.SqlManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.types.SqlManagedInstance + :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 SqlManagedInstance. The SqlManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. + :type sql_managed_instance: 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 SqlManagedInstance. The SqlManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + sql_managed_instance: Union[_models.SqlManagedInstance, _types.SqlManagedInstance, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SqlManagedInstance]: + """Creates or replaces a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param sql_managed_instance: The SQL Managed Instance to be created or updated. Is either a + SqlManagedInstance type or a IO[bytes] type. Required. + :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance or + ~azure.mgmt.azurearcdata.types.SqlManagedInstance or IO[bytes] + :return: An instance of LROPoller that returns SqlManagedInstance. The SqlManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :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.SqlManagedInstance] = 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._create_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + sql_managed_instance=sql_managed_instance, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlManagedInstance, 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: 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.SqlManagedInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlManagedInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: _models.SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: _types.SqlManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlManagedInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Required. + :type parameters: 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: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + sql_managed_instance_name: str, + parameters: Union[_models.SqlManagedInstanceUpdate, _types.SqlManagedInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlManagedInstance: + """Updates a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param parameters: The SQL Managed Instance. Is either a SqlManagedInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate or + ~azure.mgmt.azurearcdata.types.SqlManagedInstanceUpdate or IO[bytes] + :return: SqlManagedInstance. The SqlManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance + :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.SqlManagedInstance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_managed_instances_update_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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 = 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.SqlManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, sql_managed_instance_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_sql_managed_instances_delete_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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 [200, 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["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, sql_managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a SQL Managed Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_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, + sql_managed_instance_name=sql_managed_instance_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.SqlManagedInstance"]: + """List sqlManagedInstance resources in the resource group. + + Gets all sqlManagedInstances 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 SqlManagedInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlManagedInstance]] = 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_sql_managed_instances_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.SqlManagedInstance], + 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(self, **kwargs: Any) -> ItemPaged["_models.SqlManagedInstance"]: + """List sqlManagedInstance resources in the subscription. + + List sqlManagedInstance resources in the subscription. + + :return: An iterator like instance of SqlManagedInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlManagedInstance]] = 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_sql_managed_instances_list_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.SqlManagedInstance], + 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 SqlServerInstancesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_server_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_instance_name: str, **kwargs: Any) -> _models.SqlServerInstance: + """Retrieves a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: Union[_models.SqlServerInstance, _types.SqlServerInstance, 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(sql_server_instance, (IOBase, bytes)): + _content = sql_server_instance + else: + _content = json.dumps(sql_server_instance, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: _models.SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: _types.SqlServerInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.types.SqlServerInstance + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Required. + :type sql_server_instance: 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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance: Union[_models.SqlServerInstance, _types.SqlServerInstance, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Creates or replaces a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance: The SQL Server Instance to be created or updated. Is either a + SqlServerInstance type or a IO[bytes] type. Required. + :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance or + ~azure.mgmt.azurearcdata.types.SqlServerInstance or IO[bytes] + :return: An instance of LROPoller that returns SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :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.SqlServerInstance] = 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._create_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance=sql_server_instance, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlServerInstance, 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: 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.SqlServerInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: Union[_models.SqlServerInstanceUpdate, _types.SqlServerInstanceUpdate, 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(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: _models.SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: _types.SqlServerInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerInstanceUpdate + :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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Required. + :type parameters: 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 SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + parameters: Union[_models.SqlServerInstanceUpdate, _types.SqlServerInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstance]: + """Updates a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param parameters: The SQL Server Instance. Is either a SqlServerInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceUpdate or IO[bytes] + :return: An instance of LROPoller that returns SqlServerInstance. The SqlServerInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :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.SqlServerInstance] = 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, + sql_server_instance_name=sql_server_instance_name, + parameters=parameters, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlServerInstance, 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: 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.SqlServerInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [200, 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["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, sql_server_instance_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a SQL Server Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_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, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance"]: + """List sqlServerInstance resources in the resource group. + + Gets all sqlServerInstances 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 SqlServerInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerInstance]] = 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_sql_server_instances_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.SqlServerInstance], + 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(self, **kwargs: Any) -> ItemPaged["_models.SqlServerInstance"]: + """List sqlServerInstance resources in the subscription. + + List sqlServerInstance resources in the subscription. + + :return: An iterator like instance of SqlServerInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerInstance]] = 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_sql_server_instances_list_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.SqlServerInstance], + 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 _get_telemetry_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: Union[ + _models.SqlServerInstanceTelemetryRequest, _types.SqlServerInstanceTelemetryRequest, 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(sql_server_instance_telemetry_request, (IOBase, bytes)): + _content = sql_server_instance_telemetry_request + else: + _content = json.dumps(sql_server_instance_telemetry_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_get_telemetry_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: _models.SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: _types.SqlServerInstanceTelemetryRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Required. + :type sql_server_instance_telemetry_request: 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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_telemetry( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_telemetry_request: Union[ + _models.SqlServerInstanceTelemetryRequest, _types.SqlServerInstanceTelemetryRequest, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL Server instance telemetry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_telemetry_request: Contains the parameters to get SQL Server + instance telemetry. Is either a SqlServerInstanceTelemetryRequest type or a IO[bytes] type. + Required. + :type sql_server_instance_telemetry_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTelemetryRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTelemetryRequest or IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :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[List[List[str]]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_instance_telemetry_request, (IOBase, bytes)): + _content = sql_server_instance_telemetry_request + else: + _content = json.dumps(sql_server_instance_telemetry_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_telemetry_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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[List[str]], + deserialized.get("rows", []), + ) + 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 + + 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._get_telemetry_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_telemetry_request=sql_server_instance_telemetry_request, + 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) + + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return get_next(next_link) + + return ItemPaged(internal_get_next, extract_data) + + 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[ItemPaged[List[str]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[ItemPaged[List[str]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_best_practices_assessment_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: Union[ + _models.SqlServerInstanceBpaRequest, _types.SqlServerInstanceBpaRequest, 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(sql_server_instance_bpa_request, (IOBase, bytes)): + _content = sql_server_instance_bpa_request + else: + _content = json.dumps(sql_server_instance_bpa_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_get_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: _models.SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: _types.SqlServerInstanceBpaRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceBpaRequest + :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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Required. + :type sql_server_instance_bpa_request: 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 an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_best_practices_assessment( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_bpa_request: Union[ + _models.SqlServerInstanceBpaRequest, _types.SqlServerInstanceBpaRequest, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[ItemPaged[List[str]]]: + """Retrieves SQL best practices assessment results for the SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_bpa_request: The request to fetch the SQL best practices assessment + results. Is either a SqlServerInstanceBpaRequest type or a IO[bytes] type. Required. + :type sql_server_instance_bpa_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceBpaRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceBpaRequest or IO[bytes] + :return: An instance of LROPoller that returns an iterator like instance of list of list of str + :rtype: ~azure.core.polling.LROPoller[~azure.core.paging.ItemPaged[list[str]]] + :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[List[List[str]]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_instance_bpa_request, (IOBase, bytes)): + _content = sql_server_instance_bpa_request + else: + _content = json.dumps(sql_server_instance_bpa_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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[List[str]], + deserialized.get("rows", []), + ) + 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 + + 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._get_best_practices_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_bpa_request=sql_server_instance_bpa_request, + 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) + + def get_long_running_output(pipeline_response): + def internal_get_next(next_link=None): + if next_link is None: + return pipeline_response + return get_next(next_link) + + return ItemPaged(internal_get_next, extract_data) + + 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[ItemPaged[List[str]]].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[ItemPaged[List[str]]]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def run_migration_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstanceRunMigrationAssessmentResponse: + """Runs migration assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstanceRunMigrationAssessmentResponse. The + SqlServerInstanceRunMigrationAssessmentResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationAssessmentResponse + :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.SqlServerInstanceRunMigrationAssessmentResponse] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_run_migration_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstanceRunMigrationAssessmentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _run_target_recommendation_job_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + Union[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest, + _types.SqlServerInstanceRunTargetRecommendationJobRequest, + IO[bytes], + ] + ] = None, + **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)) + content_type = content_type if sql_server_instance_run_target_recommendation_job_request else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = ( + content_type or "application/json" if sql_server_instance_run_target_recommendation_job_request else None + ) + _content = None + if isinstance(sql_server_instance_run_target_recommendation_job_request, (IOBase, bytes)): + _content = sql_server_instance_run_target_recommendation_job_request + else: + if sql_server_instance_run_target_recommendation_job_request is not None: + _content = json.dumps(sql_server_instance_run_target_recommendation_job_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_run_target_recommendation_job_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest + :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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + _types.SqlServerInstanceRunTargetRecommendationJobRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobRequest + :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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Default value is None. + :type sql_server_instance_run_target_recommendation_job_request: 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 + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_target_recommendation_job( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_run_target_recommendation_job_request: Optional[ + Union[ + _models.SqlServerInstanceRunTargetRecommendationJobRequest, + _types.SqlServerInstanceRunTargetRecommendationJobRequest, + IO[bytes], + ] + ] = None, + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]: + """Starts a target recommendation job for the SQL Server instance. Only one job can run at a time. + If the previous job is in a non-terminal state (NotStarted or InProgress), calling this + operation again returns the existing job status without creating a new job. A new job is + created only when the previous job has reached a terminal state (Succeeded or Failed). This + operation does not return recommendations directly. Use the GetTargetRecommendationReports API + to check the job status and retrieve the target recommendation report if the jobStatus is + Succeeded. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_run_target_recommendation_job_request: Contains the parameters to + run SQL Server instance target recommendation job. Is either a + SqlServerInstanceRunTargetRecommendationJobRequest type or a IO[bytes] type. Default value is + None. + :type sql_server_instance_run_target_recommendation_job_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceRunTargetRecommendationJobRequest or IO[bytes] + :return: An instance of LROPoller that returns + SqlServerInstanceRunTargetRecommendationJobResponse. The + SqlServerInstanceRunTargetRecommendationJobResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunTargetRecommendationJobResponse] + :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)) + content_type = content_type if sql_server_instance_run_target_recommendation_job_request else None + cls: ClsType[_models.SqlServerInstanceRunTargetRecommendationJobResponse] = 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._run_target_recommendation_job_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_run_target_recommendation_job_request=sql_server_instance_run_target_recommendation_job_request, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceRunTargetRecommendationJobResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceRunTargetRecommendationJobResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceRunTargetRecommendationJobResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_target_recommendation_reports_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + Union[ + _models.SqlServerInstanceTargetRecommendationReportsRequest, + _types.SqlServerInstanceTargetRecommendationReportsRequest, + IO[bytes], + ] + ] = None, + **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)) + content_type = content_type if sql_server_instance_target_recommendation_reports_request else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = ( + content_type or "application/json" if sql_server_instance_target_recommendation_reports_request else None + ) + _content = None + if isinstance(sql_server_instance_target_recommendation_reports_request, (IOBase, bytes)): + _content = sql_server_instance_target_recommendation_reports_request + else: + if sql_server_instance_target_recommendation_reports_request is not None: + _content = json.dumps(sql_server_instance_target_recommendation_reports_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_target_recommendation_reports_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + _models.SqlServerInstanceTargetRecommendationReportsRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest + :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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + _types.SqlServerInstanceTargetRecommendationReportsRequest + ] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsRequest + :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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Default value is None. + :type sql_server_instance_target_recommendation_reports_request: 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 + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_target_recommendation_reports( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_target_recommendation_reports_request: Optional[ + Union[ + _models.SqlServerInstanceTargetRecommendationReportsRequest, + _types.SqlServerInstanceTargetRecommendationReportsRequest, + IO[bytes], + ] + ] = None, + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]: + """Retrieves the current job status and the latest target recommendation report for the SQL Server + instance. The response always includes the jobStatus field, which indicates the state of the + most recent target recommendation job (NotStarted, InProgress, Succeeded, or Failed). The + report data is included in the response only when the jobStatus is Succeeded. A target + recommendation job must be started using the RunTargetRecommendationJob API before calling this + API. Only the most recent report is returned. If the report contains more sections than can be + returned in a single response, use the nextReportOffset and nextSectionOffset values from the + response to retrieve the remaining data. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_target_recommendation_reports_request: Contains the parameters to + get SQL Server instance target recommendation reports. Is either a + SqlServerInstanceTargetRecommendationReportsRequest type or a IO[bytes] type. Default value is + None. + :type sql_server_instance_target_recommendation_reports_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceTargetRecommendationReportsRequest or IO[bytes] + :return: An instance of LROPoller that returns + SqlServerInstanceTargetRecommendationReportsResponse. The + SqlServerInstanceTargetRecommendationReportsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceTargetRecommendationReportsResponse] + :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)) + content_type = content_type if sql_server_instance_target_recommendation_reports_request else None + cls: ClsType[_models.SqlServerInstanceTargetRecommendationReportsResponse] = 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._get_target_recommendation_reports_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_target_recommendation_reports_request=sql_server_instance_target_recommendation_reports_request, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceTargetRecommendationReportsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceTargetRecommendationReportsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceTargetRecommendationReportsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _get_migration_readiness_report_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_get_migration_readiness_report_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_get_migration_readiness_report( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceMigrationReadinessReportResponse]: + """Retrieves the migration readiness report for the SQL Server instance. The report contains an + assessment of the instance's readiness for migration to Azure SQL targets. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of LROPoller that returns + SqlServerInstanceMigrationReadinessReportResponse. The + SqlServerInstanceMigrationReadinessReportResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceMigrationReadinessReportResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceMigrationReadinessReportResponse] = 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._get_migration_readiness_report_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceMigrationReadinessReportResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceMigrationReadinessReportResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceMigrationReadinessReportResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def run_best_practices_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstanceRunBestPracticesAssessmentResponse: + """The request to run SQL best practices assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstanceRunBestPracticesAssessmentResponse. The + SqlServerInstanceRunBestPracticesAssessmentResponse is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse + :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.SqlServerInstanceRunBestPracticesAssessmentResponse] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_run_best_practices_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstanceRunBestPracticesAssessmentResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _run_best_practice_assessment_initial( + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_run_best_practice_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_run_best_practice_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunBestPracticesAssessmentResponse]: + """The request to run SQL best practices assessment asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of LROPoller that returns + SqlServerInstanceRunBestPracticesAssessmentResponse. The + SqlServerInstanceRunBestPracticesAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunBestPracticesAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceRunBestPracticesAssessmentResponse] = 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._run_best_practice_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceRunBestPracticesAssessmentResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceRunBestPracticesAssessmentResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceRunBestPracticesAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _run_migration_readiness_assessment_initial( # pylint: disable=name-too-long + self, resource_group_name: str, sql_server_instance_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_sql_server_instances_run_migration_readiness_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 [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["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_run_migration_readiness_assessment( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse]: + """The request to run migration readiness assessment asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An instance of LROPoller that returns + SqlServerInstanceRunMigrationReadinessAssessmentResponse. The + SqlServerInstanceRunMigrationReadinessAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceRunMigrationReadinessAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse] = 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._run_migration_readiness_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize( + _models.SqlServerInstanceRunMigrationReadinessAssessmentResponse, response.json() + ) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceRunMigrationReadinessAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[_models.SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[_types.SqlServerInstanceJobsStatusRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Default value is None. + :type sql_server_instance_jobs_status_request: 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: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_jobs_status( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_status_request: Optional[ + Union[_models.SqlServerInstanceJobsStatusRequest, _types.SqlServerInstanceJobsStatusRequest, IO[bytes]] + ] = None, + **kwargs: Any + ) -> _models.SqlServerInstanceJobsStatusResponse: + """Gets jobs status details for sql arc resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_status_request: Contains the parameters to get SQL Server + instance agent jobs status. Is either a SqlServerInstanceJobsStatusRequest type or a IO[bytes] + type. Default value is None. + :type sql_server_instance_jobs_status_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsStatusRequest or IO[bytes] + :return: SqlServerInstanceJobsStatusResponse. The SqlServerInstanceJobsStatusResponse is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsStatusResponse + :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)) + content_type = content_type if sql_server_instance_jobs_status_request else None + cls: ClsType[_models.SqlServerInstanceJobsStatusResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if sql_server_instance_jobs_status_request else None + _content = None + if isinstance(sql_server_instance_jobs_status_request, (IOBase, bytes)): + _content = sql_server_instance_jobs_status_request + else: + if sql_server_instance_jobs_status_request is not None: + _content = json.dumps(sql_server_instance_jobs_status_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_jobs_status_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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 = 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.SqlServerInstanceJobsStatusResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _get_jobs_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[ + Union[_models.SqlServerInstanceJobsRequest, _types.SqlServerInstanceJobsRequest, IO[bytes]] + ] = None, + **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)) + content_type = content_type if sql_server_instance_jobs_request else None + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" if sql_server_instance_jobs_request else None + _content = None + if isinstance(sql_server_instance_jobs_request, (IOBase, bytes)): + _content = sql_server_instance_jobs_request + else: + if sql_server_instance_jobs_request is not None: + _content = json.dumps(sql_server_instance_jobs_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + _request = build_sql_server_instances_get_jobs_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[_models.SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest + :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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[_types.SqlServerInstanceJobsRequest] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsRequest + :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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Default value is None. + :type sql_server_instance_jobs_request: 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 SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_get_jobs( + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_jobs_request: Optional[ + Union[_models.SqlServerInstanceJobsRequest, _types.SqlServerInstanceJobsRequest, IO[bytes]] + ] = None, + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceJobsResponse]: + """Gets job details for sql arc resource asynchronously. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_jobs_request: Contains the parameters to get SQL Server instance + agent jobs status. Is either a SqlServerInstanceJobsRequest type or a IO[bytes] type. Default + value is None. + :type sql_server_instance_jobs_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceJobsRequest or IO[bytes] + :return: An instance of LROPoller that returns SqlServerInstanceJobsResponse. The + SqlServerInstanceJobsResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceJobsResponse] + :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)) + content_type = content_type if sql_server_instance_jobs_request else None + cls: ClsType[_models.SqlServerInstanceJobsResponse] = 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._get_jobs_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_jobs_request=sql_server_instance_jobs_request, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceJobsResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceJobsResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceJobsResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def pre_upgrade( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstance: + """Request Upgrade Permission before upgrading. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_pre_upgrade_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def post_upgrade( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> _models.SqlServerInstance: + """Clean up after upgrading. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: SqlServerInstance. The SqlServerInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance + :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.SqlServerInstance] = kwargs.pop("cls", None) + + _request = build_sql_server_instances_post_upgrade_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _run_managed_instance_link_assessment_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: Union[ + _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + 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(sql_server_instance_managed_instance_link_assessment_request, (IOBase, bytes)): + _content = sql_server_instance_managed_instance_link_assessment_request + else: + _content = json.dumps(sql_server_instance_managed_instance_link_assessment_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_instances_run_managed_instance_link_assessment_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest + :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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentRequest + :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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Required. + :type sql_server_instance_managed_instance_link_assessment_request: 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 + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_managed_instance_link_assessment( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + sql_server_instance_managed_instance_link_assessment_request: Union[ + _models.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + _types.SqlServerInstanceManagedInstanceLinkAssessmentRequest, + IO[bytes], + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]: + """Runs Managed Instance Link assessment for SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param sql_server_instance_managed_instance_link_assessment_request: Contains the parameters to + run SQL Server instance MI link assessment. Is either a + SqlServerInstanceManagedInstanceLinkAssessmentRequest type or a IO[bytes] type. Required. + :type sql_server_instance_managed_instance_link_assessment_request: + ~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentRequest or + ~azure.mgmt.azurearcdata.types.SqlServerInstanceManagedInstanceLinkAssessmentRequest or + IO[bytes] + :return: An instance of LROPoller that returns + SqlServerInstanceManagedInstanceLinkAssessmentResponse. The + SqlServerInstanceManagedInstanceLinkAssessmentResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstanceManagedInstanceLinkAssessmentResponse] + :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.SqlServerInstanceManagedInstanceLinkAssessmentResponse] = 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._run_managed_instance_link_assessment_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + sql_server_instance_managed_instance_link_assessment_request=sql_server_instance_managed_instance_link_assessment_request, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerInstanceManagedInstanceLinkAssessmentResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[_models.AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[_types.AvailabilityGroupRetrievalFilters] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.types.AvailabilityGroupRetrievalFilters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Default value is None. + :type availability_group_retrieval_filters: 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 iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def get_all_availability_groups( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_retrieval_filters: Optional[ + Union[_models.AvailabilityGroupRetrievalFilters, _types.AvailabilityGroupRetrievalFilters, IO[bytes]] + ] = None, + **kwargs: Any + ) -> ItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """Retrieves full properties of all the Availability Groups in a SQL Server instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_retrieval_filters: Is either a AvailabilityGroupRetrievalFilters type + or a IO[bytes] type. Default value is None. + :type availability_group_retrieval_filters: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupRetrievalFilters or + ~azure.mgmt.azurearcdata.types.AvailabilityGroupRetrievalFilters or IO[bytes] + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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)) + content_type = content_type if availability_group_retrieval_filters else None + cls: ClsType[List[_models.SqlServerAvailabilityGroupResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" if availability_group_retrieval_filters else None + _content = None + if isinstance(availability_group_retrieval_filters, (IOBase, bytes)): + _content = availability_group_retrieval_filters + else: + if availability_group_retrieval_filters is not None: + _content = json.dumps(availability_group_retrieval_filters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + else: + _content = None + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_server_instances_get_all_availability_groups_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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) + + 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.SqlServerAvailabilityGroupResource], + 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 SqlServerLicensesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_server_licenses` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_license_name: str, **kwargs: Any) -> _models.SqlServerLicense: + """Retrieves a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + _request = build_sql_server_licenses_get_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: _models.SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: _types.SqlServerLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.types.SqlServerLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Required. + :type sql_server_license: 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: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + sql_server_license_name: str, + sql_server_license: Union[_models.SqlServerLicense, _types.SqlServerLicense, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerLicense: + """Creates or replaces a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param sql_server_license: The SQL Server license to be created or updated. Is either a + SqlServerLicense type or a IO[bytes] type. Required. + :type sql_server_license: ~azure.mgmt.azurearcdata.models.SqlServerLicense or + ~azure.mgmt.azurearcdata.types.SqlServerLicense or IO[bytes] + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_license, (IOBase, bytes)): + _content = sql_server_license + else: + _content = json.dumps(sql_server_license, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_licenses_create_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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 = 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, + ) + 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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: _models.SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: _types.SqlServerLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Required. + :type parameters: 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: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + sql_server_license_name: str, + parameters: Union[_models.SqlServerLicenseUpdate, _types.SqlServerLicenseUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerLicense: + """Updates a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :param parameters: The SQL Server license. Is either a SqlServerLicenseUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerLicenseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerLicenseUpdate or IO[bytes] + :return: SqlServerLicense. The SqlServerLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerLicense + :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.SqlServerLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_licenses_update_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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 = 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.SqlServerLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, sql_server_license_name: str, **kwargs: Any + ) -> None: + """Deletes a SQL Server license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_license_name: Name of SQL Server License. Required. + :type sql_server_license_name: str + :return: None + :rtype: None + :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[None] = kwargs.pop("cls", None) + + _request = build_sql_server_licenses_delete_request( + resource_group_name=resource_group_name, + sql_server_license_name=sql_server_license_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) + + _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, 204]: + 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 cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.SqlServerLicense"]: + """List sqlServerLicense resources in the resource group. + + Gets all sqlServerLicenses 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 SqlServerLicense + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerLicense]] = 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_sql_server_licenses_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.SqlServerLicense], + 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(self, **kwargs: Any) -> ItemPaged["_models.SqlServerLicense"]: + """List sqlServerLicense resources in the subscription. + + List sqlServerLicense resources in the subscription. + + :return: An iterator like instance of SqlServerLicense + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerLicense]] = 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_sql_server_licenses_list_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.SqlServerLicense], + 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 PostgresInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`postgres_instances` 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: AzureArcDataManagementClientConfiguration = ( + 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, postgres_instance_name: str, **kwargs: Any) -> _models.PostgresInstance: + """Retrieves a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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.PostgresInstance] = kwargs.pop("cls", None) + + _request = build_postgres_instances_get_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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.PostgresInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: Union[_models.PostgresInstance, _types.PostgresInstance, 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_postgres_instances_create_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: _models.PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Required. + :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: _types.PostgresInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Required. + :type resource: ~azure.mgmt.azurearcdata.types.PostgresInstance + :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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. 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 PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + postgres_instance_name: str, + resource: Union[_models.PostgresInstance, _types.PostgresInstance, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PostgresInstance]: + """Creates or replaces a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param resource: The postgres instance. Is either a PostgresInstance type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance or + ~azure.mgmt.azurearcdata.types.PostgresInstance or IO[bytes] + :return: An instance of LROPoller that returns PostgresInstance. The PostgresInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] + :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.PostgresInstance] = 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._create_initial( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_name, + resource=resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PostgresInstance, 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: 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.PostgresInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PostgresInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: _models.PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: _types.PostgresInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.PostgresInstanceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Required. + :type parameters: 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: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + postgres_instance_name: str, + parameters: Union[_models.PostgresInstanceUpdate, _types.PostgresInstanceUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.PostgresInstance: + """Updates a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_name: str + :param parameters: The Postgres Instance. Is either a PostgresInstanceUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate or + ~azure.mgmt.azurearcdata.types.PostgresInstanceUpdate or IO[bytes] + :return: PostgresInstance. The PostgresInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance + :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.PostgresInstance] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_postgres_instances_update_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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 = 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.PostgresInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, postgres_instance_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_postgres_instances_delete_request( + resource_group_name=resource_group_name, + postgres_instance_name=postgres_instance_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 [200, 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["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, postgres_instance_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a postgres Instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param postgres_instance_name: Name of Postgres Instance. Required. + :type postgres_instance_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, + postgres_instance_name=postgres_instance_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.PostgresInstance"]: + """List postgres Instance resources in the resource group. + + Get a postgres Instances list by Resource group name. + + :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 PostgresInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PostgresInstance]] = 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_postgres_instances_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.PostgresInstance], + 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(self, **kwargs: Any) -> ItemPaged["_models.PostgresInstance"]: + """List postgres Instance resources in the subscription. + + List postgres Instance resources in the subscription. + + :return: An iterator like instance of PostgresInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PostgresInstance]] = 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_postgres_instances_list_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.PostgresInstance], + 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 SqlServerEsuLicensesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_server_esu_licenses` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_server_esu_license_name: str, **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Retrieves a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + _request = build_sql_server_esu_licenses_get_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: _models.SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: _types.SqlServerEsuLicense, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.types.SqlServerEsuLicense + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Required. + :type sql_server_esu_license: 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: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + sql_server_esu_license: Union[_models.SqlServerEsuLicense, _types.SqlServerEsuLicense, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Creates or replaces a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param sql_server_esu_license: The SQL Server ESU license to be created or updated. Is either a + SqlServerEsuLicense type or a IO[bytes] type. Required. + :type sql_server_esu_license: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense or + ~azure.mgmt.azurearcdata.types.SqlServerEsuLicense or IO[bytes] + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_esu_license, (IOBase, bytes)): + _content = sql_server_esu_license + else: + _content = json.dumps(sql_server_esu_license, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_esu_licenses_create_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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 = 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, + ) + 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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: _models.SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: _types.SqlServerEsuLicenseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: ~azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Required. + :type parameters: 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: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + sql_server_esu_license_name: str, + parameters: Union[_models.SqlServerEsuLicenseUpdate, _types.SqlServerEsuLicenseUpdate, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerEsuLicense: + """Updates a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :param parameters: The SQL Server ESU license. Is either a SqlServerEsuLicenseUpdate type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicenseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerEsuLicenseUpdate or IO[bytes] + :return: SqlServerEsuLicense. The SqlServerEsuLicense is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerEsuLicense + :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.SqlServerEsuLicense] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_esu_licenses_update_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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 = 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.SqlServerEsuLicense, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, sql_server_esu_license_name: str, **kwargs: Any + ) -> None: + """Deletes a SQL Server ESU license resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_esu_license_name: Name of SQL Server ESU License. Required. + :type sql_server_esu_license_name: str + :return: None + :rtype: None + :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[None] = kwargs.pop("cls", None) + + _request = build_sql_server_esu_licenses_delete_request( + resource_group_name=resource_group_name, + sql_server_esu_license_name=sql_server_esu_license_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) + + _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, 204]: + 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 cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.SqlServerEsuLicense"]: + """List sqlServerEsuLicense resources in the resource group. + + Gets all sqlServerEsuLicenses 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 SqlServerEsuLicense + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerEsuLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerEsuLicense]] = 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_sql_server_esu_licenses_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.SqlServerEsuLicense], + 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(self, **kwargs: Any) -> ItemPaged["_models.SqlServerEsuLicense"]: + """List sqlServerEsuLicense resources in the subscription. + + List sqlServerEsuLicense resources in the subscription. + + :return: An iterator like instance of SqlServerEsuLicense + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerEsuLicense] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerEsuLicense]] = 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_sql_server_esu_licenses_list_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.SqlServerEsuLicense], + 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 FailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`failover_groups` 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: AzureArcDataManagementClientConfiguration = ( + 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, sql_managed_instance_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.FailoverGroupResource: + """Retrieves a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :return: FailoverGroupResource. The FailoverGroupResource is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.FailoverGroupResource + :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.FailoverGroupResource] = kwargs.pop("cls", None) + + _request = build_failover_groups_get_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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 = 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.FailoverGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: Union[_models.FailoverGroupResource, _types.FailoverGroupResource, 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(failover_group_resource, (IOBase, bytes)): + _content = failover_group_resource + else: + _content = json.dumps(failover_group_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_create_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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 = 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( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: _models.FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.models.FailoverGroupResource + :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 FailoverGroupResource. The FailoverGroupResource + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: _types.FailoverGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.types.FailoverGroupResource + :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 FailoverGroupResource. The FailoverGroupResource + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Required. + :type failover_group_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 FailoverGroupResource. The FailoverGroupResource + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + sql_managed_instance_name: str, + failover_group_name: str, + failover_group_resource: Union[_models.FailoverGroupResource, _types.FailoverGroupResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FailoverGroupResource]: + """Creates or replaces a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_group_name: str + :param failover_group_resource: desc. Is either a FailoverGroupResource type or a IO[bytes] + type. Required. + :type failover_group_resource: ~azure.mgmt.azurearcdata.models.FailoverGroupResource or + ~azure.mgmt.azurearcdata.types.FailoverGroupResource or IO[bytes] + :return: An instance of LROPoller that returns FailoverGroupResource. The FailoverGroupResource + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :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.FailoverGroupResource] = 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._create_initial( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_group_name, + failover_group_resource=failover_group_resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverGroupResource, 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: 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.FailoverGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, sql_managed_instance_name: str, failover_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_failover_groups_delete_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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 [200, 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["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, sql_managed_instance_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a failover group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :param failover_group_name: The name of the Failover Group. Required. + :type failover_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, + sql_managed_instance_name=sql_managed_instance_name, + failover_group_name=failover_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( + self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.FailoverGroupResource"]: + """List the failover groups associated with the given sql managed instance. + + List the failover groups associated with the given sql managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_managed_instance_name: Name of SQL Managed Instance. Required. + :type sql_managed_instance_name: str + :return: An iterator like instance of FailoverGroupResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.FailoverGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverGroupResource]] = 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_failover_groups_list_request( + resource_group_name=resource_group_name, + sql_managed_instance_name=sql_managed_instance_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.FailoverGroupResource], + 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 SqlServerAvailabilityGroupsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_server_availability_groups` 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: AzureArcDataManagementClientConfiguration = ( + 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") + + def _create_availability_group_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: Union[ + _models.AvailabilityGroupCreateUpdateConfiguration, + _types.AvailabilityGroupCreateUpdateConfiguration, + 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(create_ag_configuration, (IOBase, bytes)): + _content = create_ag_configuration + else: + _content = json.dumps(create_ag_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_availability_group_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: _models.AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: _types.AvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_ag_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_availability_group( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_ag_configuration: Union[ + _models.AvailabilityGroupCreateUpdateConfiguration, + _types.AvailabilityGroupCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_ag_configuration: The configuration for the new SQL Server availability group + resource. Is either a AvailabilityGroupCreateUpdateConfiguration type or a IO[bytes] type. + Required. + :type create_ag_configuration: + ~azure.mgmt.azurearcdata.models.AvailabilityGroupCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.AvailabilityGroupCreateUpdateConfiguration or IO[bytes] + :return: An instance of LROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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._create_availability_group_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_ag_configuration=create_ag_configuration, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _create_distributed_availability_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: Union[ + _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + 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(create_dag_configuration, (IOBase, bytes)): + _content = create_dag_configuration + else: + _content = json.dumps(create_dag_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_distributed_availability_group_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Required. + :type create_dag_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_distributed_availability_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + sql_server_instance_name: str, + create_dag_configuration: Union[ + _models.DistributedAvailabilityGroupCreateUpdateConfiguration, + _types.DistributedAvailabilityGroupCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create a SQL Server distributed availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_dag_configuration: The configuration for the new SQL Server availability group + resource. Is either a DistributedAvailabilityGroupCreateUpdateConfiguration type or a IO[bytes] + type. Required. + :type create_dag_configuration: + ~azure.mgmt.azurearcdata.models.DistributedAvailabilityGroupCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.DistributedAvailabilityGroupCreateUpdateConfiguration or + IO[bytes] + :return: An instance of LROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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._create_distributed_availability_group_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_dag_configuration=create_dag_configuration, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _create_managed_instance_link_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: Union[ + _models.ManagedInstanceLinkCreateUpdateConfiguration, + _types.ManagedInstanceLinkCreateUpdateConfiguration, + 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(create_managed_instance_link_configuration, (IOBase, bytes)): + _content = create_managed_instance_link_configuration + else: + _content = json.dumps(create_managed_instance_link_configuration, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_managed_instance_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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["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 + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: _models.ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: _types.ManagedInstanceLinkCreateUpdateConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.types.ManagedInstanceLinkCreateUpdateConfiguration + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Required. + :type create_managed_instance_link_configuration: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_managed_instance_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + create_managed_instance_link_configuration: Union[ + _models.ManagedInstanceLinkCreateUpdateConfiguration, + _types.ManagedInstanceLinkCreateUpdateConfiguration, + IO[bytes], + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Create an Managed Instance Link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param create_managed_instance_link_configuration: The configuration for the new Managed + Instance Link resource. Is either a ManagedInstanceLinkCreateUpdateConfiguration type or a + IO[bytes] type. Required. + :type create_managed_instance_link_configuration: + ~azure.mgmt.azurearcdata.models.ManagedInstanceLinkCreateUpdateConfiguration or + ~azure.mgmt.azurearcdata.types.ManagedInstanceLinkCreateUpdateConfiguration or IO[bytes] + :return: An instance of LROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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._create_managed_instance_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + create_managed_instance_link_configuration=create_managed_instance_link_configuration, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Retrieves an Arc Sql Server availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: _models.SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: _types.SqlServerAvailabilityGroupResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Required. + :type sql_server_availability_group_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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_resource: Union[ + _models.SqlServerAvailabilityGroupResource, _types.SqlServerAvailabilityGroupResource, IO[bytes] + ], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Creates or replaces an Arc Sql Server Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_resource: The request body for availability group + resource. Is either a SqlServerAvailabilityGroupResource type or a IO[bytes] type. Required. + :type sql_server_availability_group_resource: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource or + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupResource or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_availability_group_resource, (IOBase, bytes)): + _content = sql_server_availability_group_resource + else: + _content = json.dumps(sql_server_availability_group_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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, + ) + 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: Union[ + _models.SqlServerAvailabilityGroupUpdate, _types.SqlServerAvailabilityGroupUpdate, 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(sql_server_availability_group_update, (IOBase, bytes)): + _content = sql_server_availability_group_update + else: + _content = json.dumps(sql_server_availability_group_update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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["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 + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: _models.SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: _types.SqlServerAvailabilityGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupUpdate + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Required. + :type sql_server_availability_group_update: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + sql_server_availability_group_update: Union[ + _models.SqlServerAvailabilityGroupUpdate, _types.SqlServerAvailabilityGroupUpdate, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Updates an existing Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param sql_server_availability_group_update: The requested server availability group resource + state. Is either a SqlServerAvailabilityGroupUpdate type or a IO[bytes] type. Required. + :type sql_server_availability_group_update: + ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerAvailabilityGroupUpdate or IO[bytes] + :return: An instance of LROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_group_name, + sql_server_availability_group_update=sql_server_availability_group_update, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlServerAvailabilityGroupResource, 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: 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.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, sql_server_instance_name: str, availability_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_sql_server_availability_groups_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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["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, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an Arc Sql Server availability group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_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, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.SqlServerAvailabilityGroupResource"]: + """List the availability group associated with the given Arc Sql Server. + + List the availability group associated with the given Arc Sql Server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An iterator like instance of SqlServerAvailabilityGroupResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlServerAvailabilityGroupResource]] = 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_sql_server_availability_groups_list_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_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.SqlServerAvailabilityGroupResource], + 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 detail_view( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Retrieves detailed properties of the Availability Group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_detail_view_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def failover( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request manual failover of the availability group to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_failover_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def force_failover_allow_data_loss( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request forced failover of the availability group to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + _request = build_sql_server_availability_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _models.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _types.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.types.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. + Required. + :type databases: 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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def add_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Union[_models.Databases, _types.Databases, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request adding database(s) to an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to add to the SQL Server availability group resource. Is + either a Databases type or a IO[bytes] type. Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases or + ~azure.mgmt.azurearcdata.types.Databases or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(databases, (IOBase, bytes)): + _content = databases + else: + _content = json.dumps(databases, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_add_databases_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _failover_mi_link_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: Union[ + _models.FailoverMiLinkResourceId, _types.FailoverMiLinkResourceId, 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(managed_instance_resource_id, (IOBase, bytes)): + _content = managed_instance_resource_id + else: + _content = json.dumps(managed_instance_resource_id, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_failover_mi_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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["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 + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: _models.FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: _types.FailoverMiLinkResourceId, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.types.FailoverMiLinkResourceId + :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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Required. + :type managed_instance_resource_id: 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 SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_failover_mi_link( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + managed_instance_resource_id: Union[ + _models.FailoverMiLinkResourceId, _types.FailoverMiLinkResourceId, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.SqlServerAvailabilityGroupResource]: + """Request failover of Arc Sql Server to Azure Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param managed_instance_resource_id: The azure resource identifier for the Sql Managed + Instance. Is either a FailoverMiLinkResourceId type or a IO[bytes] type. Required. + :type managed_instance_resource_id: ~azure.mgmt.azurearcdata.models.FailoverMiLinkResourceId or + ~azure.mgmt.azurearcdata.types.FailoverMiLinkResourceId or IO[bytes] + :return: An instance of LROPoller that returns SqlServerAvailabilityGroupResource. The + SqlServerAvailabilityGroupResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource] + :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.SqlServerAvailabilityGroupResource] = 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._failover_mi_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_group_name, + managed_instance_resource_id=managed_instance_resource_id, + 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) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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 = _deserialize(_models.SqlServerAvailabilityGroupResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # 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[_models.SqlServerAvailabilityGroupResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerAvailabilityGroupResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_mi_link_initial( + self, resource_group_name: str, sql_server_instance_name: str, availability_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_sql_server_availability_groups_delete_mi_link_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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]: + 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 = {} + 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_mi_link( + self, resource_group_name: str, sql_server_instance_name: str, availability_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the MI Link between an Azure Arc-enabled SQL Server and an Azure SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_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_mi_link_initial( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _models.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: _types.Databases, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: ~azure.mgmt.azurearcdata.types.Databases + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Required. + :type databases: 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: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def remove_databases( + self, + resource_group_name: str, + sql_server_instance_name: str, + availability_group_name: str, + databases: Union[_models.Databases, _types.Databases, IO[bytes]], + **kwargs: Any + ) -> _models.SqlServerAvailabilityGroupResource: + """Request removing database(s) from an existing availability group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param availability_group_name: Name of SQL Availability Group. Required. + :type availability_group_name: str + :param databases: The database names to remove from the SQL Server availability group resource. + Is either a Databases type or a IO[bytes] type. Required. + :type databases: ~azure.mgmt.azurearcdata.models.Databases or + ~azure.mgmt.azurearcdata.types.Databases or IO[bytes] + :return: SqlServerAvailabilityGroupResource. The SqlServerAvailabilityGroupResource is + compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerAvailabilityGroupResource + :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.SqlServerAvailabilityGroupResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(databases, (IOBase, bytes)): + _content = databases + else: + _content = json.dumps(databases, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_availability_groups_remove_databases_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + availability_group_name=availability_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 = 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.SqlServerAvailabilityGroupResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DataControllersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`data_controllers` 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: AzureArcDataManagementClientConfiguration = ( + 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_data_controller( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> _models.DataControllerResource: + """Retrieves a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :return: DataControllerResource. The DataControllerResource is compatible with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.DataControllerResource + :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.DataControllerResource] = kwargs.pop("cls", None) + + _request = build_data_controllers_get_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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.DataControllerResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _put_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerResource, _types.DataControllerResource, 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(data_controller_resource, (IOBase, bytes)): + _content = data_controller_resource + else: + _content = json.dumps(data_controller_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_controllers_put_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _models.DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _types.DataControllerResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.types.DataControllerResource + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Required. + :type data_controller_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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_put_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerResource, _types.DataControllerResource, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Creates or replaces a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: desc. Is either a DataControllerResource type or a IO[bytes] + type. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerResource or + ~azure.mgmt.azurearcdata.types.DataControllerResource or IO[bytes] + :return: An instance of LROPoller that returns DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :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.DataControllerResource] = 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._put_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DataControllerResource, 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: 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.DataControllerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DataControllerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _patch_data_controller_initial( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerUpdate, _types.DataControllerUpdate, 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(data_controller_resource, (IOBase, bytes)): + _content = data_controller_resource + else: + _content = json.dumps(data_controller_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_controllers_patch_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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["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_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _models.DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: _types.DataControllerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.types.DataControllerUpdate + :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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Required. + :type data_controller_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 DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_patch_data_controller( + self, + resource_group_name: str, + data_controller_name: str, + data_controller_resource: Union[_models.DataControllerUpdate, _types.DataControllerUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DataControllerResource]: + """Updates a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param data_controller_resource: The update data controller resource. Is either a + DataControllerUpdate type or a IO[bytes] type. Required. + :type data_controller_resource: ~azure.mgmt.azurearcdata.models.DataControllerUpdate or + ~azure.mgmt.azurearcdata.types.DataControllerUpdate or IO[bytes] + :return: An instance of LROPoller that returns DataControllerResource. The + DataControllerResource is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.DataControllerResource] + :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.DataControllerResource] = 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._patch_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + data_controller_resource=data_controller_resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DataControllerResource, 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: 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.DataControllerResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DataControllerResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_data_controller_initial( + self, resource_group_name: str, data_controller_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_data_controllers_delete_data_controller_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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 [200, 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["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_data_controller( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a dataController resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_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_data_controller_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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_in_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.DataControllerResource"]: + """List dataController resources in the resource group. + + List dataController resources in the 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 DataControllerResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataControllerResource]] = 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_data_controllers_list_in_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.DataControllerResource], + 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_in_subscription(self, **kwargs: Any) -> ItemPaged["_models.DataControllerResource"]: + """List dataController resources in the subscription. + + List dataController resources in the subscription. + + :return: An iterator like instance of DataControllerResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.DataControllerResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataControllerResource]] = 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_data_controllers_list_in_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.DataControllerResource], + 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 ActiveDirectoryConnectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`active_directory_connectors` 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: AzureArcDataManagementClientConfiguration = ( + 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, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any + ) -> _models.ActiveDirectoryConnectorResource: + """Retrieves an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :return: ActiveDirectoryConnectorResource. The ActiveDirectoryConnectorResource is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource + :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.ActiveDirectoryConnectorResource] = kwargs.pop("cls", None) + + _request = build_active_directory_connectors_get_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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.ActiveDirectoryConnectorResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: Union[ + _models.ActiveDirectoryConnectorResource, _types.ActiveDirectoryConnectorResource, 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(active_directory_connector_resource, (IOBase, bytes)): + _content = active_directory_connector_resource + else: + _content = json.dumps(active_directory_connector_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_active_directory_connectors_create_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: _models.ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource + :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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: _types.ActiveDirectoryConnectorResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorResource + :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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Required. + :type active_directory_connector_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 ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + data_controller_name: str, + active_directory_connector_name: str, + active_directory_connector_resource: Union[ + _models.ActiveDirectoryConnectorResource, _types.ActiveDirectoryConnectorResource, IO[bytes] + ], + **kwargs: Any + ) -> LROPoller[_models.ActiveDirectoryConnectorResource]: + """Creates or replaces an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_name: str + :param active_directory_connector_resource: desc. Is either a ActiveDirectoryConnectorResource + type or a IO[bytes] type. Required. + :type active_directory_connector_resource: + ~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource or + ~azure.mgmt.azurearcdata.types.ActiveDirectoryConnectorResource or IO[bytes] + :return: An instance of LROPoller that returns ActiveDirectoryConnectorResource. The + ActiveDirectoryConnectorResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :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.ActiveDirectoryConnectorResource] = 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._create_initial( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_name, + active_directory_connector_resource=active_directory_connector_resource, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ActiveDirectoryConnectorResource, 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: 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.ActiveDirectoryConnectorResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ActiveDirectoryConnectorResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, data_controller_name: str, active_directory_connector_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_active_directory_connectors_delete_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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 [200, 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["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, data_controller_name: str, active_directory_connector_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an Active Directory connector resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :param active_directory_connector_name: The name of the Active Directory connector instance. + Required. + :type active_directory_connector_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, + data_controller_name=data_controller_name, + active_directory_connector_name=active_directory_connector_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( + self, resource_group_name: str, data_controller_name: str, **kwargs: Any + ) -> ItemPaged["_models.ActiveDirectoryConnectorResource"]: + """List the active directory connectors associated with the given data controller. + + List the active directory connectors associated with the given data controller. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param data_controller_name: The name of the data controller. Required. + :type data_controller_name: str + :return: An iterator like instance of ActiveDirectoryConnectorResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.ActiveDirectoryConnectorResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ActiveDirectoryConnectorResource]] = 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_active_directory_connectors_list_request( + resource_group_name=resource_group_name, + data_controller_name=data_controller_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.ActiveDirectoryConnectorResource], + 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 SqlServerDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s + :attr:`sql_server_databases` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") @@ -78,18 +13949,673 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """Lists all of the available Azure Data Services on Azure Arc API operations. + def get( + self, resource_group_name: str, sql_server_instance_name: str, database_name: str, **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Retrieves an Arc Sql Server database. - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :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.SqlServerDatabaseResource] = kwargs.pop("cls", None) + + _request = build_sql_server_databases_get_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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.SqlServerDatabaseResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: _models.SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: _types.SqlServerDatabaseResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.types.SqlServerDatabaseResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Required. + :type sql_server_database_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: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_resource: Union[ + _models.SqlServerDatabaseResource, _types.SqlServerDatabaseResource, IO[bytes] + ], + **kwargs: Any + ) -> _models.SqlServerDatabaseResource: + """Creates or replaces an Arc Sql Server Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_resource: The request body for database resource. Is either a + SqlServerDatabaseResource type or a IO[bytes] type. Required. + :type sql_server_database_resource: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + or ~azure.mgmt.azurearcdata.types.SqlServerDatabaseResource or IO[bytes] + :return: SqlServerDatabaseResource. The SqlServerDatabaseResource is compatible with + MutableMapping + :rtype: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource + :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.SqlServerDatabaseResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(sql_server_database_resource, (IOBase, bytes)): + _content = sql_server_database_resource + else: + _content = json.dumps(sql_server_database_resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_databases_create_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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 = 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, + ) + 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.SqlServerDatabaseResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_initial( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: Union[_models.SqlServerDatabaseUpdate, _types.SqlServerDatabaseUpdate, 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(sql_server_database_update, (IOBase, bytes)): + _content = sql_server_database_update + else: + _content = json.dumps(sql_server_database_update, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_server_databases_update_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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["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 + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: _models.SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate + :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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: _types.SqlServerDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.types.SqlServerDatabaseUpdate + :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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Required. + :type sql_server_database_update: 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 SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + sql_server_instance_name: str, + database_name: str, + sql_server_database_update: Union[_models.SqlServerDatabaseUpdate, _types.SqlServerDatabaseUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SqlServerDatabaseResource]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_name: str + :param sql_server_database_update: The requested database resource state. Is either a + SqlServerDatabaseUpdate type or a IO[bytes] type. Required. + :type sql_server_database_update: ~azure.mgmt.azurearcdata.models.SqlServerDatabaseUpdate or + ~azure.mgmt.azurearcdata.types.SqlServerDatabaseUpdate or IO[bytes] + :return: An instance of LROPoller that returns SqlServerDatabaseResource. The + SqlServerDatabaseResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] + :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.SqlServerDatabaseResource] = 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, + sql_server_instance_name=sql_server_instance_name, + database_name=database_name, + sql_server_database_update=sql_server_database_update, + 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) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlServerDatabaseResource, 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: 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.SqlServerDatabaseResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlServerDatabaseResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, sql_server_instance_name: str, database_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_sql_server_databases_delete_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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["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, sql_server_instance_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an Arc Sql Server database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :param database_name: Name of the database. Required. + :type database_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, + sql_server_instance_name=sql_server_instance_name, + database_name=database_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( + self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.SqlServerDatabaseResource"]: + """List the databases associated with the given Arc Sql Server. + + List the databases associated with the given Arc Sql Server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param sql_server_instance_name: Name of SQL Server Instance. Required. + :type sql_server_instance_name: str + :return: An iterator like instance of SqlServerDatabaseResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerDatabaseResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SqlServerDatabaseResource]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -102,12 +14628,20 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_sql_server_databases_list_request( + resource_group_name=resource_group_name, + sql_server_instance_name=sql_server_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + 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 @@ -120,18 +14654,29 @@ 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, ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + 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 = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlServerDatabaseResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -144,9 +14689,9 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_patch.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_patch.py index 5755fd181b3f..87676c65a8f0 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_patch.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_patch.py @@ -1,16 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - - +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_postgres_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_postgres_instances_operations.py deleted file mode 100644 index 27c34481ec58..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_postgres_instances_operations.py +++ /dev/null @@ -1,900 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import AzureArcDataManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/postgresInstances" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_list_by_resource_group_request(resource_group_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) - - -def build_get_request( - resource_group_name: str, postgres_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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) - - -def build_create_request( - resource_group_name: str, postgres_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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 - 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_delete_request( - resource_group_name: str, postgres_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, postgres_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "postgresInstanceName": _SERIALIZER.url("postgres_instance_name", postgres_instance_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 - 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class PostgresInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`postgres_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> ItemPaged["_models.PostgresInstance"]: - """List postgres Instance resources in the subscription. - - List postgres Instance resources in the subscription. - - :return: An iterator like instance of either PostgresInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PostgresInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.PostgresInstance"]: - """List postgres Instance resources in the resource group. - - Get a postgres Instances list by Resource group name. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either PostgresInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PostgresInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, postgres_instance_name: str, **kwargs: Any) -> _models.PostgresInstance: - """Retrieves a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PostgresInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: Union[_models.PostgresInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "PostgresInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: _models.PostgresInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. Required. - :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. 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 either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - postgres_instance_name: str, - resource: Union[_models.PostgresInstance, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PostgresInstance]: - """Creates or replaces a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param resource: The postgres instance. Is either a PostgresInstance type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.azurearcdata.models.PostgresInstance or IO[bytes] - :return: An instance of LROPoller that returns either PostgresInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.PostgresInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PostgresInstance] = 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._create_initial( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - resource=resource, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PostgresInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PostgresInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, postgres_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, postgres_instance_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - postgres_instance_name=postgres_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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 - - @overload - def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: _models.PostgresInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Required. - :type parameters: 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: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - postgres_instance_name: str, - parameters: Union[_models.PostgresInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.PostgresInstance: - """Updates a postgres Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param postgres_instance_name: Name of Postgres Instance. Required. - :type postgres_instance_name: str - :param parameters: The Postgres Instance. Is either a PostgresInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.PostgresInstanceUpdate or IO[bytes] - :return: PostgresInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.PostgresInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PostgresInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PostgresInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - postgres_instance_name=postgres_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PostgresInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py deleted file mode 100644 index e45aa9bada7f..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_managed_instances_operations.py +++ /dev/null @@ -1,906 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import AzureArcDataManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlManagedInstances" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_list_by_resource_group_request(resource_group_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) - - -def build_get_request( - resource_group_name: str, sql_managed_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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) - - -def build_create_request( - resource_group_name: str, sql_managed_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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 - 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_delete_request( - resource_group_name: str, sql_managed_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, sql_managed_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlManagedInstances/{sqlManagedInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlManagedInstanceName": _SERIALIZER.url("sql_managed_instance_name", sql_managed_instance_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 - 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlManagedInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`sql_managed_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> ItemPaged["_models.SqlManagedInstance"]: - """List sqlManagedInstance resources in the subscription. - - List sqlManagedInstance resources in the subscription. - - :return: An iterator like instance of either SqlManagedInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.SqlManagedInstance"]: - """List sqlManagedInstance resources in the resource group. - - Gets all sqlManagedInstances in a resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either SqlManagedInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any - ) -> _models.SqlManagedInstance: - """Retrieves a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlManagedInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: Union[_models.SqlManagedInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(sql_managed_instance, (IOBase, bytes)): - _content = sql_managed_instance - else: - _json = self._serialize.body(sql_managed_instance, "SqlManagedInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: _models.SqlManagedInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. - :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Required. - :type sql_managed_instance: 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 either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - sql_managed_instance_name: str, - sql_managed_instance: Union[_models.SqlManagedInstance, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SqlManagedInstance]: - """Creates or replaces a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param sql_managed_instance: The SQL Managed Instance to be created or updated. Is either a - SqlManagedInstance type or a IO[bytes] type. Required. - :type sql_managed_instance: ~azure.mgmt.azurearcdata.models.SqlManagedInstance or IO[bytes] - :return: An instance of LROPoller that returns either SqlManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlManagedInstance] = 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._create_initial( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - sql_managed_instance=sql_managed_instance, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SqlManagedInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SqlManagedInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, sql_managed_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, sql_managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - sql_managed_instance_name=sql_managed_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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 - - @overload - def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: _models.SqlManagedInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Required. - :type parameters: 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: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - sql_managed_instance_name: str, - parameters: Union[_models.SqlManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SqlManagedInstance: - """Updates a SQL Managed Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_managed_instance_name: Name of SQL Managed Instance. Required. - :type sql_managed_instance_name: str - :param parameters: The SQL Managed Instance. Is either a SqlManagedInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlManagedInstanceUpdate or IO[bytes] - :return: SqlManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlManagedInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlManagedInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SqlManagedInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - sql_managed_instance_name=sql_managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py deleted file mode 100644 index ca3974aa3d3e..000000000000 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/operations/_sql_server_instances_operations.py +++ /dev/null @@ -1,902 +0,0 @@ -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import AzureArcDataManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureArcData/sqlServerInstances" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_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_list_by_resource_group_request(resource_group_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_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) - - -def build_get_request( - resource_group_name: str, sql_server_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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) - - -def build_create_request( - resource_group_name: str, sql_server_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 - 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_delete_request( - resource_group_name: str, sql_server_instance_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", "2022-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, sql_server_instance_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", "2022-03-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "sqlServerInstanceName": _SERIALIZER.url("sql_server_instance_name", sql_server_instance_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 - 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlServerInstancesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurearcdata.AzureArcDataManagementClient`'s - :attr:`sql_server_instances` attribute. - """ - - models = _models - - 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: AzureArcDataManagementClientConfiguration = ( - 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 list(self, **kwargs: Any) -> ItemPaged["_models.SqlServerInstance"]: - """List sqlServerInstance resources in the subscription. - - List sqlServerInstance resources in the subscription. - - :return: An iterator like instance of either SqlServerInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstanceListResult] = 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_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlServerInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.SqlServerInstance"]: - """List sqlServerInstance resources in the resource group. - - Gets all sqlServerInstances in a resource group. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :return: An iterator like instance of either SqlServerInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstanceListResult] = 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlServerInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any) -> _models.SqlServerInstance: - """Retrieves a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlServerInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: Union[_models.SqlServerInstance, 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(sql_server_instance, (IOBase, bytes)): - _content = sql_server_instance - else: - _json = self._serialize.body(sql_server_instance, "SqlServerInstance") - - _request = build_create_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: _models.SqlServerInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Required. - :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Required. - :type sql_server_instance: 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 either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - sql_server_instance_name: str, - sql_server_instance: Union[_models.SqlServerInstance, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SqlServerInstance]: - """Creates or replaces a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param sql_server_instance: The SQL Server Instance to be created or updated. Is either a - SqlServerInstance type or a IO[bytes] type. Required. - :type sql_server_instance: ~azure.mgmt.azurearcdata.models.SqlServerInstance or IO[bytes] - :return: An instance of LROPoller that returns either SqlServerInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurearcdata.models.SqlServerInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlServerInstance] = 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._create_initial( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - sql_server_instance=sql_server_instance, - api_version=api_version, - 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) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SqlServerInstance].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SqlServerInstance]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, sql_server_instance_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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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, 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 = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, sql_server_instance_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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, - sql_server_instance_name=sql_server_instance_name, - api_version=api_version, - 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 - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **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 - - @overload - def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: _models.SqlServerInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Required. - :type parameters: 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: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - sql_server_instance_name: str, - parameters: Union[_models.SqlServerInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> _models.SqlServerInstance: - """Updates a SQL Server Instance resource. - - :param resource_group_name: The name of the Azure resource group. Required. - :type resource_group_name: str - :param sql_server_instance_name: Name of SQL Server Instance. Required. - :type sql_server_instance_name: str - :param parameters: The SQL Server Instance. Is either a SqlServerInstanceUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.azurearcdata.models.SqlServerInstanceUpdate or IO[bytes] - :return: SqlServerInstance or the result of cls(response) - :rtype: ~azure.mgmt.azurearcdata.models.SqlServerInstance - :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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlServerInstance] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SqlServerInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - sql_server_instance_name=sql_server_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlServerInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/types.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/types.py new file mode 100644 index 000000000000..21857dd52f92 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/types.py @@ -0,0 +1,4918 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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 Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + AccountProvisioningMode, + ActivationState, + AggregationType, + AlwaysOnRole, + ArcSqlManagedInstanceLicenseType, + ArcSqlServerAvailabilityGroupTypeFilter, + ArcSqlServerAvailabilityMode, + ArcSqlServerFailoverMode, + ArcSqlServerLicenseType, + AssessmentStatus, + AutomatedBackupPreference, + AzureManagedInstanceRole, + BillingPlan, + ClusterType, + ConnectionAuth, + ConnectionStatus, + CreatedByType, + DatabaseCreateMode, + DatabaseState, + DbFailover, + DefenderStatus, + DifferentialBackupHours, + DiscoverySource, + DtcSupport, + EditionType, + EncryptionAlgorithm, + ExecutionState, + ExtendedLocationTypes, + FailoverGroupPartnerSyncMode, + FailureConditionLevel, + HostType, + IdentityType, + Infrastructure, + InitiatedFrom, + InstanceFailoverGroupRole, + JobStatus, + LastExecutionStatus, + LicenseCategory, + MiLinkAssessmentCategory, + MigrationMode, + MigrationStatus, + Mode, + OperationOrigin, + PrimaryAllowConnections, + ProvisioningState, + RecommendationStatus, + RecoveryMode, + ReplicationPartnerType, + ResourceUpdateMode, + Result, + Role, + ScopeType, + SecondaryAllowConnections, + SeedingMode, + SequencerState, + ServiceType, + SqlManagedInstanceSkuTier, + SqlServerInstanceBpaColumnType, + SqlServerInstanceBpaQueryType, + SqlServerInstanceBpaReportType, + SqlServerInstanceTargetRecommendationReportSectionType, + SqlServerInstanceTelemetryColumnType, + SqlVersion, + State, + TargetType, + Version, + ) + + +class ActiveDirectoryConnectorDNSDetails(TypedDict, total=False): + """DNS server details. + + :ivar domain_name: DNS domain name for which DNS lookups should be forwarded to the Active + Directory DNS servers. + :vartype domain_name: str + :ivar nameserver_ip_addresses: List of Active Directory DNS server IP addresses. Required. + :vartype nameserver_ip_addresses: list[str] + :ivar replicas: Replica count for DNS proxy service. Default value is 1. + :vartype replicas: int + :ivar prefer_k8_s_dns_for_ptr_lookups: Flag indicating whether to prefer Kubernetes DNS server + response over AD DNS server response for IP address lookups. + :vartype prefer_k8_s_dns_for_ptr_lookups: bool + """ + + domainName: str + """DNS domain name for which DNS lookups should be forwarded to the Active Directory DNS servers.""" + nameserverIPAddresses: Required[list[str]] + """List of Active Directory DNS server IP addresses. Required.""" + replicas: int + """Replica count for DNS proxy service. Default value is 1.""" + preferK8sDnsForPtrLookups: bool + """Flag indicating whether to prefer Kubernetes DNS server response over AD DNS server response + for IP address lookups.""" + + +class ActiveDirectoryConnectorDomainDetails(TypedDict, total=False): + """Active Directory domain details. + + :ivar realm: Name (uppercase) of the Active Directory domain that this AD connector will be + associated with. Required. + :vartype realm: str + :ivar netbios_domain_name: NETBIOS name of the Active Directory domain. + :vartype netbios_domain_name: str + :ivar service_account_provisioning: The service account provisioning mode for this Active + Directory connector. Known values are: "automatic" and "manual". + :vartype service_account_provisioning: Union[str, "AccountProvisioningMode"] + :ivar ou_distinguished_name: The distinguished name of the Active Directory Organizational + Unit. + :vartype ou_distinguished_name: str + :ivar domain_controllers: null. + :vartype domain_controllers: "ActiveDirectoryDomainControllers" + """ + + realm: Required[str] + """Name (uppercase) of the Active Directory domain that this AD connector will be associated with. + Required.""" + netbiosDomainName: str + """NETBIOS name of the Active Directory domain.""" + serviceAccountProvisioning: Union[str, "AccountProvisioningMode"] + """The service account provisioning mode for this Active Directory connector. Known values are: + \"automatic\" and \"manual\".""" + ouDistinguishedName: str + """The distinguished name of the Active Directory Organizational Unit.""" + domainControllers: "ActiveDirectoryDomainControllers" + """null.""" + + +class ActiveDirectoryConnectorProperties(TypedDict, total=False): + """The properties of an Active Directory connector resource. + + :ivar domain_service_account_login_information: Username and password for domain service + account authentication. + :vartype domain_service_account_login_information: "BasicLoginInformation" + :ivar provisioning_state: The provisioning state of the Active Directory connector resource. + :vartype provisioning_state: str + :ivar spec: null. Required. + :vartype spec: "ActiveDirectoryConnectorSpec" + :ivar status: null. + :vartype status: "ActiveDirectoryConnectorStatus" + """ + + domainServiceAccountLoginInformation: "BasicLoginInformation" + """Username and password for domain service account authentication.""" + provisioningState: str + """The provisioning state of the Active Directory connector resource.""" + spec: Required["ActiveDirectoryConnectorSpec"] + """null. Required.""" + status: "ActiveDirectoryConnectorStatus" + """null.""" + + +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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + +class ActiveDirectoryConnectorResource(ProxyResource): + """Active directory connector 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: "SystemData" + :ivar properties: null. Required. + :vartype properties: "ActiveDirectoryConnectorProperties" + """ + + properties: Required["ActiveDirectoryConnectorProperties"] + """null. Required.""" + + +class ActiveDirectoryConnectorSpec(TypedDict, total=False): + """The specifications of the AD Kubernetes resource. + + :ivar active_directory: null. Required. + :vartype active_directory: "ActiveDirectoryConnectorDomainDetails" + :ivar dns: null. Required. + :vartype dns: "ActiveDirectoryConnectorDNSDetails" + """ + + activeDirectory: Required["ActiveDirectoryConnectorDomainDetails"] + """null. Required.""" + dns: Required["ActiveDirectoryConnectorDNSDetails"] + """null. Required.""" + + +class ActiveDirectoryConnectorStatus(TypedDict, total=False): + """The status of the Kubernetes custom resource. + + :ivar last_update_time: The time that the custom resource was last updated. + :vartype last_update_time: str + :ivar observed_generation: The version of the replicaSet associated with the AD connector + custom resource. + :vartype observed_generation: int + :ivar state: The state of the AD connector custom resource. + :vartype state: str + """ + + lastUpdateTime: str + """The time that the custom resource was last updated.""" + observedGeneration: int + """The version of the replicaSet associated with the AD connector custom resource.""" + state: str + """The state of the AD connector custom resource.""" + + +class ActiveDirectoryDomainController(TypedDict, total=False): + """Information about a domain controller in the AD domain. + + :ivar hostname: Fully-qualified domain name of a domain controller in the AD domain. Required. + :vartype hostname: str + """ + + hostname: Required[str] + """Fully-qualified domain name of a domain controller in the AD domain. Required.""" + + +class ActiveDirectoryDomainControllers(TypedDict, total=False): + """Details about the Active Directory domain controllers associated with this AD connector + instance. + + :ivar primary_domain_controller: Information about the Primary Domain Controller (PDC) in the + AD domain. + :vartype primary_domain_controller: "ActiveDirectoryDomainController" + :ivar secondary_domain_controllers: null. + :vartype secondary_domain_controllers: list["ActiveDirectoryDomainController"] + """ + + primaryDomainController: "ActiveDirectoryDomainController" + """Information about the Primary Domain Controller (PDC) in the AD domain.""" + secondaryDomainControllers: list["ActiveDirectoryDomainController"] + """null.""" + + +class ActiveDirectoryInformation(TypedDict, total=False): + """Active Directory information that related to the resource. + + :ivar keytab_information: Keytab information that is used for the Sql Managed Instance when + Active Directory authentication is used. + :vartype keytab_information: "KeytabInformation" + """ + + keytabInformation: "KeytabInformation" + """Keytab information that is used for the Sql Managed Instance when Active Directory + authentication is used.""" + + +class AdditionalMigrationJobAttributes(TypedDict, total=False): + """Any other migration type specific attributes to associate with this job. + + :ivar key_name: Unique attribute name. + :vartype key_name: str + :ivar key_value: Attribute value. + :vartype key_value: str + """ + + keyName: str + """Unique attribute name.""" + keyValue: str + """Attribute value.""" + + +class Authentication(TypedDict, total=False): + """Authentication related configuration for the SQL Server Instance. + + :ivar mode: Mode of authentication in SqlServer. Known values are: "Mixed", "Windows", and + "Undefined". + :vartype mode: Union[str, "Mode"] + :ivar sql_server_entra_identity: Entra Authentication configuration for the SQL Server + Instance. + :vartype sql_server_entra_identity: list["EntraAuthentication"] + """ + + mode: Union[str, "Mode"] + """Mode of authentication in SqlServer. Known values are: \"Mixed\", \"Windows\", and + \"Undefined\".""" + sqlServerEntraIdentity: list["EntraAuthentication"] + """Entra Authentication configuration for the SQL Server Instance.""" + + +class AvailabilityGroupConfigure(TypedDict, total=False): + """The specifications of the availability group replica configuration. + + :ivar endpoint_name: Name of the mirroring endpoint URL. + :vartype endpoint_name: str + :ivar endpoint_url: Mirroring endpoint URL of availability group replica. + :vartype endpoint_url: str + :ivar endpoint_authentication_mode: Permitted authentication modes for the mirroring endpoint. + Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", "Certificate", + "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", "Windows_Negotiate_Certificate", + "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", and + "Certificate_Windows_Negotiate". + :vartype endpoint_authentication_mode: Union[str, "ConnectionAuth"] + :ivar certificate_name: Name of certificate to use for authentication. Required if any + CERTIFICATE authentication modes are specified. + :vartype certificate_name: str + :ivar endpoint_connect_login: The login which will connect to the mirroring endpoint. + :vartype endpoint_connect_login: str + :ivar availability_mode: Property that determines whether a given availability replica can run + in synchronous-commit mode. Known values are: "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: Union[str, "ArcSqlServerAvailabilityMode"] + :ivar availability_mode_description: The Availability Synchronization mode of the availability + group replica. + :vartype availability_mode_description: str + :ivar failover_mode: Property to set the failover mode of the availability group replica. Known + values are: "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: Union[str, "ArcSqlServerFailoverMode"] + :ivar failover_mode_description: The failover mode of the availability group replica. + :vartype failover_mode_description: str + :ivar session_timeout: The time-out period of availability group session replica, in seconds. + :vartype session_timeout: int + :ivar primary_allow_connections: Whether the primary replica should allow all connections or + only READ_WRITE connections (disallowing ReadOnly connections). Known values are: "ALL" and + "READ_WRITE". + :vartype primary_allow_connections: Union[str, "PrimaryAllowConnections"] + :ivar primary_role_allow_connections_description: Whether the availability allows all + connections or only read-write connections. + :vartype primary_role_allow_connections_description: str + :ivar secondary_allow_connections: Whether the secondary replica should allow all connections, + no connections, or only ReadOnly connections. Known values are: "NO", "ALL", and "READ_ONLY". + :vartype secondary_allow_connections: Union[str, "SecondaryAllowConnections"] + :ivar secondary_role_allow_connections_description: Whether an availability replica that is + performing the secondary role (that is, a secondary replica) can accept connections from + clients. + :vartype secondary_role_allow_connections_description: str + :ivar replica_create_date: Date that the replica was created. + :vartype replica_create_date: str + :ivar replica_modify_date: Date that the replica was modified. + :vartype replica_modify_date: str + :ivar backup_priority: Represents the user-specified priority for performing backups on this + replica relative to the other replicas in the same availability group. + :vartype backup_priority: int + :ivar read_only_routing_url: Connectivity endpoint (URL) of the read only availability replica. + :vartype read_only_routing_url: str + :ivar read_write_routing_url: Connectivity endpoint (URL) of the read write availability + replica. + :vartype read_write_routing_url: str + :ivar seeding_mode: Specifies how the secondary replica will be initially seeded. AUTOMATIC + enables direct seeding. This method will seed the secondary replica over the network. This + method does not require you to backup and restore a copy of the primary database on the + replica. MANUAL specifies manual seeding (default). This method requires you to create a backup + of the database on the primary replica and manually restore that backup on the secondary + replica. Known values are: "AUTOMATIC" and "MANUAL". + :vartype seeding_mode: Union[str, "SeedingMode"] + :ivar seeding_mode_description: Describes seeding mode. + :vartype seeding_mode_description: str + """ + + endpointName: str + """Name of the mirroring endpoint URL.""" + endpointUrl: str + """Mirroring endpoint URL of availability group replica.""" + endpointAuthenticationMode: Union[str, "ConnectionAuth"] + """Permitted authentication modes for the mirroring endpoint. Known values are: \"Windows_NTLM\", + \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", \"Windows_NTLM_Certificate\", + \"Windows_Kerberos_Certificate\", \"Windows_Negotiate_Certificate\", + \"Certificate_Windows_NTLM\", \"Certificate_Windows_Kerberos\", and + \"Certificate_Windows_Negotiate\".""" + certificateName: str + """Name of certificate to use for authentication. Required if any CERTIFICATE authentication modes + are specified.""" + endpointConnectLogin: str + """The login which will connect to the mirroring endpoint.""" + availabilityMode: Union[str, "ArcSqlServerAvailabilityMode"] + """Property that determines whether a given availability replica can run in synchronous-commit + mode. Known values are: \"SYNCHRONOUS_COMMIT\" and \"ASYNCHRONOUS_COMMIT\".""" + availabilityModeDescription: str + """The Availability Synchronization mode of the availability group replica.""" + failoverMode: Union[str, "ArcSqlServerFailoverMode"] + """Property to set the failover mode of the availability group replica. Known values are: + \"AUTOMATIC\", \"MANUAL\", \"EXTERNAL\", and \"NONE\".""" + failoverModeDescription: str + """The failover mode of the availability group replica.""" + sessionTimeout: int + """The time-out period of availability group session replica, in seconds.""" + primaryAllowConnections: Union[str, "PrimaryAllowConnections"] + """Whether the primary replica should allow all connections or only READ_WRITE connections + (disallowing ReadOnly connections). Known values are: \"ALL\" and \"READ_WRITE\".""" + primaryRoleAllowConnectionsDescription: str + """Whether the availability allows all connections or only read-write connections.""" + secondaryAllowConnections: Union[str, "SecondaryAllowConnections"] + """Whether the secondary replica should allow all connections, no connections, or only ReadOnly + connections. Known values are: \"NO\", \"ALL\", and \"READ_ONLY\".""" + secondaryRoleAllowConnectionsDescription: str + """Whether an availability replica that is performing the secondary role (that is, a secondary + replica) can accept connections from clients.""" + replicaCreateDate: str + """Date that the replica was created.""" + replicaModifyDate: str + """Date that the replica was modified.""" + backupPriority: int + """Represents the user-specified priority for performing backups on this replica relative to the + other replicas in the same availability group.""" + readOnlyRoutingUrl: str + """Connectivity endpoint (URL) of the read only availability replica.""" + readWriteRoutingUrl: str + """Connectivity endpoint (URL) of the read write availability replica.""" + seedingMode: Union[str, "SeedingMode"] + """Specifies how the secondary replica will be initially seeded. AUTOMATIC enables direct seeding. + This method will seed the secondary replica over the network. This method does not require you + to backup and restore a copy of the primary database on the replica. MANUAL specifies manual + seeding (default). This method requires you to create a backup of the database on the primary + replica and manually restore that backup on the secondary replica. Known values are: + \"AUTOMATIC\" and \"MANUAL\".""" + seedingModeDescription: str + """Describes seeding mode.""" + + +class AvailabilityGroupCreateUpdateConfiguration(TypedDict, total=False): # pylint: disable=name-too-long + """Options used in creating an availability group. + + :ivar availability_group_name: Name of the availability group. + :vartype availability_group_name: str + :ivar replicas: List of availability group replicas. + :vartype replicas: list["AvailabilityGroupCreateUpdateReplicaConfiguration"] + :ivar databases: List of databases to include in the availability group. + :vartype databases: list[str] + :ivar automated_backup_preference: Preferred replica for running automated backups. Known + values are: "PRIMARY", "SECONDARY_ONLY", "SECONDARY", and "NONE". + :vartype automated_backup_preference: Union[str, "AutomatedBackupPreference"] + :ivar failure_condition_level: User-defined failure condition level under which an automatic + failover must be triggered. Known values are: 1, 2, 3, 4, and 5. + :vartype failure_condition_level: Union[int, "FailureConditionLevel"] + :ivar health_check_timeout: Wait time (in milliseconds) for the sp_server_diagnostics system + stored procedure to return server-health information, before the server instance is assumed to + be slow or not responding. + :vartype health_check_timeout: int + :ivar db_failover: Specifies whether the availability group supports failover for database + health conditions. Known values are: "ON" and "OFF". + :vartype db_failover: Union[str, "DbFailover"] + :ivar dtc_support: Specifies whether DTC support has been enabled for this availability group. + Known values are: "PER_DB" and "NONE". + :vartype dtc_support: Union[str, "DtcSupport"] + :ivar required_synchronized_secondaries_to_commit: The number of secondary replicas that must + be in a synchronized state for a commit to complete. + :vartype required_synchronized_secondaries_to_commit: int + :ivar cluster_type: Set to WSFC when availability group is on a failover cluster instance on a + Windows Server failover cluster. Set to NONE when availability group not using WSFC for cluster + coordination. Known values are: "WSFC" and "NONE". + :vartype cluster_type: Union[str, "ClusterType"] + :ivar listener: The listener for the sql server availability group. + :vartype listener: "SqlAvailabilityGroupStaticIPListenerProperties" + """ + + availabilityGroupName: str + """Name of the availability group.""" + replicas: list["AvailabilityGroupCreateUpdateReplicaConfiguration"] + """List of availability group replicas.""" + databases: list[str] + """List of databases to include in the availability group.""" + automatedBackupPreference: Union[str, "AutomatedBackupPreference"] + """Preferred replica for running automated backups. Known values are: \"PRIMARY\", + \"SECONDARY_ONLY\", \"SECONDARY\", and \"NONE\".""" + failureConditionLevel: Union[int, "FailureConditionLevel"] + """User-defined failure condition level under which an automatic failover must be triggered. Known + values are: 1, 2, 3, 4, and 5.""" + healthCheckTimeout: int + """Wait time (in milliseconds) for the sp_server_diagnostics system stored procedure to return + server-health information, before the server instance is assumed to be slow or not responding.""" + dbFailover: Union[str, "DbFailover"] + """Specifies whether the availability group supports failover for database health conditions. + Known values are: \"ON\" and \"OFF\".""" + dtcSupport: Union[str, "DtcSupport"] + """Specifies whether DTC support has been enabled for this availability group. Known values are: + \"PER_DB\" and \"NONE\".""" + requiredSynchronizedSecondariesToCommit: int + """The number of secondary replicas that must be in a synchronized state for a commit to complete.""" + clusterType: Union[str, "ClusterType"] + """Set to WSFC when availability group is on a failover cluster instance on a Windows Server + failover cluster. Set to NONE when availability group not using WSFC for cluster coordination. + Known values are: \"WSFC\" and \"NONE\".""" + listener: "SqlAvailabilityGroupStaticIPListenerProperties" + """The listener for the sql server availability group.""" + + +class AvailabilityGroupCreateUpdateReplicaConfiguration(TypedDict, total=False): # pylint: disable=name-too-long + """The specifications of the availability group replica configuration. + + :ivar server_instance: the server instance hosting the replica. + :vartype server_instance: str + :ivar endpoint_name: Name of the database mirroring endpoint URL for the availability group + replica. + :vartype endpoint_name: str + :ivar endpoint_url: Database mirroring endpoint URL of availability group replica. + :vartype endpoint_url: str + :ivar endpoint_authentication_mode: Permitted authentication modes for the mirroring endpoint. + Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", "Certificate", + "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", "Windows_Negotiate_Certificate", + "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", and + "Certificate_Windows_Negotiate". + :vartype endpoint_authentication_mode: Union[str, "ConnectionAuth"] + :ivar certificate_name: Name of certificate to use for authentication. Required if any + CERTIFICATE authentication modes are specified. + :vartype certificate_name: str + :ivar endpoint_connect_login: The login which will connect to the mirroring endpoint. + :vartype endpoint_connect_login: str + :ivar availability_mode: Property that determines whether a given availability replica can run + in synchronous-commit mode. Known values are: "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: Union[str, "ArcSqlServerAvailabilityMode"] + :ivar failover_mode: Property to set the failover mode of the availability group replica. Known + values are: "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: Union[str, "ArcSqlServerFailoverMode"] + :ivar seeding_mode: Specifies how the secondary replica will be initially seeded. AUTOMATIC + enables direct seeding. This method will seed the secondary replica over the network. This + method does not require you to backup and restore a copy of the primary database on the + replica. MANUAL specifies manual seeding (default). This method requires you to create a backup + of the database on the primary replica and manually restore that backup on the secondary + replica. Known values are: "AUTOMATIC" and "MANUAL". + :vartype seeding_mode: Union[str, "SeedingMode"] + :ivar backup_priority: Represents the user-specified priority for performing backups on this + replica relative to the other replicas in the same availability group. + :vartype backup_priority: int + :ivar secondary_role_allow_connections: Whether the secondary replica should allow all + connections, no connections, or only ReadOnly connections. Known values are: "NO", "ALL", and + "READ_ONLY". + :vartype secondary_role_allow_connections: Union[str, "SecondaryAllowConnections"] + :ivar secondary_role_read_only_routing_url: Connectivity endpoint (URL) of the read only + availability replica. + :vartype secondary_role_read_only_routing_url: str + :ivar primary_role_allow_connections: Whether the primary replica should allow all connections + or only READ_WRITE connections (disallowing ReadOnly connections). Known values are: "ALL" and + "READ_WRITE". + :vartype primary_role_allow_connections: Union[str, "PrimaryAllowConnections"] + :ivar primary_role_read_only_routing_list: List of read only routing URLs. + :vartype primary_role_read_only_routing_list: list[str] + :ivar session_timeout: The time-out period of availability group session replica, in seconds. + :vartype session_timeout: int + """ + + serverInstance: str + """the server instance hosting the replica.""" + endpointName: str + """Name of the database mirroring endpoint URL for the availability group replica.""" + endpointUrl: str + """Database mirroring endpoint URL of availability group replica.""" + endpointAuthenticationMode: Union[str, "ConnectionAuth"] + """Permitted authentication modes for the mirroring endpoint. Known values are: \"Windows_NTLM\", + \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", \"Windows_NTLM_Certificate\", + \"Windows_Kerberos_Certificate\", \"Windows_Negotiate_Certificate\", + \"Certificate_Windows_NTLM\", \"Certificate_Windows_Kerberos\", and + \"Certificate_Windows_Negotiate\".""" + certificateName: str + """Name of certificate to use for authentication. Required if any CERTIFICATE authentication modes + are specified.""" + endpointConnectLogin: str + """The login which will connect to the mirroring endpoint.""" + availabilityMode: Union[str, "ArcSqlServerAvailabilityMode"] + """Property that determines whether a given availability replica can run in synchronous-commit + mode. Known values are: \"SYNCHRONOUS_COMMIT\" and \"ASYNCHRONOUS_COMMIT\".""" + failoverMode: Union[str, "ArcSqlServerFailoverMode"] + """Property to set the failover mode of the availability group replica. Known values are: + \"AUTOMATIC\", \"MANUAL\", \"EXTERNAL\", and \"NONE\".""" + seedingMode: Union[str, "SeedingMode"] + """Specifies how the secondary replica will be initially seeded. AUTOMATIC enables direct seeding. + This method will seed the secondary replica over the network. This method does not require you + to backup and restore a copy of the primary database on the replica. MANUAL specifies manual + seeding (default). This method requires you to create a backup of the database on the primary + replica and manually restore that backup on the secondary replica. Known values are: + \"AUTOMATIC\" and \"MANUAL\".""" + backupPriority: int + """Represents the user-specified priority for performing backups on this replica relative to the + other replicas in the same availability group.""" + secondaryRoleAllowConnections: Union[str, "SecondaryAllowConnections"] + """Whether the secondary replica should allow all connections, no connections, or only ReadOnly + connections. Known values are: \"NO\", \"ALL\", and \"READ_ONLY\".""" + secondaryRoleReadOnlyRoutingUrl: str + """Connectivity endpoint (URL) of the read only availability replica.""" + primaryRoleAllowConnections: Union[str, "PrimaryAllowConnections"] + """Whether the primary replica should allow all connections or only READ_WRITE connections + (disallowing ReadOnly connections). Known values are: \"ALL\" and \"READ_WRITE\".""" + primaryRoleReadOnlyRoutingList: list[str] + """List of read only routing URLs.""" + sessionTimeout: int + """The time-out period of availability group session replica, in seconds.""" + + +class AvailabilityGroupInfo(TypedDict, total=False): + """The specifications of the availability group state. + + :ivar failure_condition_level: User-defined failure condition level under which an automatic + failover must be triggered. + :vartype failure_condition_level: int + :ivar health_check_timeout: Wait time (in milliseconds) for the sp_server_diagnostics system + stored procedure to return server-health information, before the server instance is assumed to + be slow or not responding. + :vartype health_check_timeout: int + :ivar automated_backup_preference_description: Preferred location for performing backups on the + availability databases in this availability group. + :vartype automated_backup_preference_description: str + :ivar version: SQL Server availability group current version. + :vartype version: int + :ivar basic_features: Specifies whether this is a basic availability group. + :vartype basic_features: bool + :ivar dtc_support: Specifies whether DTC support has been enabled for this availability group. + :vartype dtc_support: bool + :ivar db_failover: Specifies whether the availability group supports failover for database + health conditions. + :vartype db_failover: bool + :ivar is_distributed: Specifies whether this is a distributed availability group. + :vartype is_distributed: bool + :ivar cluster_type_description: SQL Server availability group cluster type description. + :vartype cluster_type_description: str + :ivar required_synchronized_secondaries_to_commit: The number of secondary replicas that must + be in a synchronized state for a commit to complete. + :vartype required_synchronized_secondaries_to_commit: int + :ivar is_contained: SQL Server availability group contained system databases. + :vartype is_contained: bool + :ivar primary_replica: Name of the server instance that is hosting the current primary replica. + :vartype primary_replica: str + :ivar primary_recovery_health_description: Indicates the recovery health of the primary + replica. + :vartype primary_recovery_health_description: str + :ivar secondary_recovery_health_description: Indicates the recovery health of a secondary + replica. + :vartype secondary_recovery_health_description: str + :ivar synchronization_health_description: Reflects a roll-up of the synchronization health of + all availability replicas in the availability group. + :vartype synchronization_health_description: str + :ivar replication_partner_type: Known values are: "SQLServer", "AzureSQLVM", + "AzureSQLManagedInstance", and "Unknown". + :vartype replication_partner_type: Union[str, "ReplicationPartnerType"] + :ivar listener: The listener for the sql server availability group. + :vartype listener: "SqlAvailabilityGroupStaticIPListenerProperties" + """ + + failureConditionLevel: int + """User-defined failure condition level under which an automatic failover must be triggered.""" + healthCheckTimeout: int + """Wait time (in milliseconds) for the sp_server_diagnostics system stored procedure to return + server-health information, before the server instance is assumed to be slow or not responding.""" + automatedBackupPreferenceDescription: str + """Preferred location for performing backups on the availability databases in this availability + group.""" + version: int + """SQL Server availability group current version.""" + basicFeatures: bool + """Specifies whether this is a basic availability group.""" + dtcSupport: bool + """Specifies whether DTC support has been enabled for this availability group.""" + dbFailover: bool + """Specifies whether the availability group supports failover for database health conditions.""" + isDistributed: bool + """Specifies whether this is a distributed availability group.""" + clusterTypeDescription: str + """SQL Server availability group cluster type description.""" + requiredSynchronizedSecondariesToCommit: int + """The number of secondary replicas that must be in a synchronized state for a commit to complete.""" + isContained: bool + """SQL Server availability group contained system databases.""" + primaryReplica: str + """Name of the server instance that is hosting the current primary replica.""" + primaryRecoveryHealthDescription: str + """Indicates the recovery health of the primary replica.""" + secondaryRecoveryHealthDescription: str + """Indicates the recovery health of a secondary replica.""" + synchronizationHealthDescription: str + """Reflects a roll-up of the synchronization health of all availability replicas in the + availability group.""" + replicationPartnerType: Union[str, "ReplicationPartnerType"] + """Known values are: \"SQLServer\", \"AzureSQLVM\", \"AzureSQLManagedInstance\", and \"Unknown\".""" + listener: "SqlAvailabilityGroupStaticIPListenerProperties" + """The listener for the sql server availability group.""" + + +class AvailabilityGroupRetrievalFilters(TypedDict, total=False): + """AvailabilityGroupRetrievalFilters. + + :ivar availability_group_type_filter: Filter retrieval based on availability group type. Known + values are: "CONTAINED", "DISTRIBUTED", and "DEFAULT". + :vartype availability_group_type_filter: Union[str, "ArcSqlServerAvailabilityGroupTypeFilter"] + :ivar replication_partner_type_filter: Known values are: "SQLServer", "AzureSQLVM", + "AzureSQLManagedInstance", and "Unknown". + :vartype replication_partner_type_filter: Union[str, "ReplicationPartnerType"] + """ + + availabilityGroupTypeFilter: Union[str, "ArcSqlServerAvailabilityGroupTypeFilter"] + """Filter retrieval based on availability group type. Known values are: \"CONTAINED\", + \"DISTRIBUTED\", and \"DEFAULT\".""" + replicationPartnerTypeFilter: Union[str, "ReplicationPartnerType"] + """Known values are: \"SQLServer\", \"AzureSQLVM\", \"AzureSQLManagedInstance\", and \"Unknown\".""" + + +class AvailabilityGroupState(TypedDict, total=False): + """The specifications of the availability group state. + + :ivar availability_group_replica_role: Current Always On availability groups role of the + availability group replica. + :vartype availability_group_replica_role: str + :ivar operational_state_description: Current operational state of the availability group + replica. + :vartype operational_state_description: str + :ivar recovery_health_description: Recovery health of the availability group replica. + :vartype recovery_health_description: str + :ivar synchronization_health_description: Reflects a rollup of the database synchronization + state (synchronization_state) of all joined availability databases (also known as replicas) and + the availability mode of the replica (synchronous-commit or asynchronous-commit mode). The + rollup will reflect the least healthy accumulated state the databases on the replica. + :vartype synchronization_health_description: str + :ivar connected_state_description: Whether a secondary replica is currently connected to the + primary replica. + :vartype connected_state_description: str + :ivar last_connect_error_description: Text description of the last connection error of the + availability group replica. + :vartype last_connect_error_description: str + :ivar last_connect_error_timestamp: Date and time timestamp indicating when the last connect + error occurred. + :vartype last_connect_error_timestamp: str + """ + + availabilityGroupReplicaRole: str + """Current Always On availability groups role of the availability group replica.""" + operationalStateDescription: str + """Current operational state of the availability group replica.""" + recoveryHealthDescription: str + """Recovery health of the availability group replica.""" + synchronizationHealthDescription: str + """Reflects a rollup of the database synchronization state (synchronization_state) of all joined + availability databases (also known as replicas) and the availability mode of the replica + (synchronous-commit or asynchronous-commit mode). The rollup will reflect the least healthy + accumulated state the databases on the replica.""" + connectedStateDescription: str + """Whether a secondary replica is currently connected to the primary replica.""" + lastConnectErrorDescription: str + """Text description of the last connection error of the availability group replica.""" + lastConnectErrorTimestamp: str + """Date and time timestamp indicating when the last connect error occurred.""" + + +class BackgroundJob(TypedDict, total=False): + """The background job details. + + :ivar state: The state of the background job. Known values are: "Inactive", "Active", + "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", and "Suspended". + :vartype state: Union[str, "State"] + :ivar execution_state: The execution state of the background job. Known values are: "Waiting" + and "Running". + :vartype execution_state: Union[str, "ExecutionState"] + :ivar start_time: The start time of the background job. + :vartype start_time: str + :ivar end_time: The end time of the background job. + :vartype end_time: str + :ivar last_execution_status: The last execution status of the background job. Known values are: + "Succeeded", "Completed", "Failed", "Faulted", "Postponed", and "Rescheduled". + :vartype last_execution_status: Union[str, "LastExecutionStatus"] + :ivar last_execution_time: The last execution time of the background job in ISO 8601 date-time + format. + :vartype last_execution_time: str + :ivar next_execution_time: The next execution time of the background job in ISO 8601 date-time + format. + :vartype next_execution_time: str + """ + + state: Union[str, "State"] + """The state of the background job. Known values are: \"Inactive\", \"Active\", \"Terminated\", + \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and \"Suspended\".""" + executionState: Union[str, "ExecutionState"] + """The execution state of the background job. Known values are: \"Waiting\" and \"Running\".""" + startTime: str + """The start time of the background job.""" + endTime: str + """The end time of the background job.""" + lastExecutionStatus: Union[str, "LastExecutionStatus"] + """The last execution status of the background job. Known values are: \"Succeeded\", + \"Completed\", \"Failed\", \"Faulted\", \"Postponed\", and \"Rescheduled\".""" + lastExecutionTime: str + """The last execution time of the background job in ISO 8601 date-time format.""" + nextExecutionTime: str + """The next execution time of the background job in ISO 8601 date-time format.""" + + +class BackupPolicy(TypedDict, total=False): + """The backup profile for the SQL server. + + :ivar retention_period_days: The retention period for all the databases in this managed + instance. + :vartype retention_period_days: int + :ivar full_backup_days: The value indicating days between full backups. + :vartype full_backup_days: int + :ivar differential_backup_hours: The differential backup interval in hours. Known values are: + 12 and 24. + :vartype differential_backup_hours: Union[int, "DifferentialBackupHours"] + :ivar transaction_log_backup_minutes: The value indicating minutes between transaction log + backups. + :vartype transaction_log_backup_minutes: int + """ + + retentionPeriodDays: int + """The retention period for all the databases in this managed instance.""" + fullBackupDays: int + """The value indicating days between full backups.""" + differentialBackupHours: Union[int, "DifferentialBackupHours"] + """The differential backup interval in hours. Known values are: 12 and 24.""" + transactionLogBackupMinutes: int + """The value indicating minutes between transaction log backups.""" + + +class BasicLoginInformation(TypedDict, total=False): + """Username and password for basic login authentication. + + :ivar username: Login username. + :vartype username: str + :ivar password: Login password. + :vartype password: str + """ + + username: str + """Login username.""" + password: str + """Login password.""" + + +class BestPracticesAssessment(TypedDict, total=False): + """The configuration related to SQL best practices assessment. + + :ivar enabled: Indicates if SQL best practices assessment is enabled for the SQL Server + instance. + :vartype enabled: bool + :ivar schedule: The scheduling configuration. + :vartype schedule: "Schedule" + """ + + enabled: bool + """Indicates if SQL best practices assessment is enabled for the SQL Server instance.""" + schedule: "Schedule" + """The scheduling configuration.""" + + +class ClientConnection(TypedDict, total=False): + """Client connection related configuration. + + :ivar enabled: Indicates if client connection is enabled for this SQL Server instance. + :vartype enabled: bool + """ + + enabled: bool + """Indicates if client connection is enabled for this SQL Server instance.""" + + +class CommonSku(TypedDict, total=False): + """The resource model definition representing SKU for ARM resources. + + :ivar name: The name of the SKU. It is typically a letter+number code. Required. + :vartype name: str + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: Required[str] + """The name of the SKU. It is typically a letter+number code. Required.""" + dev: bool + """Whether dev/test is enabled. When the dev field is set to true, the resource is used for + dev/test purpose.""" + size: str + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: str + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: int + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + +class CostOptionSelectedValues(TypedDict, total=False): + """Cost option value for the different cost factors selected. + + :ivar compute_and_storage_cost_option: selected cost saving option e.g. With1YearASPAndDevTest. + :vartype compute_and_storage_cost_option: str + :ivar sql_license_cost_option: With Azure Hybrid Benefit(AHB) or not for SQL. + :vartype sql_license_cost_option: str + :ivar windows_license_cost_option: With Azure Hybrid Benefit(AHB) or not for Windows. + :vartype windows_license_cost_option: str + """ + + computeAndStorageCostOption: str + """selected cost saving option e.g. With1YearASPAndDevTest.""" + sqlLicenseCostOption: str + """With Azure Hybrid Benefit(AHB) or not for SQL.""" + windowsLicenseCostOption: str + """With Azure Hybrid Benefit(AHB) or not for Windows.""" + + +class CostTypeValues(TypedDict, total=False): + """The Monthly cost of the particular SKU. + + :ivar compute_cost: Represents the Cost of Compute. + :vartype compute_cost: float + :ivar storage_cost: Represents the Cost of Storage. + :vartype storage_cost: float + :ivar iops_cost: Represents the Cost of IOPS. + :vartype iops_cost: float + """ + + computeCost: float + """Represents the Cost of Compute.""" + storageCost: float + """Represents the Cost of Storage.""" + iopsCost: float + """Represents the Cost of IOPS.""" + + +class CronTrigger(TypedDict, total=False): + """The cron trigger configuration. + + :ivar start_time: Indicates the start time for the trigger. The default value is the time at + which the trigger was created. + :vartype start_time: str + :ivar time_zone: The time zone in which the trigger is scheduled. + :vartype time_zone: str + :ivar expression: A cron string representing a CronTab expression. A crontab expression is a + very compact way to express a recurring schedule with the following format: '{minutes} {hours} + {days} {months} {days-of-week}'. + :vartype expression: str + """ + + startTime: str + """Indicates the start time for the trigger. The default value is the time at which the trigger + was created.""" + timeZone: str + """The time zone in which the trigger is scheduled.""" + expression: str + """A cron string representing a CronTab expression. A crontab expression is a very compact way to + express a recurring schedule with the following format: '{minutes} {hours} {days} {months} + {days-of-week}'.""" + + +class DatabaseAssessmentsItem(TypedDict, total=False): + """DatabaseAssessmentsItem. + + :ivar applies_to_migration_target_platform: + :vartype applies_to_migration_target_platform: str + :ivar feature_id: + :vartype feature_id: str + :ivar issue_category: + :vartype issue_category: str + :ivar more_information: + :vartype more_information: str + """ + + appliesToMigrationTargetPlatform: str + featureId: str + issueCategory: str + moreInformation: str + + +class DataBaseMigration(TypedDict, total=False): + """Migration related configuration. + + :ivar assessment: Migration assessments related configuration. + :vartype assessment: "DataBaseMigrationAssessment" + :ivar jobs: Migration jobs/actual data movement/data migrations associated with this database + related information. + :vartype jobs: list["DatabaseMigrationJobsItem"] + """ + + assessment: "DataBaseMigrationAssessment" + """Migration assessments related configuration.""" + jobs: list["DatabaseMigrationJobsItem"] + """Migration jobs/actual data movement/data migrations associated with this database related + information.""" + + +class DataBaseMigrationAssessment(TypedDict, total=False): + """The migration assessment related configuration. + + :ivar assessment_upload_time: The time when Migration Assessment Report upload was last + performed. + :vartype assessment_upload_time: str + :ivar target_recommendation_generation_time: The UTC timestamp in ISO 8601 format indicating + when the latest target recommendations were generated for this database. This value is set as + part of a successful RunTargetRecommendation job and is independent of when the migration + readiness results were uploaded (assessmentUploadTime). + :vartype target_recommendation_generation_time: str + :ivar database_assessments: Issues and warnings impacting the migration of Database to + particular Azure Migration Target. + :vartype database_assessments: list["DatabaseAssessmentsItem"] + :ivar target_readiness: The target readiness for migration for this database. + :vartype target_readiness: "TargetReadiness" + """ + + assessmentUploadTime: str + """The time when Migration Assessment Report upload was last performed.""" + targetRecommendationGenerationTime: str + """The UTC timestamp in ISO 8601 format indicating when the latest target recommendations were + generated for this database. This value is set as part of a successful RunTargetRecommendation + job and is independent of when the migration readiness results were uploaded + (assessmentUploadTime).""" + databaseAssessments: list["DatabaseAssessmentsItem"] + """Issues and warnings impacting the migration of Database to particular Azure Migration Target.""" + targetReadiness: "TargetReadiness" + """The target readiness for migration for this database.""" + + +class DatabaseMigrationJobsItem(TypedDict, total=False): + """DatabaseMigrationJobsItem. + + :ivar migration_tracking_id: Reference identifier for tracking purposes/optional link to system + initiating this migration. e.g. Arc MI link job id, DMS resource id. + :vartype migration_tracking_id: str + :ivar migration_mode: Mode/type of migration. Known values are: "LogShipping", "MILink", + "Logical", "Other", and "Unknown". + :vartype migration_mode: Union[str, "MigrationMode"] + :ivar initiated_from: To indicate the client from which the migration is initiated from e.g. + Azure Arc, DMS-Azure Portal/PS/CLI for additional tracking. Known values are: "Azure Arc", + "ADS", "SSMS", "SSMA", "DMS-Portal", "DMS-PS", "DMS-CLI", "DMS-SDK", and "Other". + :vartype initiated_from: Union[str, "InitiatedFrom"] + :ivar status: Status of the migration job. Known values are: "NotStarted", "InProgress", + "InProgressWithWarnings", "Cancelled", "Failed", "Successful", and "Unknown". + :vartype status: Union[str, "MigrationStatus"] + :ivar last_error: Last error if any associated with this migration job. + :vartype last_error: str + :ivar target_type: Type of target in Azure this database is being migrated to. Known values + are: "AzureSqlDatabase", "AzureSqlManagedInstance", and "AzureSqlVirtualMachine". + :vartype target_type: Union[str, "TargetType"] + :ivar target_resource_id: Resource Id of the target SQL resource for this migration job. + :vartype target_resource_id: str + :ivar start_time: Time when migration job was started. + :vartype start_time: str + :ivar end_time: Time when migration job reached terminal state. + :vartype end_time: str + :ivar additional_attributes: + :vartype additional_attributes: list["AdditionalMigrationJobAttributes"] + """ + + migrationTrackingId: str + """Reference identifier for tracking purposes/optional link to system initiating this migration. + e.g. Arc MI link job id, DMS resource id.""" + migrationMode: Union[str, "MigrationMode"] + """Mode/type of migration. Known values are: \"LogShipping\", \"MILink\", \"Logical\", \"Other\", + and \"Unknown\".""" + initiatedFrom: Union[str, "InitiatedFrom"] + """To indicate the client from which the migration is initiated from e.g. Azure Arc, DMS-Azure + Portal/PS/CLI for additional tracking. Known values are: \"Azure Arc\", \"ADS\", \"SSMS\", + \"SSMA\", \"DMS-Portal\", \"DMS-PS\", \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + status: Union[str, "MigrationStatus"] + """Status of the migration job. Known values are: \"NotStarted\", \"InProgress\", + \"InProgressWithWarnings\", \"Cancelled\", \"Failed\", \"Successful\", and \"Unknown\".""" + lastError: str + """Last error if any associated with this migration job.""" + targetType: Union[str, "TargetType"] + """Type of target in Azure this database is being migrated to. Known values are: + \"AzureSqlDatabase\", \"AzureSqlManagedInstance\", and \"AzureSqlVirtualMachine\".""" + targetResourceId: str + """Resource Id of the target SQL resource for this migration job.""" + startTime: str + """Time when migration job was started.""" + endTime: str + """Time when migration job reached terminal state.""" + additionalAttributes: list["AdditionalMigrationJobAttributes"] + + +class Databases(TypedDict, total=False): + """List of database names. + + :ivar values_property: List of database names. + :vartype values_property: list[str] + """ + + values: list[str] + """List of database names.""" + + +class DataControllerProperties(TypedDict, total=False): + """The data controller properties. + + :ivar infrastructure: The infrastructure the data controller is running on. Known values are: + "azure", "gcp", "aws", "alibaba", "onpremises", and "other". + :vartype infrastructure: Union[str, "Infrastructure"] + :ivar on_premise_property: Properties from the Kubernetes data controller. + :vartype on_premise_property: "OnPremiseProperty" + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: Any + :ivar upload_watermark: Properties on upload watermark. Mostly timestamp for each upload data + type. + :vartype upload_watermark: "UploadWatermark" + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: str + :ivar basic_login_information: Deprecated. Azure Arc Data Services data controller no longer + expose any endpoint. All traffic are exposed through Kubernetes native API. + :vartype basic_login_information: "BasicLoginInformation" + :ivar metrics_dashboard_credential: Login credential for metrics dashboard on the Kubernetes + cluster. + :vartype metrics_dashboard_credential: "BasicLoginInformation" + :ivar logs_dashboard_credential: Login credential for logs dashboard on the Kubernetes cluster. + :vartype logs_dashboard_credential: "BasicLoginInformation" + :ivar log_analytics_workspace_config: Log analytics workspace id and primary key. + :vartype log_analytics_workspace_config: "LogAnalyticsWorkspaceConfig" + :ivar upload_service_principal: Deprecated. Service principal is deprecated in favor of Arc + Kubernetes service extension managed identity. + :vartype upload_service_principal: "UploadServicePrincipal" + :ivar provisioning_state: The provisioning state of the Arc Data Controller resource. + :vartype provisioning_state: str + :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :vartype cluster_id: str + :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :vartype extension_id: str + """ + + infrastructure: Union[str, "Infrastructure"] + """The infrastructure the data controller is running on. Known values are: \"azure\", \"gcp\", + \"aws\", \"alibaba\", \"onpremises\", and \"other\".""" + onPremiseProperty: "OnPremiseProperty" + """Properties from the Kubernetes data controller.""" + k8sRaw: Any + """The raw kubernetes information.""" + uploadWatermark: "UploadWatermark" + """Properties on upload watermark. Mostly timestamp for each upload data type.""" + lastUploadedDate: str + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + basicLoginInformation: "BasicLoginInformation" + """Deprecated. Azure Arc Data Services data controller no longer expose any endpoint. All traffic + are exposed through Kubernetes native API.""" + metricsDashboardCredential: "BasicLoginInformation" + """Login credential for metrics dashboard on the Kubernetes cluster.""" + logsDashboardCredential: "BasicLoginInformation" + """Login credential for logs dashboard on the Kubernetes cluster.""" + logAnalyticsWorkspaceConfig: "LogAnalyticsWorkspaceConfig" + """Log analytics workspace id and primary key.""" + uploadServicePrincipal: "UploadServicePrincipal" + """Deprecated. Service principal is deprecated in favor of Arc Kubernetes service extension + managed identity.""" + provisioningState: str + """The provisioning state of the Arc Data Controller resource.""" + clusterId: str + """If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom + location belongs to.""" + extensionId: str + """If a CustomLocation is provided, this contains the ARM id of the extension the custom location + belongs to.""" + + +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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "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 DataControllerResource(TrackedResource): + """Data controller 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: "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 data controller's properties. Required. + :vartype properties: "DataControllerProperties" + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: "ExtendedLocation" + """ + + properties: Required["DataControllerProperties"] + """The data controller's properties. Required.""" + extendedLocation: "ExtendedLocation" + """The extendedLocation of the resource.""" + + +class DataControllerUpdate(TypedDict, total=False): + """Used for updating a data controller resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The data controller's properties. + :vartype properties: "DataControllerProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "DataControllerProperties" + """The data controller's properties.""" + + +class DBMEndpoint(TypedDict, total=False): + """Database mirroring endpoint related properties. + + :ivar endpoint_name: Name of the database mirroring endpoint. + :vartype endpoint_name: str + :ivar role: Mirroring Role. Known values are: "NONE", "PARTNER", "WITNESS", and "ALL". + :vartype role: Union[str, "Role"] + :ivar is_encryption_enabled: Is Encryption enabled. + :vartype is_encryption_enabled: bool + :ivar encryption_algorithm: Encryption Algorithm. Known values are: "NONE", "RC4", "AES", + "NONE, RC4", "NONE, AES", "RC4, AES", "AES, RC4", "NONE, RC4, AES", and "NONE, AES, RC4". + :vartype encryption_algorithm: Union[str, "EncryptionAlgorithm"] + :ivar connection_auth: The type of connection authentication required for connections to this + endpoint. Known values are: "Windows_NTLM", "Windows_Kerberos", "Windows_Negotiate", + "Certificate", "Windows_NTLM_Certificate", "Windows_Kerberos_Certificate", + "Windows_Negotiate_Certificate", "Certificate_Windows_NTLM", "Certificate_Windows_Kerberos", + and "Certificate_Windows_Negotiate". + :vartype connection_auth: Union[str, "ConnectionAuth"] + :ivar port: The port number that the endpoint is listening on. + :vartype port: int + :ivar is_dynamic_port: Is the port number dynamically assigned. + :vartype is_dynamic_port: bool + :ivar ip_address: Listener IP address. + :vartype ip_address: str + :ivar certificate_name: Name of the certificate. + :vartype certificate_name: str + :ivar certificate_expiry_date: The certificate expiry date. + :vartype certificate_expiry_date: str + """ + + endpointName: str + """Name of the database mirroring endpoint.""" + role: Union[str, "Role"] + """Mirroring Role. Known values are: \"NONE\", \"PARTNER\", \"WITNESS\", and \"ALL\".""" + isEncryptionEnabled: bool + """Is Encryption enabled.""" + encryptionAlgorithm: Union[str, "EncryptionAlgorithm"] + """Encryption Algorithm. Known values are: \"NONE\", \"RC4\", \"AES\", \"NONE, RC4\", \"NONE, + AES\", \"RC4, AES\", \"AES, RC4\", \"NONE, RC4, AES\", and \"NONE, AES, RC4\".""" + connectionAuth: Union[str, "ConnectionAuth"] + """The type of connection authentication required for connections to this endpoint. Known values + are: \"Windows_NTLM\", \"Windows_Kerberos\", \"Windows_Negotiate\", \"Certificate\", + \"Windows_NTLM_Certificate\", \"Windows_Kerberos_Certificate\", + \"Windows_Negotiate_Certificate\", \"Certificate_Windows_NTLM\", + \"Certificate_Windows_Kerberos\", and \"Certificate_Windows_Negotiate\".""" + port: int + """The port number that the endpoint is listening on.""" + isDynamicPort: bool + """Is the port number dynamically assigned.""" + ipAddress: str + """Listener IP address.""" + certificateName: str + """Name of the certificate.""" + certificateExpiryDate: str + """The certificate expiry date.""" + + +class DiskSizes(TypedDict, total=False): + """disk size values. + + :ivar disk_type: Type of managed disk. + :vartype disk_type: str + :ivar redundancy: Redundancy option. + :vartype redundancy: str + :ivar size: Size of the managed disk - e.g. P30, P40. + :vartype size: str + :ivar caching: Caching configuration - e.g. read only caching. + :vartype caching: str + :ivar max_size_in_gib: maximum disk size in GiB. + :vartype max_size_in_gib: float + :ivar max_throughput_in_mbps: maximum throughput in MB/s. + :vartype max_throughput_in_mbps: float + :ivar max_iops: maximum IO requirements/s (IOPS). + :vartype max_iops: float + """ + + diskType: str + """Type of managed disk.""" + redundancy: str + """Redundancy option.""" + size: str + """Size of the managed disk - e.g. P30, P40.""" + caching: str + """Caching configuration - e.g. read only caching.""" + maxSizeInGib: float + """maximum disk size in GiB.""" + maxThroughputInMbps: float + """maximum throughput in MB/s.""" + maxIops: float + """maximum IO requirements/s (IOPS).""" + + +class DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration( + TypedDict, total=False +): # pylint: disable=name-too-long + """The availability group certificate configuration. + + :ivar certificate_name: Name of the certificate. + :vartype certificate_name: str + """ + + certificateName: str + """Name of the certificate.""" + + +class DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration( + TypedDict, total=False +): # pylint: disable=name-too-long + """The availability group configuration specification for a distributed availability group. + + :ivar availability_group: The azure resource identifier for the availability group. + :vartype availability_group: str + :ivar listener_url: The listener URL of the availability group. + :vartype listener_url: str + :ivar availability_mode: The availability mode of the availability group. Known values are: + "SYNCHRONOUS_COMMIT" and "ASYNCHRONOUS_COMMIT". + :vartype availability_mode: Union[str, "ArcSqlServerAvailabilityMode"] + :ivar failover_mode: The failover mode of the availability group. Known values are: + "AUTOMATIC", "MANUAL", "EXTERNAL", and "NONE". + :vartype failover_mode: Union[str, "ArcSqlServerFailoverMode"] + :ivar seeding_mode: The seeding mode of the availability group. Known values are: "AUTOMATIC" + and "MANUAL". + :vartype seeding_mode: Union[str, "SeedingMode"] + :ivar certificate_configuration: The certificate configuration for the availability group. + :vartype certificate_configuration: + "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration" + """ + + availabilityGroup: str + """The azure resource identifier for the availability group.""" + listenerUrl: str + """The listener URL of the availability group.""" + availabilityMode: Union[str, "ArcSqlServerAvailabilityMode"] + """The availability mode of the availability group. Known values are: \"SYNCHRONOUS_COMMIT\" and + \"ASYNCHRONOUS_COMMIT\".""" + failoverMode: Union[str, "ArcSqlServerFailoverMode"] + """The failover mode of the availability group. Known values are: \"AUTOMATIC\", \"MANUAL\", + \"EXTERNAL\", and \"NONE\".""" + seedingMode: Union[str, "SeedingMode"] + """The seeding mode of the availability group. Known values are: \"AUTOMATIC\" and \"MANUAL\".""" + certificateConfiguration: "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupCertificateConfiguration" + """The certificate configuration for the availability group.""" + + +class DistributedAvailabilityGroupCreateUpdateConfiguration(TypedDict, total=False): # pylint: disable=name-too-long + """Options used in creating a distributed availability group. + + :ivar availability_group_name: Name of the availability group. + :vartype availability_group_name: str + :ivar primary_availability_group: The initial primary availability group for the distributed + availability group. + :vartype primary_availability_group: + "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + :ivar secondary_availability_group: The initial secondary availability group for the + distributed availability group. + :vartype secondary_availability_group: + "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + """ + + availabilityGroupName: str + """Name of the availability group.""" + primaryAvailabilityGroup: "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + """The initial primary availability group for the distributed availability group.""" + secondaryAvailabilityGroup: "DistributedAvailabilityGroupCreateUpdateAvailabilityGroupConfiguration" + """The initial secondary availability group for the distributed availability group.""" + + +class EntraAuthentication(TypedDict, total=False): + """Entra Authentication configuration. + + :ivar identity_type: The method used for Entra authentication. Known values are: + "SystemAssignedManagedIdentity" and "UserAssignedManagedIdentity". + :vartype identity_type: Union[str, "IdentityType"] + :ivar client_id: The client Id of the Managed Identity to query Microsoft Graph API. An empty + string must be used for the system assigned Managed Identity. + :vartype client_id: str + """ + + identityType: Union[str, "IdentityType"] + """The method used for Entra authentication. Known values are: \"SystemAssignedManagedIdentity\" + and \"UserAssignedManagedIdentity\".""" + clientId: str + """The client Id of the Managed Identity to query Microsoft Graph API. An empty string must be + used for the system assigned Managed Identity.""" + + +class ErrorAdditionalInfo(TypedDict, total=False): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: Any + """ + + type: str + """The additional info type.""" + info: Any + """The additional info.""" + + +class ErrorDetail(TypedDict, total=False): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list["ErrorDetail"] + :ivar additional_info: The error additional info. + :vartype additional_info: list["ErrorAdditionalInfo"] + """ + + code: str + """The error code.""" + message: str + """The error message.""" + target: str + """The error target.""" + details: list["ErrorDetail"] + """The error details.""" + additionalInfo: list["ErrorAdditionalInfo"] + """The error additional info.""" + + +class ErrorResponse(TypedDict, total=False): + """Error response. + + :ivar error: The error object. + :vartype error: "ErrorDetail" + """ + + error: "ErrorDetail" + """The error object.""" + + +class ExtendedLocation(TypedDict, total=False): + """The complex type of the extended location. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. "CustomLocation" + :vartype type: Union[str, "ExtendedLocationTypes"] + """ + + name: str + """The name of the extended location.""" + type: Union[str, "ExtendedLocationTypes"] + """The type of the extended location. \"CustomLocation\"""" + + +class FailoverCluster(TypedDict, total=False): + """Failover Cluster Instance properties. + + :ivar id: The GUID of the SQL Server's underlying Failover Cluster. + :vartype id: str + :ivar network_name: The network name to connect to the SQL FCI. + :vartype network_name: str + :ivar sql_instance_ids: The ARM IDs of the Arc SQL Server resources, belonging to the current + server's Failover cluster. + :vartype sql_instance_ids: list[str] + :ivar host_names: The host names which are part of the SQL FCI resource group. + :vartype host_names: list[str] + :ivar host_ip_addresses: The IP addresses and subnet masks associated with the SQL Failover + Cluster Instance on this host. + :vartype host_ip_addresses: list["HostIPAddressInformation"] + """ + + id: str + """The GUID of the SQL Server's underlying Failover Cluster.""" + networkName: str + """The network name to connect to the SQL FCI.""" + sqlInstanceIds: list[str] + """The ARM IDs of the Arc SQL Server resources, belonging to the current server's Failover + cluster.""" + hostNames: list[str] + """The host names which are part of the SQL FCI resource group.""" + hostIPAddresses: list["HostIPAddressInformation"] + """The IP addresses and subnet masks associated with the SQL Failover Cluster Instance on this + host.""" + + +class FailoverGroupProperties(TypedDict, total=False): + """The properties of a failover group resource. + + :ivar provisioning_state: The provisioning state of the failover group resource. Known values + are: "Succeeded", "Failed", "Canceled", and "Accepted". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar partner_managed_instance_id: The resource ID of the partner SQL managed instance. + Required. + :vartype partner_managed_instance_id: str + :ivar spec: The specifications of the failover group resource. Required. + :vartype spec: "FailoverGroupSpec" + :ivar status: The status of the failover group custom resource. + :vartype status: Any + """ + + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of the failover group resource. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", and \"Accepted\".""" + partnerManagedInstanceId: Required[str] + """The resource ID of the partner SQL managed instance. Required.""" + spec: Required["FailoverGroupSpec"] + """The specifications of the failover group resource. Required.""" + status: Any + """The status of the failover group custom resource.""" + + +class FailoverGroupResource(ProxyResource): + """A failover group 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: "SystemData" + :ivar properties: null. Required. + :vartype properties: "FailoverGroupProperties" + """ + + properties: Required["FailoverGroupProperties"] + """null. Required.""" + + +class FailoverGroupSpec(TypedDict, total=False): + """The specifications of the failover group resource. + + :ivar shared_name: The shared name of the failover group for this SQL managed instance. Both + SQL managed instance and its partner have to use the same shared name. + :vartype shared_name: str + :ivar source_mi: The name of the SQL managed instance with this failover group role. + :vartype source_mi: str + :ivar partner_mi: The name of the partner SQL managed instance. + :vartype partner_mi: str + :ivar partner_mirroring_url: The mirroring endpoint URL of the partner SQL managed instance. + :vartype partner_mirroring_url: str + :ivar partner_mirroring_cert: The mirroring endpoint public certificate for the partner SQL + managed instance. Only PEM format is supported. + :vartype partner_mirroring_cert: str + :ivar partner_sync_mode: The partner sync mode of the SQL managed instance. Known values are: + "async" and "sync". + :vartype partner_sync_mode: Union[str, "FailoverGroupPartnerSyncMode"] + :ivar role: The role of the SQL managed instance in this failover group. Required. Known values + are: "primary", "secondary", "force-primary-allow-data-loss", and "force-secondary". + :vartype role: Union[str, "InstanceFailoverGroupRole"] + """ + + sharedName: str + """The shared name of the failover group for this SQL managed instance. Both SQL managed instance + and its partner have to use the same shared name.""" + sourceMI: str + """The name of the SQL managed instance with this failover group role.""" + partnerMI: str + """The name of the partner SQL managed instance.""" + partnerMirroringURL: str + """The mirroring endpoint URL of the partner SQL managed instance.""" + partnerMirroringCert: str + """The mirroring endpoint public certificate for the partner SQL managed instance. Only PEM format + is supported.""" + partnerSyncMode: Union[str, "FailoverGroupPartnerSyncMode"] + """The partner sync mode of the SQL managed instance. Known values are: \"async\" and \"sync\".""" + role: Required[Union[str, "InstanceFailoverGroupRole"]] + """The role of the SQL managed instance in this failover group. Required. Known values are: + \"primary\", \"secondary\", \"force-primary-allow-data-loss\", and \"force-secondary\".""" + + +class FailoverMiLinkResourceId(TypedDict, total=False): + """The azure resource identifier for the Sql Managed Instance. + + :ivar managed_instance_id: Azure resource id for the sql managed instance. + :vartype managed_instance_id: str + :ivar force: Whether to perform a Force Failover as opposed to just a regular Failover. + :vartype force: bool + """ + + managedInstanceId: str + """Azure resource id for the sql managed instance.""" + force: bool + """Whether to perform a Force Failover as opposed to just a regular Failover.""" + + +class HostIPAddressInformation(TypedDict, total=False): + """IP address and subnet mask. + + :ivar ip_address: IP address. + :vartype ip_address: str + :ivar subnet_mask: Subnet mask. + :vartype subnet_mask: str + """ + + ipAddress: str + """IP address.""" + subnetMask: str + """Subnet mask.""" + + +class ImpactedObjectsInfo(TypedDict, total=False): + """summary information about the incompatible feature id, number of objects impacted and category + of issue (warning/error). + + :ivar feature_id: Represents the feature id from + `https://learn.microsoft.com/en-us/data-migration/sql-server/database/assessment-rules?view=azuresql + `_. + OR + `https://learn.microsoft.com/en-us/data-migration/sql-server/managed-instance/assessment-rules?view=azuresql + `_. + :vartype feature_id: str + :ivar number_impacted: Represents the number of issues/warnings. + :vartype number_impacted: int + :ivar issue_category: Issue or Warning. + :vartype issue_category: str + """ + + featureId: str + """Represents the feature id from + `https://learn.microsoft.com/en-us/data-migration/sql-server/database/assessment-rules?view=azuresql + `_. + OR + `https://learn.microsoft.com/en-us/data-migration/sql-server/managed-instance/assessment-rules?view=azuresql + `_.""" + numberImpacted: int + """Represents the number of issues/warnings.""" + issueCategory: str + """Issue or Warning.""" + + +class ImpactedObjectsSuitabilitySummary(TypedDict, total=False): + """Represents a summary of migration readiness issues/warnings per feature type for Azure SQL DB + and SQL MI targets. + + :ivar azure_sql_database: + :vartype azure_sql_database: list["ImpactedObjectsInfo"] + :ivar azure_sql_managed_instance: + :vartype azure_sql_managed_instance: list["ImpactedObjectsInfo"] + """ + + azureSqlDatabase: list["ImpactedObjectsInfo"] + azureSqlManagedInstance: list["ImpactedObjectsInfo"] + + +class K8SActiveDirectory(TypedDict, total=False): + """The kubernetes active directory information. + + :ivar connector: + :vartype connector: "K8SActiveDirectoryConnector" + :ivar account_name: Account name for AAD. + :vartype account_name: str + :ivar keytab_secret: Keytab secret used to authenticate with Active Directory. + :vartype keytab_secret: str + :ivar encryption_types: An array of encryption types. + :vartype encryption_types: list[str] + """ + + connector: "K8SActiveDirectoryConnector" + accountName: str + """Account name for AAD.""" + keytabSecret: str + """Keytab secret used to authenticate with Active Directory.""" + encryptionTypes: list[str] + """An array of encryption types.""" + + +class K8SActiveDirectoryConnector(TypedDict, total=False): + """K8SActiveDirectoryConnector. + + :ivar name: Name of the connector. + :vartype name: str + :ivar namespace: Name space of the connector. + :vartype namespace: str + """ + + name: str + """Name of the connector.""" + namespace: str + """Name space of the connector.""" + + +class K8SNetworkSettings(TypedDict, total=False): + """The kubernetes network settings information. + + :ivar forceencryption: If 1, then SQL Server forces all connections to be encrypted. By + default, this option is 0. + :vartype forceencryption: int + :ivar tlsciphers: Specifies which ciphers are allowed by SQL Server for TLS. + :vartype tlsciphers: str + :ivar tlsprotocols: A comma-separated list of which TLS protocols are allowed by SQL Server. + :vartype tlsprotocols: str + """ + + forceencryption: int + """If 1, then SQL Server forces all connections to be encrypted. By default, this option is 0.""" + tlsciphers: str + """Specifies which ciphers are allowed by SQL Server for TLS.""" + tlsprotocols: str + """A comma-separated list of which TLS protocols are allowed by SQL Server.""" + + +class K8SResourceRequirements(TypedDict, total=False): + """The kubernetes resource limits and requests used to restrict or reserve resource usage. + + :ivar requests: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' + request must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default + 'memory' is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and + maximum 'memory' is '128Gi'. + :vartype requests: dict[str, str] + :ivar limits: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request + must be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' + is '4Gi', minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum + 'memory' is '128Gi'. + :vartype limits: dict[str, str] + """ + + requests: dict[str, str] + """Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less + than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', + minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is + '128Gi'.""" + limits: dict[str, str] + """Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less + than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', + minimum is '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is + '128Gi'.""" + + +class K8SScheduling(TypedDict, total=False): + """The kubernetes scheduling information. + + :ivar default: The kubernetes scheduling options. It describes restrictions used to help + Kubernetes select appropriate nodes to host the database service. + :vartype default: "K8SSchedulingOptions" + """ + + default: "K8SSchedulingOptions" + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select + appropriate nodes to host the database service.""" + + +class K8SSchedulingOptions(TypedDict, total=False): + """The kubernetes scheduling options. It describes restrictions used to help Kubernetes select + appropriate nodes to host the database service. + + :ivar resources: The kubernetes resource limits and requests used to restrict or reserve + resource usage. + :vartype resources: "K8SResourceRequirements" + """ + + resources: "K8SResourceRequirements" + """The kubernetes resource limits and requests used to restrict or reserve resource usage.""" + + +class K8SSecurity(TypedDict, total=False): + """The kubernetes security information. + + :ivar admin_login_secret: Admin login secret key. + :vartype admin_login_secret: str + :ivar service_certificate_secret: Service certificate secret used. + :vartype service_certificate_secret: str + :ivar active_directory: The kubernetes active directory information. + :vartype active_directory: "K8SActiveDirectory" + :ivar transparent_data_encryption: Transparent data encryption information. + :vartype transparent_data_encryption: "K8StransparentDataEncryption" + """ + + adminLoginSecret: str + """Admin login secret key.""" + serviceCertificateSecret: str + """Service certificate secret used.""" + activeDirectory: "K8SActiveDirectory" + """The kubernetes active directory information.""" + transparentDataEncryption: "K8StransparentDataEncryption" + """Transparent data encryption information.""" + + +class K8SSettings(TypedDict, total=False): + """The kubernetes settings information. + + :ivar network: The kubernetes network settings information. + :vartype network: "K8SNetworkSettings" + """ + + network: "K8SNetworkSettings" + """The kubernetes network settings information.""" + + +class K8StransparentDataEncryption(TypedDict, total=False): + """Transparent data encryption information. + + :ivar mode: Transparent data encryption mode. Can be Service Managed, Customer managed or + disabled. + :vartype mode: str + :ivar protector_secret: Protector secret for customer managed Transparent data encryption mode. + :vartype protector_secret: str + """ + + mode: str + """Transparent data encryption mode. Can be Service Managed, Customer managed or disabled.""" + protectorSecret: str + """Protector secret for customer managed Transparent data encryption mode.""" + + +class KeytabInformation(TypedDict, total=False): + """Keytab used for authenticate with Active Directory. + + :ivar keytab: A base64-encoded keytab. + :vartype keytab: str + """ + + keytab: str + """A base64-encoded keytab.""" + + +class LogAnalyticsWorkspaceConfig(TypedDict, total=False): + """Log analytics workspace id and primary key. + + :ivar workspace_id: Azure Log Analytics workspace ID. + :vartype workspace_id: str + :ivar primary_key: Primary key of the workspace. + :vartype primary_key: str + """ + + workspaceId: str + """Azure Log Analytics workspace ID.""" + primaryKey: str + """Primary key of the workspace.""" + + +class ManagedInstanceLinkCreateUpdateConfiguration(TypedDict, total=False): # pylint: disable=name-too-long + """The configuration for the new Managed Instance Link resource. + + :ivar availability_group: The configuration for the SQL Server availability group resource. + :vartype availability_group: "AvailabilityGroupCreateUpdateConfiguration" + :ivar distributed_availability_group: The distributed availability group configuration for the + MI link. + :vartype distributed_availability_group: + "DistributedAvailabilityGroupCreateUpdateConfiguration" + :ivar mi_link_configuration: The MI Link specific distributed availability group configuration. + :vartype mi_link_configuration: "MiLinkCreateUpdateConfiguration" + """ + + availabilityGroup: "AvailabilityGroupCreateUpdateConfiguration" + """The configuration for the SQL Server availability group resource.""" + distributedAvailabilityGroup: "DistributedAvailabilityGroupCreateUpdateConfiguration" + """The distributed availability group configuration for the MI link.""" + miLinkConfiguration: "MiLinkCreateUpdateConfiguration" + """The MI Link specific distributed availability group configuration.""" + + +class Migration(TypedDict, total=False): + """Migration related configuration. + + :ivar assessment: Migration assessments related configuration. + :vartype assessment: "MigrationAssessment" + :ivar target_selected_time: The last time when the target resource was selected for migration. + :vartype target_selected_time: str + :ivar target_resource_id: Resource Id of the created or selected target SQL resource for + migration. + :vartype target_resource_id: str + """ + + assessment: "MigrationAssessment" + """Migration assessments related configuration.""" + targetSelectedTime: str + """The last time when the target resource was selected for migration.""" + targetResourceId: str + """Resource Id of the created or selected target SQL resource for migration.""" + + +class MigrationAssessment(TypedDict, total=False): + """The migration assessment related configuration. + + :ivar enabled: Indicates if migration assessment is enabled for this SQL Server instance. + :vartype enabled: bool + :ivar assessment_upload_time: The time when Migration Assessment Report upload was last + performed. + :vartype assessment_upload_time: str + :ivar assessment_viewed_time: The time when this migration assessment was last viewed. + :vartype assessment_viewed_time: str + :ivar target_recommendation_generation_time: The UTC timestamp in ISO 8601 format indicating + when the latest target recommendations were generated for this SQL Server instance. This value + is set as part of a successful RunTargetRecommendation job and is independent of when the + migration readiness results were uploaded (assessmentUploadTime). + :vartype target_recommendation_generation_time: str + :ivar version: version of this migration assessment report - to be passed by the migration + assessment engine. + :vartype version: str + :ivar settings: Settings impacting the migration assessment computation - configurable with + some default values if not set. + :vartype settings: "MigrationAssessmentSettings" + :ivar server_assessments: Issues and warnings impacting the migration of SQL Server instance to + particular Azure Migration Target. + :vartype server_assessments: list["ServerAssessmentsItem"] + :ivar sku_recommendation_results: SKU Recommendation results for Azure migration targets for + SQL Server. + :vartype sku_recommendation_results: "SkuRecommendationResults" + :ivar impacted_objects_summary: Represents a summary of migration readiness issues/warnings per + feature type for Azure SQL DB and SQL MI targets. + :vartype impacted_objects_summary: "ImpactedObjectsSuitabilitySummary" + """ + + enabled: bool + """Indicates if migration assessment is enabled for this SQL Server instance.""" + assessmentUploadTime: str + """The time when Migration Assessment Report upload was last performed.""" + assessmentViewedTime: str + """The time when this migration assessment was last viewed.""" + targetRecommendationGenerationTime: str + """The UTC timestamp in ISO 8601 format indicating when the latest target recommendations were + generated for this SQL Server instance. This value is set as part of a successful + RunTargetRecommendation job and is independent of when the migration readiness results were + uploaded (assessmentUploadTime).""" + version: str + """version of this migration assessment report - to be passed by the migration assessment engine.""" + settings: "MigrationAssessmentSettings" + """Settings impacting the migration assessment computation - configurable with some default values + if not set.""" + serverAssessments: list["ServerAssessmentsItem"] + """Issues and warnings impacting the migration of SQL Server instance to particular Azure + Migration Target.""" + skuRecommendationResults: "SkuRecommendationResults" + """SKU Recommendation results for Azure migration targets for SQL Server.""" + impactedObjectsSummary: "ImpactedObjectsSuitabilitySummary" + """Represents a summary of migration readiness issues/warnings per feature type for Azure SQL DB + and SQL MI targets.""" + + +class MigrationAssessmentSettings(TypedDict, total=False): + """Settings impacting the migration assessment computation - configurable with some default values + if not set. + + :ivar target_location: The target location for Azure SQL SKU for migration. Default is West US. + :vartype target_location: str + :ivar percentile: Indicate the percentile value for the performance sample. Default is 95th + percentile. + :vartype percentile: float + :ivar lookback_period_in_days: How far back to check the performance data - Default is 30 + (days). + :vartype lookback_period_in_days: int + :ivar comfort_factor: Buffer (percentage) to consider while SKU sizing to account for issues + such as seasonal usage, short performance history, and likely increases in future usage - This + buffer is applied on top of the performance metrics. Default is 100 (percent). + :vartype comfort_factor: int + :ivar strategy: Minimize cost or Migrate to PaaS. - to evaluate based on the recommended + strategy. Default is Migrate to PaaS. + :vartype strategy: str + :ivar currency: currency to calculate prices - Default is USD. + :vartype currency: str + :ivar discount_percentage: flat discount percentage to apply for the price - Default is 0. + :vartype discount_percentage: float + :ivar cost_options: Selected cost option value. + :vartype cost_options: "CostOptionSelectedValues" + """ + + targetLocation: str + """The target location for Azure SQL SKU for migration. Default is West US.""" + percentile: float + """Indicate the percentile value for the performance sample. Default is 95th percentile.""" + lookbackPeriodInDays: int + """How far back to check the performance data - Default is 30 (days).""" + comfortFactor: int + """Buffer (percentage) to consider while SKU sizing to account for issues such as seasonal usage, + short performance history, and likely increases in future usage - This buffer is applied on top + of the performance metrics. Default is 100 (percent).""" + strategy: str + """Minimize cost or Migrate to PaaS. - to evaluate based on the recommended strategy. Default is + Migrate to PaaS.""" + currency: str + """currency to calculate prices - Default is USD.""" + discountPercentage: float + """flat discount percentage to apply for the price - Default is 0.""" + costOptions: "CostOptionSelectedValues" + """Selected cost option value.""" + + +class MiLinkCreateUpdateConfiguration(TypedDict, total=False): + """The MI Link specific configuration. + + :ivar instance_availability_group_name: The name of the availability group to be created on the + Managed Instance. + :vartype instance_availability_group_name: str + """ + + instanceAvailabilityGroupName: str + """The name of the availability group to be created on the Managed Instance.""" + + +class Monitoring(TypedDict, total=False): + """The monitoring configuration. + + :ivar enabled: Indicates if monitoring is enabled for this SQL Server instance. + :vartype enabled: bool + """ + + enabled: bool + """Indicates if monitoring is enabled for this SQL Server instance.""" + + +class OnPremiseProperty(TypedDict, total=False): + """Properties from the Kubernetes data controller. + + :ivar id: A globally unique ID identifying the associated Kubernetes cluster. Required. + :vartype id: str + :ivar public_signing_key: Certificate that contains the Kubernetes cluster public key used to + verify signing. Required. + :vartype public_signing_key: str + :ivar signing_certificate_thumbprint: Unique thumbprint returned to customer to verify the + certificate being uploaded. + :vartype signing_certificate_thumbprint: str + """ + + id: Required[str] + """A globally unique ID identifying the associated Kubernetes cluster. Required.""" + publicSigningKey: Required[str] + """Certificate that contains the Kubernetes cluster public key used to verify signing. Required.""" + signingCertificateThumbprint: str + """Unique thumbprint returned to customer to verify the certificate being uploaded.""" + + +class Operation(TypedDict, total=False): + """Azure Data Services on Azure Arc operation definition. + + :ivar name: The name of the operation being performed on this particular object. Required. + :vartype name: str + :ivar display: The localized display information for this particular operation / action. + Required. + :vartype display: "OperationDisplay" + :ivar origin: The intended executor of the operation. Known values are: "user" and "system". + :vartype origin: Union[str, "OperationOrigin"] + :ivar is_data_action: Indicates whether the operation is a data action. Required. + :vartype is_data_action: bool + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, Any] + """ + + name: Required[str] + """The name of the operation being performed on this particular object. Required.""" + display: Required["OperationDisplay"] + """The localized display information for this particular operation / action. Required.""" + origin: Union[str, "OperationOrigin"] + """The intended executor of the operation. Known values are: \"user\" and \"system\".""" + isDataAction: Required[bool] + """Indicates whether the operation is a data action. Required.""" + properties: dict[str, Any] + """Additional descriptions for the operation.""" + + +class OperationDisplay(TypedDict, total=False): + """Display metadata associated with the operation. + + :ivar provider: The localized friendly form of the resource provider name. Required. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related to this + action/operation. Required. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. Required. + :vartype operation: str + :ivar description: The localized friendly description for the operation. Required. + :vartype description: str + """ + + provider: Required[str] + """The localized friendly form of the resource provider name. Required.""" + resource: Required[str] + """The localized friendly form of the resource type related to this action/operation. Required.""" + operation: Required[str] + """The localized friendly name for the operation. Required.""" + description: Required[str] + """The localized friendly description for the operation. Required.""" + + +class PostgresInstance(TrackedResource): + """A Postgres Instance. + + :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: "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: null. Required. + :vartype properties: "PostgresInstanceProperties" + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: "ExtendedLocation" + :ivar sku: Resource sku. + :vartype sku: "PostgresInstanceSku" + """ + + properties: Required["PostgresInstanceProperties"] + """null. Required.""" + extendedLocation: "ExtendedLocation" + """The extendedLocation of the resource.""" + sku: "PostgresInstanceSku" + """Resource sku.""" + + +class PostgresInstanceProperties(TypedDict, total=False): + """Postgres Instance properties. + + :ivar data_controller_id: The data controller id. + :vartype data_controller_id: str + :ivar admin: The instance admin. + :vartype admin: str + :ivar basic_login_information: Username and password for basic authentication. + :vartype basic_login_information: "BasicLoginInformation" + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: Any + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: str + :ivar provisioning_state: The provisioning state of the Azure Arc-enabled PostgreSQL instance. + :vartype provisioning_state: str + """ + + dataControllerId: str + """The data controller id.""" + admin: str + """The instance admin.""" + basicLoginInformation: "BasicLoginInformation" + """Username and password for basic authentication.""" + k8sRaw: Any + """The raw kubernetes information.""" + lastUploadedDate: str + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + provisioningState: str + """The provisioning state of the Azure Arc-enabled PostgreSQL instance.""" + + +class PostgresInstanceSku(CommonSku): + """The resource model definition representing SKU for Azure Database for PostgresSQL - Azure Arc. + + :ivar name: The name of the SKU. It is typically a letter+number code. Required. + :vartype name: str + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier. Default value is "Hyperscale". + :vartype tier: Literal["Hyperscale"] + """ + + tier: Literal["Hyperscale"] + """This field is required to be implemented by the Resource Provider if the service has more than + one tier. Default value is \"Hyperscale\".""" + + +class PostgresInstanceUpdate(TypedDict, total=False): + """An update to a Postgres Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Postgres Instance properties. + :vartype properties: "PostgresInstanceProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "PostgresInstanceProperties" + """Postgres Instance properties.""" + + +class Schedule(TypedDict, total=False): + """The scheduling configuration. + + :ivar enabled: Indicates whether scheduling is enabled. + :vartype enabled: bool + :ivar cron_trigger: The cron trigger configuration. + :vartype cron_trigger: "CronTrigger" + """ + + enabled: bool + """Indicates whether scheduling is enabled.""" + cronTrigger: "CronTrigger" + """The cron trigger configuration.""" + + +class SequencerAction(TypedDict, total=False): + """The sequencer action details. + + :ivar action_id: The unique identifier of the sequencer action. + :vartype action_id: str + :ivar state: The state of the sequencer action. Known values are: "NotStarted", + "WaitingPredecessors", "ExecutingAction", "CreatingSuccessors", and "Completed". + :vartype state: Union[str, "SequencerState"] + :ivar result: The result of the sequencer action. Known values are: "NotCompleted", + "Succeeded", "Failed", "TimedOut", and "Skipped". + :vartype result: Union[str, "Result"] + """ + + actionId: str + """The unique identifier of the sequencer action.""" + state: Union[str, "SequencerState"] + """The state of the sequencer action. Known values are: \"NotStarted\", \"WaitingPredecessors\", + \"ExecutingAction\", \"CreatingSuccessors\", and \"Completed\".""" + result: Union[str, "Result"] + """The result of the sequencer action. Known values are: \"NotCompleted\", \"Succeeded\", + \"Failed\", \"TimedOut\", and \"Skipped\".""" + + +class ServerAssessmentsItem(TypedDict, total=False): + """ServerAssessmentsItem. + + :ivar applies_to_migration_target_platform: + :vartype applies_to_migration_target_platform: str + :ivar feature_id: + :vartype feature_id: str + :ivar impacted_objects: + :vartype impacted_objects: list["ServerAssessmentsPropertiesItemsItem"] + :ivar issue_category: + :vartype issue_category: str + :ivar more_information: + :vartype more_information: str + """ + + appliesToMigrationTargetPlatform: str + featureId: str + impactedObjects: list["ServerAssessmentsPropertiesItemsItem"] + issueCategory: str + moreInformation: str + + +class ServerAssessmentsPropertiesItemsItem(TypedDict, total=False): + """ServerAssessmentsPropertiesItemsItem. + + :ivar impact_detail: + :vartype impact_detail: str + :ivar name: + :vartype name: str + :ivar object_type: + :vartype object_type: str + """ + + impactDetail: str + name: str + objectType: str + + +class SkuRecommendationResults(TypedDict, total=False): + """SKU Recommendation results for Azure migration targets for SQL Server. + + :ivar azure_sql_database: SKU Recommendation results for Azure SQL Database. + :vartype azure_sql_database: "SkuRecommendationResultsAzureSqlDatabase" + :ivar azure_sql_managed_instance: SKU Recommendation results for Azure SQL Managed Instance. + :vartype azure_sql_managed_instance: "SkuRecommendationResultsAzureSqlManagedInstance" + :ivar azure_sql_virtual_machine: SKU Recommendation results for Azure SQL Virtual Machine. + :vartype azure_sql_virtual_machine: "SkuRecommendationResultsAzureSqlVirtualMachine" + """ + + azureSqlDatabase: "SkuRecommendationResultsAzureSqlDatabase" + """SKU Recommendation results for Azure SQL Database.""" + azureSqlManagedInstance: "SkuRecommendationResultsAzureSqlManagedInstance" + """SKU Recommendation results for Azure SQL Managed Instance.""" + azureSqlVirtualMachine: "SkuRecommendationResultsAzureSqlVirtualMachine" + """SKU Recommendation results for Azure SQL Virtual Machine.""" + + +class SkuRecommendationResultsAzureSqlDatabase(TypedDict, total=False): + """SKU Recommendation results for Azure SQL Database. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: Union[str, "RecommendationStatus"] + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: "SkuRecommendationResultsMonthlyCost" + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: list["SkuRecommendationResultsMonthlyCostOptionItem"] + :ivar target_sku: + :vartype target_sku: "SkuRecommendationResultsAzureSqlDatabaseTargetSku" + """ + + recommendationStatus: Union[str, "RecommendationStatus"] + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + numberOfServerBlockerIssues: int + """Number of blocker issues to fix before migrating to the target platform.""" + monthlyCost: "SkuRecommendationResultsMonthlyCost" + """The monthly cost of the particular SKU.""" + monthlyCostOptions: list["SkuRecommendationResultsMonthlyCostOptionItem"] + """The monthly cost for all different savings options applicable for the particular SKU.""" + targetSku: "SkuRecommendationResultsAzureSqlDatabaseTargetSku" + + +class SkuRecommendationResultsAzureSqlDatabaseTargetSku(TypedDict, total=False): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlDatabaseTargetSku. + + :ivar category: + :vartype category: "SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory" + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: maximum storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The maximum storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The maximum throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: "SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory" + computeSize: int + """Compute Size in vCores.""" + storageMaxSizeInMb: float + """maximum storage for this particular SKU, in MB.""" + predictedDataSizeInMb: float + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predictedLogSizeInMb: float + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + maxStorageIops: float + """The maximum storage IOPS in Azure SQL, will impact the billing cost.""" + maxThroughputMBps: float + """The maximum throughput in Azure SQL, will impact the billing cost.""" + + +class SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory( + TypedDict, total=False +): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlDatabaseTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + computeTier: str + """The compute tier of the target SKU.""" + hardwareType: str + """The hardware type of the target SKU.""" + sqlPurchasingModel: str + """The SQL purchasing model of the target SKU.""" + sqlServiceTier: str + """The SQL service tier of the target SKU.""" + zoneRedundancyAvailable: bool + """Indicates if zone redundancy is available for the target SKU.""" + + +class SkuRecommendationResultsAzureSqlManagedInstance(TypedDict, total=False): # pylint: disable=name-too-long + """SKU Recommendation results for Azure SQL Managed Instance. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: Union[str, "RecommendationStatus"] + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: "SkuRecommendationResultsMonthlyCost" + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: list["SkuRecommendationResultsMonthlyCostOptionItem"] + :ivar target_sku: + :vartype target_sku: "SkuRecommendationResultsAzureSqlManagedInstanceTargetSku" + """ + + recommendationStatus: Union[str, "RecommendationStatus"] + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + numberOfServerBlockerIssues: int + """Number of blocker issues to fix before migrating to the target platform.""" + monthlyCost: "SkuRecommendationResultsMonthlyCost" + """The monthly cost of the particular SKU.""" + monthlyCostOptions: list["SkuRecommendationResultsMonthlyCostOptionItem"] + """The monthly cost for all different savings options applicable for the particular SKU.""" + targetSku: "SkuRecommendationResultsAzureSqlManagedInstanceTargetSku" + + +class SkuRecommendationResultsAzureSqlManagedInstanceTargetSku(TypedDict, total=False): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlManagedInstanceTargetSku. + + :ivar category: + :vartype category: "SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory" + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: maximum storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The maximum storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The maximum throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: "SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory" + computeSize: int + """Compute Size in vCores.""" + storageMaxSizeInMb: float + """maximum storage for this particular SKU, in MB.""" + predictedDataSizeInMb: float + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predictedLogSizeInMb: float + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + maxStorageIops: float + """The maximum storage IOPS in Azure SQL, will impact the billing cost.""" + maxThroughputMBps: float + """The maximum throughput in Azure SQL, will impact the billing cost.""" + + +class SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory( + TypedDict, total=False +): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlManagedInstanceTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + computeTier: str + """The compute tier of the target SKU.""" + hardwareType: str + """The hardware type of the target SKU.""" + sqlPurchasingModel: str + """The SQL purchasing model of the target SKU.""" + sqlServiceTier: str + """The SQL service tier of the target SKU.""" + zoneRedundancyAvailable: bool + """Indicates if zone redundancy is available for the target SKU.""" + + +class SkuRecommendationResultsAzureSqlVirtualMachine(TypedDict, total=False): # pylint: disable=name-too-long + """SKU Recommendation results for Azure SQL Virtual Machine. + + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: Union[str, "RecommendationStatus"] + :ivar number_of_server_blocker_issues: Number of blocker issues to fix before migrating to the + target platform. + :vartype number_of_server_blocker_issues: int + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: "SkuRecommendationResultsMonthlyCost" + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: list["SkuRecommendationResultsMonthlyCostOptionItem"] + :ivar target_sku: + :vartype target_sku: "SkuRecommendationResultsAzureSqlVirtualMachineTargetSku" + """ + + recommendationStatus: Union[str, "RecommendationStatus"] + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + numberOfServerBlockerIssues: int + """Number of blocker issues to fix before migrating to the target platform.""" + monthlyCost: "SkuRecommendationResultsMonthlyCost" + """The monthly cost of the particular SKU.""" + monthlyCostOptions: list["SkuRecommendationResultsMonthlyCostOptionItem"] + """The monthly cost for all different savings options applicable for the particular SKU.""" + targetSku: "SkuRecommendationResultsAzureSqlVirtualMachineTargetSku" + + +class SkuRecommendationResultsAzureSqlVirtualMachineTargetSku(TypedDict, total=False): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlVirtualMachineTargetSku. + + :ivar category: + :vartype category: "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory" + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar virtual_machine_size: size parameters for VM size. + :vartype virtual_machine_size: + "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize" + :ivar data_disk_sizes: Data disk sizes. + :vartype data_disk_sizes: list["DiskSizes"] + :ivar log_disk_sizes: Log disk sizes. + :vartype log_disk_sizes: list["DiskSizes"] + :ivar temp_db_disk_sizes: temp db disk sizes. + :vartype temp_db_disk_sizes: list["DiskSizes"] + """ + + category: "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory" + computeSize: int + """Compute Size in vCores.""" + predictedDataSizeInMb: float + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predictedLogSizeInMb: float + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + virtualMachineSize: "SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize" + """size parameters for VM size.""" + dataDiskSizes: list["DiskSizes"] + """Data disk sizes.""" + logDiskSizes: list["DiskSizes"] + """Log disk sizes.""" + tempDbDiskSizes: list["DiskSizes"] + """temp db disk sizes.""" + + +class SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory( + TypedDict, total=False +): # pylint: disable=name-too-long + """SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuCategory. + + :ivar available_vm_skus: Available VM SKUs for the Azure SQL Virtual Machine. + :vartype available_vm_skus: list[str] + :ivar virtual_machine_family: The virtual machine family of the target SKU. + :vartype virtual_machine_family: str + """ + + availableVmSkus: list[str] + """Available VM SKUs for the Azure SQL Virtual Machine.""" + virtualMachineFamily: str + """The virtual machine family of the target SKU.""" + + +class SkuRecommendationResultsAzureSqlVirtualMachineTargetSkuVirtualMachineSize( + TypedDict, total=False +): # pylint: disable=name-too-long + """size parameters for VM size. + + :ivar virtual_machine_family: Virtual Machine Family, for example : standardMSFamily. + :vartype virtual_machine_family: str + :ivar size_name: VM Size, for example : M64ls. + :vartype size_name: str + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar azure_sku_name: Virtual Machine SKU name,: Eg : Standard_F16s. + :vartype azure_sku_name: str + :ivar v_cpus_available: Available vCores. This can be less than the vCores in the Constrained + vCPU VM Sizes. + :vartype v_cpus_available: int + :ivar max_network_interfaces: maximum network interfaces. + :vartype max_network_interfaces: int + """ + + virtualMachineFamily: str + """Virtual Machine Family, for example : standardMSFamily.""" + sizeName: str + """VM Size, for example : M64ls.""" + computeSize: int + """Compute Size in vCores.""" + azureSkuName: str + """Virtual Machine SKU name,: Eg : Standard_F16s.""" + vCPUsAvailable: int + """Available vCores. This can be less than the vCores in the Constrained vCPU VM Sizes.""" + maxNetworkInterfaces: int + """maximum network interfaces.""" + + +class SkuRecommendationResultsMonthlyCost(TypedDict, total=False): + """The monthly cost of the particular SKU. + + :ivar compute_cost: Represents the Cost of Compute. + :vartype compute_cost: float + :ivar storage_cost: Represents the Cost of Storage. + :vartype storage_cost: float + :ivar iops_cost: Represents the Cost of IOPS. + :vartype iops_cost: float + :ivar sql_license_cost: Represents the Cost of SQL license. + :vartype sql_license_cost: float + :ivar windows_license_cost: Represents the Cost of Windows license. + :vartype windows_license_cost: float + :ivar total_cost: Represents the Total Cost. + :vartype total_cost: float + """ + + computeCost: float + """Represents the Cost of Compute.""" + storageCost: float + """Represents the Cost of Storage.""" + iopsCost: float + """Represents the Cost of IOPS.""" + sqlLicenseCost: float + """Represents the Cost of SQL license.""" + windowsLicenseCost: float + """Represents the Cost of Windows license.""" + totalCost: float + """Represents the Total Cost.""" + + +class SkuRecommendationResultsMonthlyCostOptionItem(TypedDict, total=False): # pylint: disable=name-too-long + """The monthly cost values for this saving option combination for the particular SKU. + + :ivar key_name: The unique combination of saving options for a price e.g. With1YearASPAndProd. + :vartype key_name: str + :ivar key_value: The Monthly cost of the particular SKU. + :vartype key_value: "CostTypeValues" + """ + + keyName: str + """The unique combination of saving options for a price e.g. With1YearASPAndProd.""" + keyValue: "CostTypeValues" + """The Monthly cost of the particular SKU.""" + + +class SkuRecommendationSummary(TypedDict, total=False): + """The SKU recommendation summary. + + :ivar num_of_blocker_issues: Number of blocker issues to fix before migrating this database to + the target platform. + :vartype num_of_blocker_issues: int + :ivar recommendation_status: The target recommendation Status for this database. Known values + are: "NotReady", "Ready", "ReadyWithConditions", and "Unknown". + :vartype recommendation_status: Union[str, "RecommendationStatus"] + :ivar impacted_objects_summary: + :vartype impacted_objects_summary: list["ImpactedObjectsInfo"] + :ivar monthly_cost: The monthly cost of the particular SKU. + :vartype monthly_cost: "SkuRecommendationResultsMonthlyCost" + :ivar monthly_cost_options: The monthly cost for all different savings options applicable for + the particular SKU. + :vartype monthly_cost_options: list["SkuRecommendationResultsMonthlyCostOptionItem"] + :ivar target_sku: + :vartype target_sku: "SkuRecommendationSummaryTargetSku" + """ + + numOfBlockerIssues: int + """Number of blocker issues to fix before migrating this database to the target platform.""" + recommendationStatus: Union[str, "RecommendationStatus"] + """The target recommendation Status for this database. Known values are: \"NotReady\", \"Ready\", + \"ReadyWithConditions\", and \"Unknown\".""" + impactedObjectsSummary: list["ImpactedObjectsInfo"] + monthlyCost: "SkuRecommendationResultsMonthlyCost" + """The monthly cost of the particular SKU.""" + monthlyCostOptions: list["SkuRecommendationResultsMonthlyCostOptionItem"] + """The monthly cost for all different savings options applicable for the particular SKU.""" + targetSku: "SkuRecommendationSummaryTargetSku" + + +class SkuRecommendationSummaryTargetSku(TypedDict, total=False): + """SkuRecommendationSummaryTargetSku. + + :ivar category: + :vartype category: "SkuRecommendationSummaryTargetSkuCategory" + :ivar compute_size: Compute Size in vCores. + :vartype compute_size: int + :ivar storage_max_size_in_mb: max storage for this particular SKU, in MB. + :vartype storage_max_size_in_mb: float + :ivar predicted_data_size_in_mb: The predicted data size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_data_size_in_mb: float + :ivar predicted_log_size_in_mb: The predicted log size in MB in Azure SQL, will impact the + billing cost. + :vartype predicted_log_size_in_mb: float + :ivar max_storage_iops: The max storage IOPS in Azure SQL, will impact the billing cost. + :vartype max_storage_iops: float + :ivar max_throughput_m_bps: The max throughput in Azure SQL, will impact the billing cost. + :vartype max_throughput_m_bps: float + """ + + category: "SkuRecommendationSummaryTargetSkuCategory" + computeSize: int + """Compute Size in vCores.""" + storageMaxSizeInMb: float + """max storage for this particular SKU, in MB.""" + predictedDataSizeInMb: float + """The predicted data size in MB in Azure SQL, will impact the billing cost.""" + predictedLogSizeInMb: float + """The predicted log size in MB in Azure SQL, will impact the billing cost.""" + maxStorageIops: float + """The max storage IOPS in Azure SQL, will impact the billing cost.""" + maxThroughputMBps: float + """The max throughput in Azure SQL, will impact the billing cost.""" + + +class SkuRecommendationSummaryTargetSkuCategory(TypedDict, total=False): # pylint: disable=name-too-long + """SkuRecommendationSummaryTargetSkuCategory. + + :ivar compute_tier: The compute tier of the target SKU. + :vartype compute_tier: str + :ivar hardware_type: The hardware type of the target SKU. + :vartype hardware_type: str + :ivar sql_purchasing_model: The SQL purchasing model of the target SKU. + :vartype sql_purchasing_model: str + :ivar sql_service_tier: The SQL service tier of the target SKU. + :vartype sql_service_tier: str + :ivar zone_redundancy_available: Indicates if zone redundancy is available for the target SKU. + :vartype zone_redundancy_available: bool + """ + + computeTier: str + """The compute tier of the target SKU.""" + hardwareType: str + """The hardware type of the target SKU.""" + sqlPurchasingModel: str + """The SQL purchasing model of the target SKU.""" + sqlServiceTier: str + """The SQL service tier of the target SKU.""" + zoneRedundancyAvailable: bool + """Indicates if zone redundancy is available for the target SKU.""" + + +class SqlAvailabilityGroupDatabaseReplicaResourceProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Arc Sql availability group database replica resource. + + :ivar database_name: the database name. + :vartype database_name: str + :ivar replica_name: the database replica name. + :vartype replica_name: str + :ivar is_local: Whether the availability database is local. + :vartype is_local: bool + :ivar is_primary_replica: Returns 1 if the replica is primary, or 0 if it is a secondary + replica. + :vartype is_primary_replica: bool + :ivar synchronization_state_description: Description of the data-movement state. + :vartype synchronization_state_description: str + :ivar is_commit_participant: Whether this replica is transaction committer. + :vartype is_commit_participant: bool + :ivar synchronization_health_description: Description of the health of database. + :vartype synchronization_health_description: str + :ivar database_state_description: Description of the database state of the availability + replica. + :vartype database_state_description: str + :ivar is_suspended: Whether this data movement is suspended. + :vartype is_suspended: bool + :ivar suspend_reason_description: Description of the database suspended state reason. + :vartype suspend_reason_description: str + """ + + databaseName: str + """the database name.""" + replicaName: str + """the database replica name.""" + isLocal: bool + """Whether the availability database is local.""" + isPrimaryReplica: bool + """Returns 1 if the replica is primary, or 0 if it is a secondary replica.""" + synchronizationStateDescription: str + """Description of the data-movement state.""" + isCommitParticipant: bool + """Whether this replica is transaction committer.""" + synchronizationHealthDescription: str + """Description of the health of database.""" + databaseStateDescription: str + """Description of the database state of the availability replica.""" + isSuspended: bool + """Whether this data movement is suspended.""" + suspendReasonDescription: str + """Description of the database suspended state reason.""" + + +class SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem(TypedDict, total=False): # pylint: disable=name-too-long + """SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem. + + :ivar ip_address: IPV4 address. + :vartype ip_address: str + :ivar mask: IPV4 netmask. + :vartype mask: str + """ + + ipAddress: str + """IPV4 address.""" + mask: str + """IPV4 netmask.""" + + +class SqlAvailabilityGroupReplicaResourceProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Arc Sql availability group replica resource. + + :ivar replica_id: ID GUID of the availability group. + :vartype replica_id: str + :ivar replica_name: The replica name. + :vartype replica_name: str + :ivar replica_resource_id: Resource id of this replica. This is required for a distributed + availability group, in which case it describes the location of the availability group that + hosts one replica in the DAG. In a non-distributed availability group this field is optional + but can be used to store the Azure resource id for AG. + :vartype replica_resource_id: str + :ivar configure: null. + :vartype configure: "AvailabilityGroupConfigure" + :ivar state: null. + :vartype state: "AvailabilityGroupState" + """ + + replicaId: str + """ID GUID of the availability group.""" + replicaName: str + """The replica name.""" + replicaResourceId: str + """Resource id of this replica. This is required for a distributed availability group, in which + case it describes the location of the availability group that hosts one replica in the DAG. In + a non-distributed availability group this field is optional but can be used to store the Azure + resource id for AG.""" + configure: "AvailabilityGroupConfigure" + """null.""" + state: "AvailabilityGroupState" + """null.""" + + +class SqlAvailabilityGroupStaticIPListenerProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of a static IP Arc Sql availability group listener. + + :ivar dns_name: the DNS name for the listener. + :vartype dns_name: str + :ivar ip_v4_addresses_and_masks: IP V4 Addresses and masks for the listener. + :vartype ip_v4_addresses_and_masks: + list["SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem"] + :ivar ip_v6_addresses: IP V6 Addresses for the listener. + :vartype ip_v6_addresses: list[str] + :ivar port: Network port for the listener. Default is 1433. + :vartype port: int + """ + + dnsName: str + """the DNS name for the listener.""" + ipV4AddressesAndMasks: list["SqlAvailabilityGroupIpV4AddressesAndMasksPropertiesItem"] + """IP V4 Addresses and masks for the listener.""" + ipV6Addresses: list[str] + """IP V6 Addresses for the listener.""" + port: int + """Network port for the listener. Default is 1433.""" + + +class SqlManagedInstance(TrackedResource): + """A SqlManagedInstance. + + :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: "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: null. Required. + :vartype properties: "SqlManagedInstanceProperties" + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: "ExtendedLocation" + :ivar sku: Resource sku. + :vartype sku: "SqlManagedInstanceSku" + """ + + properties: Required["SqlManagedInstanceProperties"] + """null. Required.""" + extendedLocation: "ExtendedLocation" + """The extendedLocation of the resource.""" + sku: "SqlManagedInstanceSku" + """Resource sku.""" + + +class SqlManagedInstanceK8SRaw(TypedDict, total=False): + """The raw kubernetes information. + + :ivar spec: The kubernetes spec information. + :vartype spec: "SqlManagedInstanceK8SSpec" + """ + + spec: "SqlManagedInstanceK8SSpec" + """The kubernetes spec information.""" + + +class SqlManagedInstanceK8SSpec(TypedDict, total=False): + """The kubernetes spec information. + + :ivar scheduling: The kubernetes scheduling information. + :vartype scheduling: "K8SScheduling" + :ivar replicas: This option specifies the number of SQL Managed Instance replicas that will be + deployed in your Kubernetes cluster for high availability purposes. If sku.tier is + BusinessCritical, allowed values are '2' or '3' with default of '3'. If sku.tier is + GeneralPurpose, replicas must be '1'. + :vartype replicas: int + :ivar security: The kubernetes security information. + :vartype security: "K8SSecurity" + :ivar settings: The kubernetes settings information. + :vartype settings: "K8SSettings" + """ + + scheduling: "K8SScheduling" + """The kubernetes scheduling information.""" + replicas: int + """This option specifies the number of SQL Managed Instance replicas that will be deployed in your + Kubernetes cluster for high availability purposes. If sku.tier is BusinessCritical, allowed + values are '2' or '3' with default of '3'. If sku.tier is GeneralPurpose, replicas must be '1'.""" + security: "K8SSecurity" + """The kubernetes security information.""" + settings: "K8SSettings" + """The kubernetes settings information.""" + + +class SqlManagedInstanceProperties(TypedDict, total=False): + """Properties of sqlManagedInstance. + + :ivar data_controller_id: null. + :vartype data_controller_id: str + :ivar admin: The instance admin user. + :vartype admin: str + :ivar start_time: The instance start time. + :vartype start_time: str + :ivar end_time: The instance end time. + :vartype end_time: str + :ivar k8_s_raw: The raw kubernetes information. + :vartype k8_s_raw: "SqlManagedInstanceK8SRaw" + :ivar basic_login_information: Username and password for basic authentication. + :vartype basic_login_information: "BasicLoginInformation" + :ivar last_uploaded_date: Last uploaded date from Kubernetes cluster. Defaults to current date + time. + :vartype last_uploaded_date: str + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Managed Instance + resource. + :vartype provisioning_state: str + :ivar active_directory_information: Active Directory information related to this SQL Managed + Instance. + :vartype active_directory_information: "ActiveDirectoryInformation" + :ivar license_type: The license type to apply for this managed instance. Known values are: + "BasePrice", "LicenseIncluded", and "DisasterRecovery". + :vartype license_type: Union[str, "ArcSqlManagedInstanceLicenseType"] + :ivar cluster_id: If a CustomLocation is provided, this contains the ARM id of the connected + cluster the custom location belongs to. + :vartype cluster_id: str + :ivar extension_id: If a CustomLocation is provided, this contains the ARM id of the extension + the custom location belongs to. + :vartype extension_id: str + """ + + dataControllerId: str + """null.""" + admin: str + """The instance admin user.""" + startTime: str + """The instance start time.""" + endTime: str + """The instance end time.""" + k8sRaw: "SqlManagedInstanceK8SRaw" + """The raw kubernetes information.""" + basicLoginInformation: "BasicLoginInformation" + """Username and password for basic authentication.""" + lastUploadedDate: str + """Last uploaded date from Kubernetes cluster. Defaults to current date time.""" + provisioningState: str + """The provisioning state of the Arc-enabled SQL Managed Instance resource.""" + activeDirectoryInformation: "ActiveDirectoryInformation" + """Active Directory information related to this SQL Managed Instance.""" + licenseType: Union[str, "ArcSqlManagedInstanceLicenseType"] + """The license type to apply for this managed instance. Known values are: \"BasePrice\", + \"LicenseIncluded\", and \"DisasterRecovery\".""" + clusterId: str + """If a CustomLocation is provided, this contains the ARM id of the connected cluster the custom + location belongs to.""" + extensionId: str + """If a CustomLocation is provided, this contains the ARM id of the extension the custom location + belongs to.""" + + +class SqlManagedInstanceSku(TypedDict, total=False): + """The resource model definition representing SKU for Azure Managed Instance - Azure Arc. + + :ivar name: The name of the SKU. Required. Default value is "vCore". + :vartype name: Literal["vCore"] + :ivar tier: The pricing tier for the instance. Known values are: "GeneralPurpose" and + "BusinessCritical". + :vartype tier: Union[str, "SqlManagedInstanceSkuTier"] + :ivar dev: Whether dev/test is enabled. When the dev field is set to true, the resource is used + for dev/test purpose. + :vartype dev: bool + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: The SKU family. + :vartype family: str + :ivar capacity: The SKU capacity. + :vartype capacity: int + """ + + name: Required[Literal["vCore"]] + """The name of the SKU. Required. Default value is \"vCore\".""" + tier: Union[str, "SqlManagedInstanceSkuTier"] + """The pricing tier for the instance. Known values are: \"GeneralPurpose\" and + \"BusinessCritical\".""" + dev: bool + """Whether dev/test is enabled. When the dev field is set to true, the resource is used for + dev/test purpose.""" + size: str + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: str + """The SKU family.""" + capacity: int + """The SKU capacity.""" + + +class SqlManagedInstanceUpdate(TypedDict, total=False): + """An update to a SQL Managed Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: dict[str, str] + """Resource tags.""" + + +class SqlServerAvailabilityGroupResource(TrackedResource): + """Arc Sql Server Availability 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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "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: Properties of Arc Sql Server availability group. Required. + :vartype properties: "SqlServerAvailabilityGroupResourceProperties" + """ + + properties: Required["SqlServerAvailabilityGroupResourceProperties"] + """Properties of Arc Sql Server availability group. Required.""" + + +class SqlServerAvailabilityGroupResourceProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Arc Sql Server availability group resource. + + :ivar availability_group_id: ID GUID of the availability group. + :vartype availability_group_id: str + :ivar server_name: the SQL server name. + :vartype server_name: str + :ivar instance_name: the SQL Server Instance name. + :vartype instance_name: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar collection_timestamp: Timestamp for when the data was collected from the client machine. + :vartype collection_timestamp: str + :ivar info: Availability Group Info. + :vartype info: "AvailabilityGroupInfo" + :ivar replicas: A list of Availability Group Replicas. + :vartype replicas: "SqlServerAvailabilityGroupResourcePropertiesReplicas" + :ivar databases: A list of Availability Group Database Replicas. + :vartype databases: "SqlServerAvailabilityGroupResourcePropertiesDatabases" + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server availability + group resource. + :vartype provisioning_state: str + """ + + availabilityGroupId: str + """ID GUID of the availability group.""" + serverName: str + """the SQL server name.""" + instanceName: str + """the SQL Server Instance name.""" + vmId: str + """The unique ID of the hybrid machine that this resource belongs to.""" + collectionTimestamp: str + """Timestamp for when the data was collected from the client machine.""" + info: "AvailabilityGroupInfo" + """Availability Group Info.""" + replicas: "SqlServerAvailabilityGroupResourcePropertiesReplicas" + """A list of Availability Group Replicas.""" + databases: "SqlServerAvailabilityGroupResourcePropertiesDatabases" + """A list of Availability Group Database Replicas.""" + provisioningState: str + """The provisioning state of the Arc-enabled SQL Server availability group resource.""" + + +class SqlServerAvailabilityGroupResourcePropertiesDatabases(TypedDict, total=False): # pylint: disable=name-too-long + """A list of Availability Group Database Replicas. + + :ivar value: Array of Availability Group Database Replicas. + :vartype value: list["SqlAvailabilityGroupDatabaseReplicaResourceProperties"] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + value: list["SqlAvailabilityGroupDatabaseReplicaResourceProperties"] + """Array of Availability Group Database Replicas.""" + nextLink: str + """Link to retrieve next page of results.""" + + +class SqlServerAvailabilityGroupResourcePropertiesReplicas(TypedDict, total=False): # pylint: disable=name-too-long + """A list of Availability Group Replicas. + + :ivar value: Array of Availability Group Replicas. + :vartype value: list["SqlAvailabilityGroupReplicaResourceProperties"] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + value: list["SqlAvailabilityGroupReplicaResourceProperties"] + """Array of Availability Group Replicas.""" + nextLink: str + """Link to retrieve next page of results.""" + + +class SqlServerAvailabilityGroupUpdate(TypedDict, total=False): + """An update to availability group resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The Server Availability Group's properties. + :vartype properties: "SqlServerAvailabilityGroupResourceProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "SqlServerAvailabilityGroupResourceProperties" + """The Server Availability Group's properties.""" + + +class SqlServerDatabaseResource(TrackedResource): + """Arc Sql Server database. + + :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: "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: Properties of Arc Sql Server database. Required. + :vartype properties: "SqlServerDatabaseResourceProperties" + """ + + properties: Required["SqlServerDatabaseResourceProperties"] + """Properties of Arc Sql Server database. Required.""" + + +class SqlServerDatabaseResourceProperties(TypedDict, total=False): + """The properties of Arc Sql Server database resource. + + :ivar collation_name: Collation of the database. + :vartype collation_name: str + :ivar database_creation_date: Creation date of the database. + :vartype database_creation_date: str + :ivar compatibility_level: Compatibility level of the database. + :vartype compatibility_level: int + :ivar size_mb: Size of the database. + :vartype size_mb: float + :ivar log_file_size_mb: Total size in MB for the log (ldf) files for this database. + :vartype log_file_size_mb: float + :ivar data_file_size_mb: Total size in MB for the data (mdf and ndf) files for this database. + :vartype data_file_size_mb: float + :ivar space_available_mb: Space left of the database. + :vartype space_available_mb: float + :ivar state: State of the database. Known values are: "Online", "Restoring", "Recovering", + "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", and "OfflineSecondary". + :vartype state: Union[str, "DatabaseState"] + :ivar is_read_only: Whether the database is read only or not. + :vartype is_read_only: bool + :ivar recovery_mode: Status of the database. Known values are: "Full", "Bulk-logged", and + "Simple". + :vartype recovery_mode: Union[str, "RecoveryMode"] + :ivar database_options: List of features that are enabled for the database. + :vartype database_options: "SqlServerDatabaseResourcePropertiesDatabaseOptions" + :ivar backup_information: + :vartype backup_information: "SqlServerDatabaseResourcePropertiesBackupInformation" + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: "BackupPolicy" + :ivar earliest_restore_date: This records the earliest start date and time that restore is + available for this database (ISO8601 format). + :vartype earliest_restore_date: str + :ivar create_mode: Database create mode. PointInTimeRestore: Create a database by restoring a + point in time backup of an existing database. sourceDatabaseId and restorePointInTime must be + specified. Known values are: "Default" and "PointInTimeRestore". + :vartype create_mode: Union[str, "DatabaseCreateMode"] + :ivar source_database_id: The name of the source database associated with create operation of + this database. + :vartype source_database_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is + required. Specifies the point in time (ISO8601 format) of the source database that will be + restored to create the new database. + :vartype restore_point_in_time: str + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server database + resource. + :vartype provisioning_state: str + :ivar last_database_upload_time: The time when last successful database upload was performed. + :vartype last_database_upload_time: str + :ivar migration: Migration related configuration. + :vartype migration: "DataBaseMigration" + """ + + collationName: str + """Collation of the database.""" + databaseCreationDate: str + """Creation date of the database.""" + compatibilityLevel: int + """Compatibility level of the database.""" + sizeMB: float + """Size of the database.""" + logFileSizeMB: float + """Total size in MB for the log (ldf) files for this database.""" + dataFileSizeMB: float + """Total size in MB for the data (mdf and ndf) files for this database.""" + spaceAvailableMB: float + """Space left of the database.""" + state: Union[str, "DatabaseState"] + """State of the database. Known values are: \"Online\", \"Restoring\", \"Recovering\", + \"RecoveryPending\", \"Suspect\", \"Emergency\", \"Offline\", \"Copying\", and + \"OfflineSecondary\".""" + isReadOnly: bool + """Whether the database is read only or not.""" + recoveryMode: Union[str, "RecoveryMode"] + """Status of the database. Known values are: \"Full\", \"Bulk-logged\", and \"Simple\".""" + databaseOptions: "SqlServerDatabaseResourcePropertiesDatabaseOptions" + """List of features that are enabled for the database.""" + backupInformation: "SqlServerDatabaseResourcePropertiesBackupInformation" + backupPolicy: "BackupPolicy" + """The backup profile for the SQL server.""" + earliestRestoreDate: str + """This records the earliest start date and time that restore is available for this database + (ISO8601 format).""" + createMode: Union[str, "DatabaseCreateMode"] + """Database create mode. PointInTimeRestore: Create a database by restoring a point in time backup + of an existing database. sourceDatabaseId and restorePointInTime must be specified. Known + values are: \"Default\" and \"PointInTimeRestore\".""" + sourceDatabaseId: str + """The name of the source database associated with create operation of this database.""" + vmId: str + """The unique ID of the hybrid machine that this resource belongs to.""" + restorePointInTime: str + """Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point + in time (ISO8601 format) of the source database that will be restored to create the new + database.""" + provisioningState: str + """The provisioning state of the Arc-enabled SQL Server database resource.""" + lastDatabaseUploadTime: str + """The time when last successful database upload was performed.""" + migration: "DataBaseMigration" + """Migration related configuration.""" + + +class SqlServerDatabaseResourcePropertiesBackupInformation(TypedDict, total=False): # pylint: disable=name-too-long + """SqlServerDatabaseResourcePropertiesBackupInformation. + + :ivar last_full_backup: Date time of last full backup. + :vartype last_full_backup: str + :ivar last_log_backup: Date time of last log backup. + :vartype last_log_backup: str + """ + + lastFullBackup: str + """Date time of last full backup.""" + lastLogBackup: str + """Date time of last log backup.""" + + +class SqlServerDatabaseResourcePropertiesDatabaseOptions(TypedDict, total=False): # pylint: disable=name-too-long + """List of features that are enabled for the database. + + :ivar is_auto_close_on: + :vartype is_auto_close_on: bool + :ivar is_auto_shrink_on: + :vartype is_auto_shrink_on: bool + :ivar is_auto_create_stats_on: + :vartype is_auto_create_stats_on: bool + :ivar is_auto_update_stats_on: + :vartype is_auto_update_stats_on: bool + :ivar is_remote_data_archive_enabled: + :vartype is_remote_data_archive_enabled: bool + :ivar is_memory_optimization_enabled: + :vartype is_memory_optimization_enabled: bool + :ivar is_encrypted: + :vartype is_encrypted: bool + :ivar is_trustworthy_on: + :vartype is_trustworthy_on: bool + :ivar is_hekaton_files_on: Whether the database uses the In-Memory OLTP feature for storing + in-memory objects. + :vartype is_hekaton_files_on: bool + :ivar number_of_hekaton_files: How many Hekaton files the DB has on disk, if it uses in-memory + OLTP objects. + :vartype number_of_hekaton_files: int + """ + + isAutoCloseOn: bool + isAutoShrinkOn: bool + isAutoCreateStatsOn: bool + isAutoUpdateStatsOn: bool + isRemoteDataArchiveEnabled: bool + isMemoryOptimizationEnabled: bool + isEncrypted: bool + isTrustworthyOn: bool + isHekatonFilesOn: bool + """Whether the database uses the In-Memory OLTP feature for storing in-memory objects.""" + numberOfHekatonFiles: int + """How many Hekaton files the DB has on disk, if it uses in-memory OLTP objects.""" + + +class SqlServerDatabaseUpdate(TypedDict, total=False): + """An update to database resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The data controller's properties. + :vartype properties: "SqlServerDatabaseResourceProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "SqlServerDatabaseResourceProperties" + """The data controller's properties.""" + + +class SqlServerEsuLicense(TrackedResource): + """Describe SQL Server ESU license 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: "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: SQL Server ESU license properties. Required. + :vartype properties: "SqlServerEsuLicenseProperties" + """ + + properties: Required["SqlServerEsuLicenseProperties"] + """SQL Server ESU license properties. Required.""" + + +class SqlServerEsuLicenseProperties(TypedDict, total=False): + """Properties of SQL Server ESU license. + + :ivar billing_plan: SQL Server ESU license type. Required. Known values are: "PAYG" and "Paid". + :vartype billing_plan: Union[str, "BillingPlan"] + :ivar version: The SQL Server version the license covers. Required. Known values are: "SQL + Server 2012", "SQL Server 2014", and "SQL Server 2016". + :vartype version: Union[str, "Version"] + :ivar unique_id: The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :vartype unique_id: str + :ivar physical_cores: The number of total cores of the license covers. Required. + :vartype physical_cores: int + :ivar activation_state: The activation state of the license. Required. Known values are: + "Inactive", "Active", "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", + and "Suspended". + :vartype activation_state: Union[str, "State"] + :ivar scope_type: The Azure scope to which the license will apply. Required. Known values are: + "Tenant", "Subscription", and "ResourceGroup". + :vartype scope_type: Union[str, "ScopeType"] + :ivar activated_at: The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype activated_at: str + :ivar terminated_at: The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype terminated_at: str + :ivar tenant_id: The tenantId the SQL Server ESU license resource subscription resides in. + :vartype tenant_id: str + """ + + billingPlan: Required[Union[str, "BillingPlan"]] + """SQL Server ESU license type. Required. Known values are: \"PAYG\" and \"Paid\".""" + version: Required[Union[str, "Version"]] + """The SQL Server version the license covers. Required. Known values are: \"SQL Server 2012\", + \"SQL Server 2014\", and \"SQL Server 2016\".""" + uniqueId: str + """The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000).""" + physicalCores: Required[int] + """The number of total cores of the license covers. Required.""" + activationState: Required[Union[str, "State"]] + """The activation state of the license. Required. Known values are: \"Inactive\", \"Active\", + \"Terminated\", \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and + \"Suspended\".""" + scopeType: Required[Union[str, "ScopeType"]] + """The Azure scope to which the license will apply. Required. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + activatedAt: str + """The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 date-time format.""" + terminatedAt: str + """The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 date-time format.""" + tenantId: str + """The tenantId the SQL Server ESU license resource subscription resides in.""" + + +class SqlServerEsuLicenseUpdate(TypedDict, total=False): + """An update to a SQL Server ESU license resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: "SqlServerEsuLicenseUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "SqlServerEsuLicenseUpdateProperties" + """null.""" + + +class SqlServerEsuLicenseUpdateProperties(TypedDict, total=False): + """Properties of update SqlServerEsuLicense. + + :ivar billing_plan: SQL Server ESU license type. Known values are: "PAYG" and "Paid". + :vartype billing_plan: Union[str, "BillingPlan"] + :ivar version: The SQL Server version the license covers. Known values are: "SQL Server 2012", + "SQL Server 2014", and "SQL Server 2016". + :vartype version: Union[str, "Version"] + :ivar unique_id: The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :vartype unique_id: str + :ivar physical_cores: The number of total cores of the license covers. + :vartype physical_cores: int + :ivar activation_state: The activation state of the license. Known values are: "Inactive", + "Active", "Terminated", "Enabled", "Disabled", "Deleted", "Completed", "Faulted", and + "Suspended". + :vartype activation_state: Union[str, "State"] + :ivar scope_type: The Azure scope to which the license will apply. Known values are: "Tenant", + "Subscription", and "ResourceGroup". + :vartype scope_type: Union[str, "ScopeType"] + :ivar activated_at: The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype activated_at: str + :ivar terminated_at: The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 + date-time format. + :vartype terminated_at: str + :ivar tenant_id: The tenantId the SQL Server ESU license resource subscription resides in. + :vartype tenant_id: str + """ + + billingPlan: Union[str, "BillingPlan"] + """SQL Server ESU license type. Known values are: \"PAYG\" and \"Paid\".""" + version: Union[str, "Version"] + """The SQL Server version the license covers. Known values are: \"SQL Server 2012\", \"SQL Server + 2014\", and \"SQL Server 2016\".""" + uniqueId: str + """The unique ID of this license. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000).""" + physicalCores: int + """The number of total cores of the license covers.""" + activationState: Union[str, "State"] + """The activation state of the license. Known values are: \"Inactive\", \"Active\", + \"Terminated\", \"Enabled\", \"Disabled\", \"Deleted\", \"Completed\", \"Faulted\", and + \"Suspended\".""" + scopeType: Union[str, "ScopeType"] + """The Azure scope to which the license will apply. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + activatedAt: str + """The timestamp of the activation of the SqlServerEsuLicense in ISO 8601 date-time format.""" + terminatedAt: str + """The timestamp of the termination of the SqlServerEsuLicense in ISO 8601 date-time format.""" + tenantId: str + """The tenantId the SQL Server ESU license resource subscription resides in.""" + + +class SqlServerInstance(TrackedResource): + """A SqlServerInstance. + + :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: "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: null. + :vartype properties: "SqlServerInstanceProperties" + """ + + properties: "SqlServerInstanceProperties" + """null.""" + + +class SqlServerInstanceBpaColumn(TypedDict, total=False): + """The SQL best practices assessment result column. + + :ivar name: The name of the result column. + :vartype name: str + :ivar type: The type of the result column. Known values are: "bool", "datetime", "int", "long", + "double", "string", "guid", and "timespan". + :vartype type: Union[str, "SqlServerInstanceBpaColumnType"] + """ + + name: str + """The name of the result column.""" + type: Union[str, "SqlServerInstanceBpaColumnType"] + """The type of the result column. Known values are: \"bool\", \"datetime\", \"int\", \"long\", + \"double\", \"string\", \"guid\", and \"timespan\".""" + + +class SqlServerInstanceBpaRequest(TypedDict, total=False): + """The request for retrieving SQL best practices assessment results. + + :ivar report_type: The report type that needs to be fetched. If not specified, the default is + AssessmentSummary. Known values are: "AssessmentDataPoint" and "AssessmentSummary". + :vartype report_type: Union[str, "SqlServerInstanceBpaReportType"] + :ivar report_id: The GUID of the report to return best practices assessment results for. If not + specified, summaries for all reports will be returned. + :vartype report_id: str + :ivar skip_token: The opaque token to use to skip to a specific page of the report. If not + specified, the first page will be returned. + :vartype skip_token: str + :ivar query_type: The type of query to run for summarizing the best practices assessment + results. If not specified, the default is 'Basic'. Known values are: "Basic" and + "HistoricalTrends". + :vartype query_type: Union[str, "SqlServerInstanceBpaQueryType"] + """ + + reportType: Union[str, "SqlServerInstanceBpaReportType"] + """The report type that needs to be fetched. If not specified, the default is AssessmentSummary. + Known values are: \"AssessmentDataPoint\" and \"AssessmentSummary\".""" + reportId: str + """The GUID of the report to return best practices assessment results for. If not specified, + summaries for all reports will be returned.""" + skipToken: str + """The opaque token to use to skip to a specific page of the report. If not specified, the first + page will be returned.""" + queryType: Union[str, "SqlServerInstanceBpaQueryType"] + """The type of query to run for summarizing the best practices assessment results. If not + specified, the default is 'Basic'. Known values are: \"Basic\" and \"HistoricalTrends\".""" + + +class SqlServerInstanceJob(TypedDict, total=False): + """The job running on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: "BackgroundJob" + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list["SequencerAction"] + """ + + id: str + """The unique identifier of the job.""" + instanceName: str + """The name of the SQL Server instance.""" + jobStatus: Union[str, "JobStatus"] + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + jobException: str + """The exception message if the job failed.""" + backgroundJob: "BackgroundJob" + """The background job details.""" + sequencerActions: list["SequencerAction"] + """The list of sequencer actions.""" + + +class SqlServerInstanceJobsRequest(TypedDict, total=False): + """The request for the jobs running on the SQL Server instance. + + :ivar feature_name: The name of the feature to retrieve the jobs for. + :vartype feature_name: str + :ivar job_type: The type of the job to retrieve the jobs for. + :vartype job_type: str + """ + + featureName: str + """The name of the feature to retrieve the jobs for.""" + jobType: str + """The type of the job to retrieve the jobs for.""" + + +class SqlServerInstanceJobsResponse(TypedDict, total=False): + """The response for the jobs running on the SQL Server instance. + + :ivar jobs: The list of jobs running on the SQL Server instance. + :vartype jobs: list["SqlServerInstanceJob"] + """ + + jobs: list["SqlServerInstanceJob"] + """The list of jobs running on the SQL Server instance.""" + + +class SqlServerInstanceJobsStatusRequest(TypedDict, total=False): + """The request for the status of the jobs running on the SQL Server instance. + + :ivar feature_name: The name of the feature to retrieve the job status for. + :vartype feature_name: str + :ivar job_type: The type of the job to retrieve the status for. + :vartype job_type: str + """ + + featureName: str + """The name of the feature to retrieve the job status for.""" + jobType: str + """The type of the job to retrieve the status for.""" + + +class SqlServerInstanceJobsStatusResponse(TypedDict, total=False): + """The response for the status of the jobs running on the SQL Server instance. + + :ivar jobs_status: The list of jobs status running on the SQL Server instance. + :vartype jobs_status: list["SqlServerInstanceJobStatus"] + """ + + jobsStatus: list["SqlServerInstanceJobStatus"] + """The list of jobs status running on the SQL Server instance.""" + + +class SqlServerInstanceJobStatus(TypedDict, total=False): + """The status of the job running on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: "BackgroundJob" + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list["SequencerAction"] + """ + + id: str + """The unique identifier of the job.""" + instanceName: str + """The name of the SQL Server instance.""" + jobStatus: Union[str, "JobStatus"] + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + jobException: str + """The exception message if the job failed.""" + backgroundJob: "BackgroundJob" + """The background job details.""" + sequencerActions: list["SequencerAction"] + """The list of sequencer actions.""" + + +class SqlServerInstanceManagedInstanceLinkAssessment(TypedDict, total=False): # pylint: disable=name-too-long + """The status of an individual requirement for MI Link. + + :ivar name: The name of the requirement. + :vartype name: str + :ivar category: Validation category for the MI Link prerequisites assessment. Known values are: + "SqlInstance", "SqlInstanceDatabase", "ManagedInstance", "ManagedInstanceDatabase", + "ManagedInstanceCrossValidation", "Certificates", "BoxToMiNetworkConnectivity", + "MiToBoxNetworkConnectivity", "SqlInstanceAg", and "DagCrossValidation". + :vartype category: Union[str, "MiLinkAssessmentCategory"] + :ivar status: The status of the requirement. Known values are: "Success", "Warning", and + "Failure". + :vartype status: Union[str, "AssessmentStatus"] + :ivar information: The information text about requirement. + :vartype information: str + :ivar additional_information: Additional details about the check, including any recommended + actions. + :vartype additional_information: str + :ivar failing_dbs: List of names of databases that are failing the given assessment. + :vartype failing_dbs: list[str] + """ + + name: str + """The name of the requirement.""" + category: Union[str, "MiLinkAssessmentCategory"] + """Validation category for the MI Link prerequisites assessment. Known values are: + \"SqlInstance\", \"SqlInstanceDatabase\", \"ManagedInstance\", \"ManagedInstanceDatabase\", + \"ManagedInstanceCrossValidation\", \"Certificates\", \"BoxToMiNetworkConnectivity\", + \"MiToBoxNetworkConnectivity\", \"SqlInstanceAg\", and \"DagCrossValidation\".""" + status: Union[str, "AssessmentStatus"] + """The status of the requirement. Known values are: \"Success\", \"Warning\", and \"Failure\".""" + information: str + """The information text about requirement.""" + additionalInformation: str + """Additional details about the check, including any recommended actions.""" + failingDbs: list[str] + """List of names of databases that are failing the given assessment.""" + + +class SqlServerInstanceManagedInstanceLinkAssessmentRequest(TypedDict, total=False): # pylint: disable=name-too-long + """The MI Link assessment request for the SQL Server instance. + + :ivar azure_managed_instance_resource_id: The Azure SQL Managed Instance resource ID to link + with the SQL Server instance. Required. + :vartype azure_managed_instance_resource_id: str + :ivar azure_managed_instance_role: The role of managed instance in a distributed availability + group, can be Primary or Secondary. Known values are: "Primary" and "Secondary". + :vartype azure_managed_instance_role: Union[str, "AzureManagedInstanceRole"] + :ivar database_names: An array of strings, where each value represents the name of a database + to be replicated to the Azure SQL Managed Instance. Required. + :vartype database_names: list[str] + :ivar availability_group_name: The name of the availability group to be used for the database + replication. Required. + :vartype availability_group_name: str + :ivar distributed_availability_group_name: The name of the DAG to be used for the database + replication. Also referred to as Link Name. Required. + :vartype distributed_availability_group_name: str + :ivar assessment_categories: An array of strings, where each value represents the category of + the assessment to be run. If this field is not provided, all assessment categories will be run. + :vartype assessment_categories: list[Union[str, "MiLinkAssessmentCategory"]] + :ivar sql_server_ip_address: The IP address of the SQL Server instance. + :vartype sql_server_ip_address: str + """ + + azureManagedInstanceResourceId: Required[str] + """The Azure SQL Managed Instance resource ID to link with the SQL Server instance. Required.""" + azureManagedInstanceRole: Union[str, "AzureManagedInstanceRole"] + """The role of managed instance in a distributed availability group, can be Primary or Secondary. + Known values are: \"Primary\" and \"Secondary\".""" + databaseNames: Required[list[str]] + """An array of strings, where each value represents the name of a database to be replicated to the + Azure SQL Managed Instance. Required.""" + availabilityGroupName: Required[str] + """The name of the availability group to be used for the database replication. Required.""" + distributedAvailabilityGroupName: Required[str] + """The name of the DAG to be used for the database replication. Also referred to as Link Name. + Required.""" + assessmentCategories: list[Union[str, "MiLinkAssessmentCategory"]] + """An array of strings, where each value represents the category of the assessment to be run. If + this field is not provided, all assessment categories will be run.""" + sqlServerIpAddress: str + """The IP address of the SQL Server instance.""" + + +class SqlServerInstanceManagedInstanceLinkAssessmentResponse(TypedDict, total=False): # pylint: disable=name-too-long + """The response containing the results of the MI Link assessment. + + :ivar assessments: The list of the results for MI Link assessment. + :vartype assessments: list["SqlServerInstanceManagedInstanceLinkAssessment"] + """ + + assessments: list["SqlServerInstanceManagedInstanceLinkAssessment"] + """The list of the results for MI Link assessment.""" + + +class SqlServerInstanceMigrationReadinessReportResponse(TypedDict, total=False): # pylint: disable=name-too-long + """Represents the response containing the SQL Server Instance Migration Readiness report. + + :ivar report: The migration readiness report as a serialized JSON string. When isCompressed is + true, the value is base64-encoded GZip-compressed and must be decoded and decompressed before + parsing. + :vartype report: str + :ivar is_compressed: Indicates whether the report field contains base64-encoded GZip-compressed + JSON. + :vartype is_compressed: bool + :ivar created_time: The UTC timestamp in ISO 8601 format indicating when the migration + readiness report was created. + :vartype created_time: str + """ + + report: str + """The migration readiness report as a serialized JSON string. When isCompressed is true, the + value is base64-encoded GZip-compressed and must be decoded and decompressed before parsing.""" + isCompressed: bool + """Indicates whether the report field contains base64-encoded GZip-compressed JSON.""" + createdTime: str + """The UTC timestamp in ISO 8601 format indicating when the migration readiness report was + created.""" + + +class SqlServerInstanceProperties(TypedDict, total=False): + """Properties of SqlServerInstance. + + :ivar version: SQL Server version. Known values are: "Unknown", "SQL Server 2012", "SQL Server + 2014", "SQL Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "SQL + Server 2025". + :vartype version: Union[str, "SqlVersion"] + :ivar edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", + "Web", "Developer", "Express", "Business Intelligence", "Standard Developer", and "Unknown". + :vartype edition: Union[str, "EditionType"] + :ivar container_resource_id: ARM Resource id of the container resource (Azure Arc for Servers). + :vartype container_resource_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :ivar v_core: The number of logical processors used by the SQL Server instance. + :vartype v_core: str + :ivar cores: The number of total cores of the Operating System Environment (OSE) hosting the + SQL Server instance. + :vartype cores: str + :ivar status: The cloud connectivity status. Known values are: "Connected", "Disconnected", + "Registered", "Discovered", and "Unknown". + :vartype status: Union[str, "ConnectionStatus"] + :ivar discovery_source: Indicates the discovery agent or client for this instance. Known values + are: "Azure Arc", "Azure Migrate", "ADS", "SSMS", "SSMA", "Import", "DMS-Portal", "DMS-PS", + "DMS-CLI", "DMS-SDK", and "Other". + :vartype discovery_source: Union[str, "DiscoverySource"] + :ivar patch_level: SQL Server update level. + :vartype patch_level: str + :ivar collation: SQL Server collation. + :vartype collation: str + :ivar db_master_key_exists: Indicates whether database master key exists in SQL Server. + :vartype db_master_key_exists: bool + :ivar is_hadr_enabled: Indicates whether always On availability groups is enabled in SQL + Server. + :vartype is_hadr_enabled: bool + :ivar trace_flags: An array of integers, where each value represents the enabled trace flags in + SQL Server. + :vartype trace_flags: list[int] + :ivar current_version: SQL Server current version. + :vartype current_version: str + :ivar instance_name: SQL Server instance name. + :vartype instance_name: str + :ivar tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :vartype tcp_dynamic_ports: str + :ivar tcp_static_ports: Static TCP ports used by SQL Server. + :vartype tcp_static_ports: str + :ivar product_id: SQL Server product ID. + :vartype product_id: str + :ivar license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", + "ServerCAL", "LicenseOnly", "PAYG", "Paid", and "FabricCapacity". + :vartype license_type: Union[str, "ArcSqlServerLicenseType"] + :ivar azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :vartype azure_defender_status_last_updated: str + :ivar azure_defender_status: Status of Azure Defender. Known values are: "Protected", + "Unprotected", and "Unknown". + :vartype azure_defender_status: Union[str, "DefenderStatus"] + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server resource. + :vartype provisioning_state: str + :ivar last_inventory_upload_time: The time when last successful inventory upload was performed. + :vartype last_inventory_upload_time: str + :ivar last_usage_upload_time: The time when last successful usage upload was performed. + :vartype last_usage_upload_time: str + :ivar host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual + Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual + Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", + "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual + Machine", "Hyper-V Virtual Machine", and "Other". + :vartype host_type: Union[str, "HostType"] + :ivar always_on_role: The role of the SQL Server, based on availability. Known values are: + "None", "FailoverClusterInstance", "FailoverClusterNode", and "AvailabilityGroupReplica". + :vartype always_on_role: Union[str, "AlwaysOnRole"] + :ivar database_mirroring_endpoint: Database mirroring endpoint related properties. + :vartype database_mirroring_endpoint: "DBMEndpoint" + :ivar failover_cluster: Failover Cluster Instance properties. + :vartype failover_cluster: "FailoverCluster" + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: "BackupPolicy" + :ivar upgrade_locked_until: Upgrade Action for this resource is locked until it expires. The + Expiration time indicated by this value. It is not locked when it is empty. + :vartype upgrade_locked_until: str + :ivar monitoring: The monitoring configuration. + :vartype monitoring: "Monitoring" + :ivar migration: Migration related configuration and status. + :vartype migration: "Migration" + :ivar best_practices_assessment: The configuration related to SQL best practices assessment. + :vartype best_practices_assessment: "BestPracticesAssessment" + :ivar client_connection: Client connection related configuration. + :vartype client_connection: "ClientConnection" + :ivar service_type: Indicates if the resource represents a SQL Server engine or a SQL Server + component service installed on the host. Known values are: "Engine", "SSRS", "SSAS", "SSIS", + and "PBIRS". + :vartype service_type: Union[str, "ServiceType"] + :ivar max_server_memory_mb: maximum server memory (MB) value configured for this instance. + :vartype max_server_memory_mb: int + :ivar is_microsoft_pki_cert_trust_configured: Indicates whether Microsoft PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_microsoft_pki_cert_trust_configured: bool + :ivar is_digi_cert_pki_cert_trust_configured: Indicates whether DigiCert PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_digi_cert_pki_cert_trust_configured: bool + :ivar authentication: Authentication related configuration for the SQL Server Instance. + :vartype authentication: "Authentication" + """ + + version: Union[str, "SqlVersion"] + """SQL Server version. Known values are: \"Unknown\", \"SQL Server 2012\", \"SQL Server 2014\", + \"SQL Server 2016\", \"SQL Server 2017\", \"SQL Server 2019\", \"SQL Server 2022\", and \"SQL + Server 2025\".""" + edition: Union[str, "EditionType"] + """SQL Server edition. Known values are: \"Evaluation\", \"Enterprise\", \"Standard\", \"Web\", + \"Developer\", \"Express\", \"Business Intelligence\", \"Standard Developer\", and \"Unknown\".""" + containerResourceId: str + """ARM Resource id of the container resource (Azure Arc for Servers).""" + vmId: str + """The unique ID of the hybrid machine that this resource belongs to.""" + createTime: str + """The time when the resource was created.""" + vCore: str + """The number of logical processors used by the SQL Server instance.""" + cores: str + """The number of total cores of the Operating System Environment (OSE) hosting the SQL Server + instance.""" + status: Union[str, "ConnectionStatus"] + """The cloud connectivity status. Known values are: \"Connected\", \"Disconnected\", + \"Registered\", \"Discovered\", and \"Unknown\".""" + discoverySource: Union[str, "DiscoverySource"] + """Indicates the discovery agent or client for this instance. Known values are: \"Azure Arc\", + \"Azure Migrate\", \"ADS\", \"SSMS\", \"SSMA\", \"Import\", \"DMS-Portal\", \"DMS-PS\", + \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + patchLevel: str + """SQL Server update level.""" + collation: str + """SQL Server collation.""" + dbMasterKeyExists: bool + """Indicates whether database master key exists in SQL Server.""" + isHadrEnabled: bool + """Indicates whether always On availability groups is enabled in SQL Server.""" + traceFlags: list[int] + """An array of integers, where each value represents the enabled trace flags in SQL Server.""" + currentVersion: str + """SQL Server current version.""" + instanceName: str + """SQL Server instance name.""" + tcpDynamicPorts: str + """Dynamic TCP ports used by SQL Server.""" + tcpStaticPorts: str + """Static TCP ports used by SQL Server.""" + productId: str + """SQL Server product ID.""" + licenseType: Union[str, "ArcSqlServerLicenseType"] + """SQL Server license type. Known values are: \"Undefined\", \"Free\", \"HADR\", \"ServerCAL\", + \"LicenseOnly\", \"PAYG\", \"Paid\", and \"FabricCapacity\".""" + azureDefenderStatusLastUpdated: str + """Timestamp of last Azure Defender status update.""" + azureDefenderStatus: Union[str, "DefenderStatus"] + """Status of Azure Defender. Known values are: \"Protected\", \"Unprotected\", and \"Unknown\".""" + provisioningState: str + """The provisioning state of the Arc-enabled SQL Server resource.""" + lastInventoryUploadTime: str + """The time when last successful inventory upload was performed.""" + lastUsageUploadTime: str + """The time when last successful usage upload was performed.""" + hostType: Union[str, "HostType"] + """Type of host for Azure Arc SQL Server. Known values are: \"Azure Virtual Machine\", \"Azure + VMWare Virtual Machine\", \"Azure Kubernetes Service\", \"AWS VMWare Virtual Machine\", \"AWS + Kubernetes Service\", \"GCP VMWare Virtual Machine\", \"GCP Kubernetes Service\", + \"Container\", \"Virtual Machine\", \"Physical Server\", \"AWS Virtual Machine\", \"GCP Virtual + Machine\", \"Hyper-V Virtual Machine\", and \"Other\".""" + alwaysOnRole: Union[str, "AlwaysOnRole"] + """The role of the SQL Server, based on availability. Known values are: \"None\", + \"FailoverClusterInstance\", \"FailoverClusterNode\", and \"AvailabilityGroupReplica\".""" + databaseMirroringEndpoint: "DBMEndpoint" + """Database mirroring endpoint related properties.""" + failoverCluster: "FailoverCluster" + """Failover Cluster Instance properties.""" + backupPolicy: "BackupPolicy" + """The backup profile for the SQL server.""" + upgradeLockedUntil: str + """Upgrade Action for this resource is locked until it expires. The Expiration time indicated by + this value. It is not locked when it is empty.""" + monitoring: "Monitoring" + """The monitoring configuration.""" + migration: "Migration" + """Migration related configuration and status.""" + bestPracticesAssessment: "BestPracticesAssessment" + """The configuration related to SQL best practices assessment.""" + clientConnection: "ClientConnection" + """Client connection related configuration.""" + serviceType: Union[str, "ServiceType"] + """Indicates if the resource represents a SQL Server engine or a SQL Server component service + installed on the host. Known values are: \"Engine\", \"SSRS\", \"SSAS\", \"SSIS\", and + \"PBIRS\".""" + maxServerMemoryMB: int + """maximum server memory (MB) value configured for this instance.""" + isMicrosoftPkiCertTrustConfigured: bool + """Indicates whether Microsoft PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + isDigiCertPkiCertTrustConfigured: bool + """Indicates whether DigiCert PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + authentication: "Authentication" + """Authentication related configuration for the SQL Server Instance.""" + + +class SqlServerInstanceRunBestPracticesAssessmentResponse(TypedDict, total=False): # pylint: disable=name-too-long + """The response object for the request to run SQL best practices assessment. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: "BackgroundJob" + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list["SequencerAction"] + """ + + id: str + """The unique identifier of the job.""" + instanceName: str + """The name of the SQL Server instance.""" + jobStatus: Union[str, "JobStatus"] + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + jobException: str + """The exception message if the job failed.""" + backgroundJob: "BackgroundJob" + """The background job details.""" + sequencerActions: list["SequencerAction"] + """The list of sequencer actions.""" + + +class SqlServerInstanceRunMigrationAssessmentResponse(TypedDict, total=False): # pylint: disable=name-too-long + """The response for running migration assessment on the SQL Server instance. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: "BackgroundJob" + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list["SequencerAction"] + """ + + id: str + """The unique identifier of the job.""" + instanceName: str + """The name of the SQL Server instance.""" + jobStatus: Union[str, "JobStatus"] + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + jobException: str + """The exception message if the job failed.""" + backgroundJob: "BackgroundJob" + """The background job details.""" + sequencerActions: list["SequencerAction"] + """The list of sequencer actions.""" + + +class SqlServerInstanceRunMigrationReadinessAssessmentResponse(TypedDict, total=False): # pylint: disable=name-too-long + """The response object for the request to run migration readiness assessment. + + :ivar id: The unique identifier of the job. + :vartype id: str + :ivar instance_name: The name of the SQL Server instance. + :vartype instance_name: str + :ivar job_status: The status of the job. Known values are: "NotStarted", "InProgress", + "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar job_exception: The exception message if the job failed. + :vartype job_exception: str + :ivar background_job: The background job details. + :vartype background_job: "BackgroundJob" + :ivar sequencer_actions: The list of sequencer actions. + :vartype sequencer_actions: list["SequencerAction"] + """ + + id: str + """The unique identifier of the job.""" + instanceName: str + """The name of the SQL Server instance.""" + jobStatus: Union[str, "JobStatus"] + """The status of the job. Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and + \"Failed\".""" + jobException: str + """The exception message if the job failed.""" + backgroundJob: "BackgroundJob" + """The background job details.""" + sequencerActions: list["SequencerAction"] + """The list of sequencer actions.""" + + +class SqlServerInstanceRunTargetRecommendationJobRequest(TypedDict, total=False): # pylint: disable=name-too-long + """The request for running a SQL Server Instance target recommendation job. + + :ivar resource_update_mode: Controls whether the SQL Server instance resource is updated with + the target recommendation details after the job completes. Known values are: + "UpdateAllTargetRecommendationDetails" and "SkipResourceUpdate". + :vartype resource_update_mode: Union[str, "ResourceUpdateMode"] + :ivar include_file_level_requirements: Specifies whether to include file-level requirements in + the target recommendation report. + :vartype include_file_level_requirements: bool + :ivar target_location: The Azure region used for target SKU pricing and availability (e.g., + 'westus', 'eastus2', 'westeurope'). + :vartype target_location: str + :ivar percentile: The percentile of performance data points used for aggregation (Range: + 1-100). + :vartype percentile: int + :ivar lookback_period_in_days: The lookback period in days for performance data used in the + target recommendation. + :vartype lookback_period_in_days: int + """ + + resourceUpdateMode: Union[str, "ResourceUpdateMode"] + """Controls whether the SQL Server instance resource is updated with the target recommendation + details after the job completes. Known values are: \"UpdateAllTargetRecommendationDetails\" and + \"SkipResourceUpdate\".""" + includeFileLevelRequirements: bool + """Specifies whether to include file-level requirements in the target recommendation report.""" + targetLocation: str + """The Azure region used for target SKU pricing and availability (e.g., 'westus', 'eastus2', + 'westeurope').""" + percentile: int + """The percentile of performance data points used for aggregation (Range: 1-100).""" + lookbackPeriodInDays: int + """The lookback period in days for performance data used in the target recommendation.""" + + +class SqlServerInstanceRunTargetRecommendationJobResponse(TypedDict, total=False): # pylint: disable=name-too-long + """Represents the response of a SQL Server Instance target recommendation job execution. + + :ivar job_status: Represents the current status of the target recommendation job. Known values + are: "NotStarted", "InProgress", "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + """ + + jobStatus: Union[str, "JobStatus"] + """Represents the current status of the target recommendation job. Known values are: + \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\".""" + + +class SqlServerInstanceTargetRecommendationReport(TypedDict, total=False): # pylint: disable=name-too-long + """Represents a target recommendation report for a SQL Server instance. + + :ivar report_id: The identifier of the target recommendation report. + :vartype report_id: str + :ivar created_time: The UTC timestamp in ISO 8601 format indicating when the target + recommendation report was generated. + :vartype created_time: str + :ivar sections: Collection of sections included in the report. + :vartype sections: list["SqlServerInstanceTargetRecommendationReportSection"] + """ + + reportId: str + """The identifier of the target recommendation report.""" + createdTime: str + """The UTC timestamp in ISO 8601 format indicating when the target recommendation report was + generated.""" + sections: list["SqlServerInstanceTargetRecommendationReportSection"] + """Collection of sections included in the report.""" + + +class SqlServerInstanceTargetRecommendationReportSection(TypedDict, total=False): # pylint: disable=name-too-long + """Represents a section within a target recommendation report. + + :ivar data: Serialized JSON representation of the section data. If isCompressed is true, the + value contains base64-encoded GZip-compressed JSON. + :vartype data: str + :ivar type: The type of this section. Requirements sections contain source server performance + metrics, while recommendation sections contain suggested Azure target SKUs. Known values are: + "RequirementsPerInstance", "RequirementsPerDatabase", "FileRequirementsPerDatabase", + "SqlVmTargetRecommendationPerInstance", "SqlMiTargetRecommendationPerInstance", and + "SqlDbTargetRecommendationPerDatabase". + :vartype type: Union[str, "SqlServerInstanceTargetRecommendationReportSectionType"] + :ivar database_name: The name of the database to which this section applies. An empty string + indicates that the section contains instance-level data rather than database-level data. + :vartype database_name: str + :ivar is_compressed: Indicates whether the data field contains base64-encoded GZip-compressed + JSON. + :vartype is_compressed: bool + """ + + data: str + """Serialized JSON representation of the section data. If isCompressed is true, the value contains + base64-encoded GZip-compressed JSON.""" + type: Union[str, "SqlServerInstanceTargetRecommendationReportSectionType"] + """The type of this section. Requirements sections contain source server performance metrics, + while recommendation sections contain suggested Azure target SKUs. Known values are: + \"RequirementsPerInstance\", \"RequirementsPerDatabase\", \"FileRequirementsPerDatabase\", + \"SqlVmTargetRecommendationPerInstance\", \"SqlMiTargetRecommendationPerInstance\", and + \"SqlDbTargetRecommendationPerDatabase\".""" + databaseName: str + """The name of the database to which this section applies. An empty string indicates that the + section contains instance-level data rather than database-level data.""" + isCompressed: bool + """Indicates whether the data field contains base64-encoded GZip-compressed JSON.""" + + +class SqlServerInstanceTargetRecommendationReportsRequest(TypedDict, total=False): # pylint: disable=name-too-long + """The request for retrieving SQL Server Instance target recommendation reports. + + :ivar report_offset: Zero-based offset indicating where to continue reading reports in the + overall list of reports. Defaults to 0 if not provided. This value must be used together with + the corresponding sectionOffset to resume pagination. The reportOffset advances only after all + sections of the current report have been retrieved. To retrieve subsequent pages, use the + nextReportOffset and nextSectionOffset values from the previous response. + :vartype report_offset: int + :ivar section_offset: Zero-based offset indicating where to continue reading sections within + the current report. Defaults to 0 if not provided. This value must be used together with the + corresponding reportOffset to resume pagination. To retrieve subsequent pages, use the + nextReportOffset and nextSectionOffset values from the previous response. + :vartype section_offset: int + :ivar section_type: Filters the report to a specific section type. If not specified, all + section types are returned. Section types are grouped into two categories: requirements + sections contain performance and resource metrics collected from the source SQL Server, while + recommendation sections contain suggested Azure target SKUs derived from those requirements. + Known values are: "RequirementsPerInstance", "RequirementsPerDatabase", + "FileRequirementsPerDatabase", "SqlVmTargetRecommendationPerInstance", + "SqlMiTargetRecommendationPerInstance", and "SqlDbTargetRecommendationPerDatabase". + :vartype section_type: Union[str, "SqlServerInstanceTargetRecommendationReportSectionType"] + :ivar database_names: The list of database names to filter the report sections by. If not + specified, sections for all databases are returned. + :vartype database_names: list[str] + """ + + reportOffset: int + """Zero-based offset indicating where to continue reading reports in the overall list of reports. + Defaults to 0 if not provided. This value must be used together with the corresponding + sectionOffset to resume pagination. The reportOffset advances only after all sections of the + current report have been retrieved. To retrieve subsequent pages, use the nextReportOffset and + nextSectionOffset values from the previous response.""" + sectionOffset: int + """Zero-based offset indicating where to continue reading sections within the current report. + Defaults to 0 if not provided. This value must be used together with the corresponding + reportOffset to resume pagination. To retrieve subsequent pages, use the nextReportOffset and + nextSectionOffset values from the previous response.""" + sectionType: Union[str, "SqlServerInstanceTargetRecommendationReportSectionType"] + """Filters the report to a specific section type. If not specified, all section types are + returned. Section types are grouped into two categories: requirements sections contain + performance and resource metrics collected from the source SQL Server, while recommendation + sections contain suggested Azure target SKUs derived from those requirements. Known values are: + \"RequirementsPerInstance\", \"RequirementsPerDatabase\", \"FileRequirementsPerDatabase\", + \"SqlVmTargetRecommendationPerInstance\", \"SqlMiTargetRecommendationPerInstance\", and + \"SqlDbTargetRecommendationPerDatabase\".""" + databaseNames: list[str] + """The list of database names to filter the report sections by. If not specified, sections for all + databases are returned.""" + + +class SqlServerInstanceTargetRecommendationReportsResponse(TypedDict, total=False): # pylint: disable=name-too-long + """Represents the response containing SQL Server Instance target recommendation reports. + + :ivar job_status: Represents the status of the latest target recommendation job. Report records + are returned only when the job status is Succeeded. Known values are: "NotStarted", + "InProgress", "Succeeded", and "Failed". + :vartype job_status: Union[str, "JobStatus"] + :ivar reports: A collection of target recommendation reports. Returned only when the job status + is Succeeded. + :vartype reports: list["SqlServerInstanceTargetRecommendationReport"] + :ivar total_report_count: The total number of target recommendation reports available for + retrieval. Currently, only the latest report is returned, so this value is always 1. + :vartype total_report_count: int + :ivar next_report_offset: The report offset to use in the next request along with + nextSectionOffset to continue retrieving data. This value remains the same until all sections + of the current report have been retrieved. Present only when there is more data to retrieve. + When both nextReportOffset and nextSectionOffset are absent, all data has been returned. + :vartype next_report_offset: int + :ivar next_section_offset: The section offset to use in the next request along with + nextReportOffset to continue retrieving sections of the current report. Present only when there + is more data to retrieve. When both nextReportOffset and nextSectionOffset are absent, all data + has been returned. + :vartype next_section_offset: int + """ + + jobStatus: Union[str, "JobStatus"] + """Represents the status of the latest target recommendation job. Report records are returned only + when the job status is Succeeded. Known values are: \"NotStarted\", \"InProgress\", + \"Succeeded\", and \"Failed\".""" + reports: list["SqlServerInstanceTargetRecommendationReport"] + """A collection of target recommendation reports. Returned only when the job status is Succeeded.""" + totalReportCount: int + """The total number of target recommendation reports available for retrieval. Currently, only the + latest report is returned, so this value is always 1.""" + nextReportOffset: int + """The report offset to use in the next request along with nextSectionOffset to continue + retrieving data. This value remains the same until all sections of the current report have been + retrieved. Present only when there is more data to retrieve. When both nextReportOffset and + nextSectionOffset are absent, all data has been returned.""" + nextSectionOffset: int + """The section offset to use in the next request along with nextReportOffset to continue + retrieving sections of the current report. Present only when there is more data to retrieve. + When both nextReportOffset and nextSectionOffset are absent, all data has been returned.""" + + +class SqlServerInstanceTelemetryColumn(TypedDict, total=False): + """The telemetry column for the SQL Server instance. + + :ivar name: The name of the telemetry column. + :vartype name: str + :ivar type: The type of the telemetry column. Known values are: "bool", "datetime", "int", + "long", "double", "string", "guid", and "timespan". + :vartype type: Union[str, "SqlServerInstanceTelemetryColumnType"] + """ + + name: str + """The name of the telemetry column.""" + type: Union[str, "SqlServerInstanceTelemetryColumnType"] + """The type of the telemetry column. Known values are: \"bool\", \"datetime\", \"int\", \"long\", + \"double\", \"string\", \"guid\", and \"timespan\".""" + + +class SqlServerInstanceTelemetryRequest(TypedDict, total=False): + """The Arc SQL Server instance telemetry retrieval request. + + :ivar dataset_name: The name of the telemetry dataset to retrieve. Required. + :vartype dataset_name: str + :ivar start_time: The start time for the time range to fetch telemetry for. If not specified, + the current time minus 1 hour is used. + :vartype start_time: str + :ivar end_time: The end time for the time range to fetch telemetry for. If not specified, the + current time is used. + :vartype end_time: str + :ivar interval: The time granularity to fetch telemetry for. This is an ISO8601 duration. + Examples: PT15M, PT1H, P1D. + :vartype interval: str + :ivar aggregation_type: The aggregation type to use for the numerical columns in the dataset. + Known values are: "Average", "Minimum", "Maximum", "Sum", and "Count". + :vartype aggregation_type: Union[str, "AggregationType"] + :ivar database_names: The list of database names to return telemetry for. If not specified, + telemetry for all databases will be aggregated and returned. + :vartype database_names: list[str] + """ + + datasetName: Required[str] + """The name of the telemetry dataset to retrieve. Required.""" + startTime: str + """The start time for the time range to fetch telemetry for. If not specified, the current time + minus 1 hour is used.""" + endTime: str + """The end time for the time range to fetch telemetry for. If not specified, the current time is + used.""" + interval: str + """The time granularity to fetch telemetry for. This is an ISO8601 duration. Examples: PT15M, + PT1H, P1D.""" + aggregationType: Union[str, "AggregationType"] + """The aggregation type to use for the numerical columns in the dataset. Known values are: + \"Average\", \"Minimum\", \"Maximum\", \"Sum\", and \"Count\".""" + databaseNames: list[str] + """The list of database names to return telemetry for. If not specified, telemetry for all + databases will be aggregated and returned.""" + + +class SqlServerInstanceUpdate(TypedDict, total=False): + """An update to a SQL Server Instance. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: "SqlServerInstanceUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "SqlServerInstanceUpdateProperties" + """null.""" + + +class SqlServerInstanceUpdateProperties(TypedDict, total=False): + """Properties of update SqlServerInstance. + + :ivar version: SQL Server version. Known values are: "Unknown", "SQL Server 2012", "SQL Server + 2014", "SQL Server 2016", "SQL Server 2017", "SQL Server 2019", "SQL Server 2022", and "SQL + Server 2025". + :vartype version: Union[str, "SqlVersion"] + :ivar edition: SQL Server edition. Known values are: "Evaluation", "Enterprise", "Standard", + "Web", "Developer", "Express", "Business Intelligence", "Standard Developer", and "Unknown". + :vartype edition: Union[str, "EditionType"] + :ivar container_resource_id: ARM Resource id of the container resource (Azure Arc for Servers). + :vartype container_resource_id: str + :ivar vm_id: The unique ID of the hybrid machine that this resource belongs to. + :vartype vm_id: str + :ivar create_time: The time when the resource was created. + :vartype create_time: str + :ivar v_core: The number of logical processors used by the SQL Server instance. + :vartype v_core: str + :ivar cores: The number of total cores of the Operating System Environment (OSE) hosting the + SQL Server instance. + :vartype cores: str + :ivar status: The cloud connectivity status. Known values are: "Connected", "Disconnected", + "Registered", "Discovered", and "Unknown". + :vartype status: Union[str, "ConnectionStatus"] + :ivar discovery_source: Indicates the discovery agent or client for this instance. Default is + Azure Arc. Known values are: "Azure Arc", "Azure Migrate", "ADS", "SSMS", "SSMA", "Import", + "DMS-Portal", "DMS-PS", "DMS-CLI", "DMS-SDK", and "Other". + :vartype discovery_source: Union[str, "DiscoverySource"] + :ivar patch_level: SQL Server update level. + :vartype patch_level: str + :ivar collation: SQL Server collation. + :vartype collation: str + :ivar db_master_key_exists: Indicates whether database master key exists in SQL Server. + :vartype db_master_key_exists: bool + :ivar is_hadr_enabled: Indicates whether always On availability groups is enabled in SQL + Server. + :vartype is_hadr_enabled: bool + :ivar trace_flags: An array of integers, where each value represents the enabled trace flags in + SQL Server. + :vartype trace_flags: list[int] + :ivar current_version: SQL Server current version. + :vartype current_version: str + :ivar instance_name: SQL Server instance name. + :vartype instance_name: str + :ivar tcp_dynamic_ports: Dynamic TCP ports used by SQL Server. + :vartype tcp_dynamic_ports: str + :ivar tcp_static_ports: Static TCP ports used by SQL Server. + :vartype tcp_static_ports: str + :ivar product_id: SQL Server product ID. + :vartype product_id: str + :ivar license_type: SQL Server license type. Known values are: "Undefined", "Free", "HADR", + "ServerCAL", "LicenseOnly", "PAYG", "Paid", and "FabricCapacity". + :vartype license_type: Union[str, "ArcSqlServerLicenseType"] + :ivar azure_defender_status_last_updated: Timestamp of last Azure Defender status update. + :vartype azure_defender_status_last_updated: str + :ivar azure_defender_status: Status of Azure Defender. Known values are: "Protected", + "Unprotected", and "Unknown". + :vartype azure_defender_status: Union[str, "DefenderStatus"] + :ivar provisioning_state: The provisioning state of the Arc-enabled SQL Server resource. + :vartype provisioning_state: str + :ivar last_inventory_upload_time: The time when last successful inventory upload was performed. + :vartype last_inventory_upload_time: str + :ivar last_usage_upload_time: The time when last successful usage upload was performed. + :vartype last_usage_upload_time: str + :ivar host_type: Type of host for Azure Arc SQL Server. Known values are: "Azure Virtual + Machine", "Azure VMWare Virtual Machine", "Azure Kubernetes Service", "AWS VMWare Virtual + Machine", "AWS Kubernetes Service", "GCP VMWare Virtual Machine", "GCP Kubernetes Service", + "Container", "Virtual Machine", "Physical Server", "AWS Virtual Machine", "GCP Virtual + Machine", "Hyper-V Virtual Machine", and "Other". + :vartype host_type: Union[str, "HostType"] + :ivar always_on_role: The role of the SQL Server, based on availability. Known values are: + "None", "FailoverClusterInstance", "FailoverClusterNode", and "AvailabilityGroupReplica". + :vartype always_on_role: Union[str, "AlwaysOnRole"] + :ivar failover_cluster: Failover Cluster Instance properties. + :vartype failover_cluster: "FailoverCluster" + :ivar backup_policy: The backup profile for the SQL server. + :vartype backup_policy: "BackupPolicy" + :ivar upgrade_locked_until: Upgrade Action for this resource is locked until it expires. The + Expiration time indicated by this value. It is not locked when it is empty. + :vartype upgrade_locked_until: str + :ivar monitoring: The monitoring configuration. + :vartype monitoring: "Monitoring" + :ivar migration: Migration related configuration. + :vartype migration: "Migration" + :ivar best_practices_assessment: The configuration related to SQL best practices assessment. + :vartype best_practices_assessment: "BestPracticesAssessment" + :ivar client_connection: Client connection related configuration. + :vartype client_connection: "ClientConnection" + :ivar service_type: Indicates if the resource represents a SQL Server engine or a SQL Server + component service installed on the host. Known values are: "Engine", "SSRS", "SSAS", "SSIS", + and "PBIRS". + :vartype service_type: Union[str, "ServiceType"] + :ivar authentication: Authentication related configuration for the SQL Server Instance. + :vartype authentication: "Authentication" + :ivar database_mirroring_endpoint: Database mirroring endpoint related properties. + :vartype database_mirroring_endpoint: "DBMEndpoint" + :ivar is_microsoft_pki_cert_trust_configured: Indicates whether Microsoft PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_microsoft_pki_cert_trust_configured: bool + :ivar is_digi_cert_pki_cert_trust_configured: Indicates whether DigiCert PKI root-authority + certificate (trusted by Azure) exists in SQL Server and trusted for Azure database.windows.net + domains. + :vartype is_digi_cert_pki_cert_trust_configured: bool + :ivar max_server_memory_mb: maximum server memory (MB) value configured for this instance. + :vartype max_server_memory_mb: int + """ + + version: Union[str, "SqlVersion"] + """SQL Server version. Known values are: \"Unknown\", \"SQL Server 2012\", \"SQL Server 2014\", + \"SQL Server 2016\", \"SQL Server 2017\", \"SQL Server 2019\", \"SQL Server 2022\", and \"SQL + Server 2025\".""" + edition: Union[str, "EditionType"] + """SQL Server edition. Known values are: \"Evaluation\", \"Enterprise\", \"Standard\", \"Web\", + \"Developer\", \"Express\", \"Business Intelligence\", \"Standard Developer\", and \"Unknown\".""" + containerResourceId: str + """ARM Resource id of the container resource (Azure Arc for Servers).""" + vmId: str + """The unique ID of the hybrid machine that this resource belongs to.""" + createTime: str + """The time when the resource was created.""" + vCore: str + """The number of logical processors used by the SQL Server instance.""" + cores: str + """The number of total cores of the Operating System Environment (OSE) hosting the SQL Server + instance.""" + status: Union[str, "ConnectionStatus"] + """The cloud connectivity status. Known values are: \"Connected\", \"Disconnected\", + \"Registered\", \"Discovered\", and \"Unknown\".""" + discoverySource: Union[str, "DiscoverySource"] + """Indicates the discovery agent or client for this instance. Default is Azure Arc. Known values + are: \"Azure Arc\", \"Azure Migrate\", \"ADS\", \"SSMS\", \"SSMA\", \"Import\", \"DMS-Portal\", + \"DMS-PS\", \"DMS-CLI\", \"DMS-SDK\", and \"Other\".""" + patchLevel: str + """SQL Server update level.""" + collation: str + """SQL Server collation.""" + dbMasterKeyExists: bool + """Indicates whether database master key exists in SQL Server.""" + isHadrEnabled: bool + """Indicates whether always On availability groups is enabled in SQL Server.""" + traceFlags: list[int] + """An array of integers, where each value represents the enabled trace flags in SQL Server.""" + currentVersion: str + """SQL Server current version.""" + instanceName: str + """SQL Server instance name.""" + tcpDynamicPorts: str + """Dynamic TCP ports used by SQL Server.""" + tcpStaticPorts: str + """Static TCP ports used by SQL Server.""" + productId: str + """SQL Server product ID.""" + licenseType: Union[str, "ArcSqlServerLicenseType"] + """SQL Server license type. Known values are: \"Undefined\", \"Free\", \"HADR\", \"ServerCAL\", + \"LicenseOnly\", \"PAYG\", \"Paid\", and \"FabricCapacity\".""" + azureDefenderStatusLastUpdated: str + """Timestamp of last Azure Defender status update.""" + azureDefenderStatus: Union[str, "DefenderStatus"] + """Status of Azure Defender. Known values are: \"Protected\", \"Unprotected\", and \"Unknown\".""" + provisioningState: str + """The provisioning state of the Arc-enabled SQL Server resource.""" + lastInventoryUploadTime: str + """The time when last successful inventory upload was performed.""" + lastUsageUploadTime: str + """The time when last successful usage upload was performed.""" + hostType: Union[str, "HostType"] + """Type of host for Azure Arc SQL Server. Known values are: \"Azure Virtual Machine\", \"Azure + VMWare Virtual Machine\", \"Azure Kubernetes Service\", \"AWS VMWare Virtual Machine\", \"AWS + Kubernetes Service\", \"GCP VMWare Virtual Machine\", \"GCP Kubernetes Service\", + \"Container\", \"Virtual Machine\", \"Physical Server\", \"AWS Virtual Machine\", \"GCP Virtual + Machine\", \"Hyper-V Virtual Machine\", and \"Other\".""" + alwaysOnRole: Union[str, "AlwaysOnRole"] + """The role of the SQL Server, based on availability. Known values are: \"None\", + \"FailoverClusterInstance\", \"FailoverClusterNode\", and \"AvailabilityGroupReplica\".""" + failoverCluster: "FailoverCluster" + """Failover Cluster Instance properties.""" + backupPolicy: "BackupPolicy" + """The backup profile for the SQL server.""" + upgradeLockedUntil: str + """Upgrade Action for this resource is locked until it expires. The Expiration time indicated by + this value. It is not locked when it is empty.""" + monitoring: "Monitoring" + """The monitoring configuration.""" + migration: "Migration" + """Migration related configuration.""" + bestPracticesAssessment: "BestPracticesAssessment" + """The configuration related to SQL best practices assessment.""" + clientConnection: "ClientConnection" + """Client connection related configuration.""" + serviceType: Union[str, "ServiceType"] + """Indicates if the resource represents a SQL Server engine or a SQL Server component service + installed on the host. Known values are: \"Engine\", \"SSRS\", \"SSAS\", \"SSIS\", and + \"PBIRS\".""" + authentication: "Authentication" + """Authentication related configuration for the SQL Server Instance.""" + databaseMirroringEndpoint: "DBMEndpoint" + """Database mirroring endpoint related properties.""" + isMicrosoftPkiCertTrustConfigured: bool + """Indicates whether Microsoft PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + isDigiCertPkiCertTrustConfigured: bool + """Indicates whether DigiCert PKI root-authority certificate (trusted by Azure) exists in SQL + Server and trusted for Azure database.windows.net domains.""" + maxServerMemoryMB: int + """maximum server memory (MB) value configured for this instance.""" + + +class SqlServerLicense(TrackedResource): + """Describe SQL Server license 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: "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: SQL Server license properties. Required. + :vartype properties: "SqlServerLicenseProperties" + """ + + properties: Required["SqlServerLicenseProperties"] + """SQL Server license properties. Required.""" + + +class SqlServerLicenseProperties(TypedDict, total=False): + """Properties of SQL Server License. + + :ivar billing_plan: SQL Server license type. Required. Known values are: "PAYG" and "Paid". + :vartype billing_plan: Union[str, "BillingPlan"] + :ivar physical_cores: The number of total cores of the license covers. Required. + :vartype physical_cores: int + :ivar license_category: This property represents the choice between SQL Server Core and ESU + licenses. Required. "Core" + :vartype license_category: Union[str, "LicenseCategory"] + :ivar activation_state: The activation state of the license. Required. Known values are: + "Activated" and "Deactivated". + :vartype activation_state: Union[str, "ActivationState"] + :ivar scope_type: The Azure scope to which the license will apply. Required. Known values are: + "Tenant", "Subscription", and "ResourceGroup". + :vartype scope_type: Union[str, "ScopeType"] + :ivar last_activated_at: The timestamp of the most recent activation of the SqlServerLicense. + :vartype last_activated_at: str + :ivar last_deactivated_at: The timestamp of the most recent deactivation of the + SqlServerLicense. + :vartype last_deactivated_at: str + :ivar tenant_id: The tenantId the SQL Server license resource subscription resides in. + :vartype tenant_id: str + """ + + billingPlan: Required[Union[str, "BillingPlan"]] + """SQL Server license type. Required. Known values are: \"PAYG\" and \"Paid\".""" + physicalCores: Required[int] + """The number of total cores of the license covers. Required.""" + licenseCategory: Required[Union[str, "LicenseCategory"]] + """This property represents the choice between SQL Server Core and ESU licenses. Required. + \"Core\"""" + activationState: Required[Union[str, "ActivationState"]] + """The activation state of the license. Required. Known values are: \"Activated\" and + \"Deactivated\".""" + scopeType: Required[Union[str, "ScopeType"]] + """The Azure scope to which the license will apply. Required. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + lastActivatedAt: str + """The timestamp of the most recent activation of the SqlServerLicense.""" + lastDeactivatedAt: str + """The timestamp of the most recent deactivation of the SqlServerLicense.""" + tenantId: str + """The tenantId the SQL Server license resource subscription resides in.""" + + +class SqlServerLicenseUpdate(TypedDict, total=False): + """An update to a SQL Server license resource. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: null. + :vartype properties: "SqlServerLicenseUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "SqlServerLicenseUpdateProperties" + """null.""" + + +class SqlServerLicenseUpdateProperties(TypedDict, total=False): + """Properties of update SqlServerLicense. + + :ivar billing_plan: SQL Server license type. Known values are: "PAYG" and "Paid". + :vartype billing_plan: Union[str, "BillingPlan"] + :ivar physical_cores: The number of total cores of the license covers. + :vartype physical_cores: int + :ivar license_category: This property represents the choice between SQL Server Core and ESU + licenses. "Core" + :vartype license_category: Union[str, "LicenseCategory"] + :ivar activation_state: The activation state of the license. Known values are: "Activated" and + "Deactivated". + :vartype activation_state: Union[str, "ActivationState"] + :ivar scope_type: The Azure scope to which the license will apply. Known values are: "Tenant", + "Subscription", and "ResourceGroup". + :vartype scope_type: Union[str, "ScopeType"] + :ivar last_activated_at: The timestamp of the most recent activation of the SqlServerLicense. + :vartype last_activated_at: str + :ivar last_deactivated_at: The timestamp of the most recent deactivation of the + SqlServerLicense. + :vartype last_deactivated_at: str + :ivar tenant_id: The tenantId the SQL Server license resource subscription resides in. + :vartype tenant_id: str + """ + + billingPlan: Union[str, "BillingPlan"] + """SQL Server license type. Known values are: \"PAYG\" and \"Paid\".""" + physicalCores: int + """The number of total cores of the license covers.""" + licenseCategory: Union[str, "LicenseCategory"] + """This property represents the choice between SQL Server Core and ESU licenses. \"Core\"""" + activationState: Union[str, "ActivationState"] + """The activation state of the license. Known values are: \"Activated\" and \"Deactivated\".""" + scopeType: Union[str, "ScopeType"] + """The Azure scope to which the license will apply. Known values are: \"Tenant\", + \"Subscription\", and \"ResourceGroup\".""" + lastActivatedAt: str + """The timestamp of the most recent activation of the SqlServerLicense.""" + lastDeactivatedAt: str + """The timestamp of the most recent deactivation of the SqlServerLicense.""" + tenantId: str + """The tenantId the SQL Server license resource subscription resides in.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: 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 TargetReadiness(TypedDict, total=False): + """The target readiness for migration for this database. + + :ivar azure_sql_database: The SKU recommendation summary. + :vartype azure_sql_database: "SkuRecommendationSummary" + :ivar azure_sql_managed_instance: The SKU recommendation summary. + :vartype azure_sql_managed_instance: "SkuRecommendationSummary" + :ivar azure_sql_virtual_machine: The SKU recommendation summary. + :vartype azure_sql_virtual_machine: "SkuRecommendationSummary" + """ + + azureSqlDatabase: "SkuRecommendationSummary" + """The SKU recommendation summary.""" + azureSqlManagedInstance: "SkuRecommendationSummary" + """The SKU recommendation summary.""" + azureSqlVirtualMachine: "SkuRecommendationSummary" + """The SKU recommendation summary.""" + + +class UploadServicePrincipal(TypedDict, total=False): + """Service principal for uploading billing, metrics and logs. + + :ivar client_id: Client ID of the service principal for uploading data. + :vartype client_id: str + :ivar tenant_id: Tenant ID of the service principal. + :vartype tenant_id: str + :ivar authority: Authority for the service principal. Example: + `https://login.microsoftonline.com/ `_. + :vartype authority: str + :ivar client_secret: Secret of the service principal. + :vartype client_secret: str + """ + + clientId: str + """Client ID of the service principal for uploading data.""" + tenantId: str + """Tenant ID of the service principal.""" + authority: str + """Authority for the service principal. Example: `https://login.microsoftonline.com/ + `_.""" + clientSecret: str + """Secret of the service principal.""" + + +class UploadWatermark(TypedDict, total=False): + """Properties on upload watermark. Mostly timestamp for each upload data type. + + :ivar metrics: Last uploaded date for metrics from kubernetes cluster. Defaults to current date + time. + :vartype metrics: str + :ivar logs: Last uploaded date for logs from kubernetes cluster. Defaults to current date time. + :vartype logs: str + :ivar usages: Last uploaded date for usages from kubernetes cluster. Defaults to current date + time. + :vartype usages: str + """ + + metrics: str + """Last uploaded date for metrics from kubernetes cluster. Defaults to current date time.""" + logs: str + """Last uploaded date for logs from kubernetes cluster. Defaults to current date time.""" + usages: str + """Last uploaded date for usages from kubernetes cluster. Defaults to current date time.""" diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/add_databases_to_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/add_databases_to_availability_group.py new file mode 100644 index 000000000000..74706a1ebfb1 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/add_databases_to_availability_group.py @@ -0,0 +1,44 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python add_databases_to_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.add_databases( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + databases={"values": ["db1", "db2", "db3"]}, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/AddDatabasesToAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_active_directory_connector.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_active_directory_connector.py index bbff613e2d5d..355e582e185f 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_active_directory_connector.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_active_directory_connector.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.active_directory_connectors.begin_create( @@ -61,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateActiveDirectoryConnector.json +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateActiveDirectoryConnector.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..36f83e51b40f --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_availability_group.py @@ -0,0 +1,78 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.create( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + sql_server_availability_group_resource={ + "location": "southeastasia", + "properties": { + "databases": {"value": [{"databaseName": "db1"}, {"databaseName": "db2"}]}, + "info": { + "basicFeatures": False, + "dbFailover": True, + "dtcSupport": False, + "failureConditionLevel": 3, + "healthCheckTimeout": 30000, + "isContained": False, + "isDistributed": False, + "replicationPartnerType": None, + "requiredSynchronizedSecondariesToCommit": 0, + "secondaryRecoveryHealthDescription": None, + }, + "replicas": { + "value": [ + { + "configure": { + "backupPriority": 50, + "endpointUrl": "TCP://mytest60-0.mytest60-svc:5022", + "readOnlyRoutingUrl": None, + "readWriteRoutingUrl": None, + "replicaCreateDate": None, + "replicaModifyDate": None, + "sessionTimeout": 10, + }, + "replicaName": "testSqlServer\\INST1", + } + ] + }, + }, + "tags": {"mytag": "myval"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_database.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_database.py new file mode 100644 index 000000000000..d523ce441b02 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_arc_sql_server_database.py @@ -0,0 +1,96 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_arc_sql_server_database.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_databases.create( + resource_group_name="testrg", + sql_server_instance_name="testSqlServerInstance", + database_name="testdb", + sql_server_database_resource={ + "location": "southeastasia", + "properties": { + "backupInformation": { + "lastFullBackup": "2022-05-05T16:26:33.883Z", + "lastLogBackup": "2022-05-10T16:26:33.883Z", + }, + "backupPolicy": { + "differentialBackupHours": 12, + "fullBackupDays": 1, + "retentionPeriodDays": 1, + "transactionLogBackupMinutes": 30, + }, + "collationName": "SQL_Latin1_General_CP1_CI_AS", + "compatibilityLevel": 150, + "createMode": "PointInTimeRestore", + "dataFileSizeMB": 80, + "databaseCreationDate": "2022-04-05T16:26:33.883Z", + "databaseOptions": { + "isAutoCloseOn": True, + "isAutoCreateStatsOn": True, + "isAutoShrinkOn": True, + "isAutoUpdateStatsOn": True, + "isEncrypted": True, + "isHekatonFilesOn": False, + "isMemoryOptimizationEnabled": True, + "isRemoteDataArchiveEnabled": True, + "isTrustworthyOn": True, + }, + "isReadOnly": True, + "logFileSizeMB": 70, + "migration": { + "jobs": [ + { + "additionalAttributes": [{"keyName": "LRSVersion", "keyValue": "2.34"}], + "initiatedFrom": "DMS-Portal", + "migrationMode": "LogShipping", + "migrationTrackingId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/SqlMigrationServices/my-migration-service", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/myDatabase", + "targetType": "AzureSqlManagedInstance", + } + ] + }, + "recoveryMode": "Full", + "restorePointInTime": "2022-05-05T16:26:33.883Z", + "sizeMB": 150, + "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/testSqlServerInstance/testsqlManagedInstance/databases/MyDatabase", + "spaceAvailableMB": 100, + "state": "Online", + }, + "tags": {"mytag": "myval"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateArcSqlServerDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_data_controller.py index 1f3daf06dded..6c155451dca5 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_data_controller.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_controllers.begin_put_data_controller( @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateDataController.json +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_failover_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_failover_group.py new file mode 100644 index 000000000000..4b78c9e6c809 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_failover_group.py @@ -0,0 +1,50 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_failover_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_groups.begin_create( + resource_group_name="testrg", + sql_managed_instance_name="testSqlManagedInstance", + failover_group_name="testFailoverGroupName", + failover_group_resource={ + "properties": { + "partnerManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlManagedInstances/partnerMI", + "spec": {"partnerSyncMode": "async", "role": "primary"}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateFailoverGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_managed_instance_link.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_managed_instance_link.py new file mode 100644 index 000000000000..307d94bfadec --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_managed_instance_link.py @@ -0,0 +1,76 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_managed_instance_link.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.begin_create_managed_instance_link( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + create_managed_instance_link_configuration={ + "availabilityGroup": { + "availabilityGroupName": "myNewAg", + "databases": ["database1"], + "replicas": [ + { + "availabilityMode": "SYNCHRONOUS_COMMIT", + "endpointUrl": "TCP://testSqlServer_INST1.testSqlserverDomain:5022", + "failoverMode": "AUTOMATIC", + "secondaryRoleAllowConnections": "ALL", + "seedingMode": "AUTOMATIC", + } + ], + }, + "distributedAvailabilityGroup": { + "availabilityGroupName": "myNewDag", + "primaryAvailabilityGroup": { + "availabilityGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlServerInstances/testSqlServer_INST1/availabilityGroups/testAG1", + "availabilityMode": "ASYNCHRONOUS_COMMIT", + "certificateConfiguration": {"certificateName": "myCert"}, + "failoverMode": "MANUAL", + "listenerUrl": "TCP://testAG1.contoso.com:5022", + "seedingMode": "AUTOMATIC", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl", + "availabilityMode": "ASYNCHRONOUS_COMMIT", + "failoverMode": "NONE", + "seedingMode": "AUTOMATIC", + }, + }, + "miLinkConfiguration": {"instanceAvailabilityGroupName": "testAG2"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateManagedInstanceLink.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_postgres_instance.py index 7f2d462c9003..480526858bdc 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_postgres_instance.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.postgres_instances.begin_create( @@ -85,6 +85,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdatePostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdatePostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_managed_instance.py index 5e2a4de3645f..947a30e6e8a7 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_managed_instance.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_managed_instances.begin_create( @@ -59,6 +59,24 @@ def main(): } } }, + "security": { + "activeDirectory": { + "accountName": "Account name", + "connector": {"name": "Name of connector", "namespace": "Namespace of connector"}, + "encryptionTypes": ["Encryption type item1, Encryption type item2,..."], + "keytabSecret": "Key tab secret of account", + }, + "adminLoginSecret": "test-sql-login-secret", + "serviceCertificateSecret": "Service Certificate Secret", + "transparentDataEncryption": {"mode": "SystemManaged"}, + }, + "settings": { + "network": { + "forceencryption": 0, + "tlsciphers": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384", + "tlsprotocols": "1.2", + } + }, }, }, "licenseType": "LicenseIncluded", @@ -71,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_esu_license.py new file mode 100644 index 000000000000..2aadc992a5b2 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_esu_license.py @@ -0,0 +1,53 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_esu_licenses.create( + resource_group_name="testrg", + sql_server_esu_license_name="testsqlServerEsuLicense", + sql_server_esu_license={ + "location": "northeurope", + "properties": { + "activationState": "Inactive", + "billingPlan": "PAYG", + "physicalCores": 24, + "scopeType": "Subscription", + "version": "SQL Server 2016", + }, + "tags": {"mytag": "myval"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_instance.py index d77f270dbbad..f6b05360b8d6 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_server_instances.begin_create( @@ -37,21 +36,35 @@ def main(): sql_server_instance={ "location": "northeurope", "properties": { - "azureDefenderStatus": "Protected", - "azureDefenderStatusLastUpdated": "2020-01-02T17:18:19.1234567Z", - "collation": "collation", - "containerResourceId": "Resource id of hosting Arc Machine", - "currentVersion": "2012", + "authentication": { + "mode": "Windows", + "sqlServerEntraIdentity": [ + { + "clientId": "00000000-1111-2222-3333-444444444444", + "identityType": "UserAssignedManagedIdentity", + }, + {"clientId": "", "identityType": "SystemAssignedManagedIdentity"}, + ], + }, + "backupPolicy": { + "differentialBackupHours": 12, + "fullBackupDays": 1, + "retentionPeriodDays": 1, + "transactionLogBackupMinutes": 30, + }, + "bestPracticesAssessment": { + "enabled": True, + "schedule": {"cronTrigger": {"expression": "0 0 12 1 11"}, "enabled": True}, + }, + "clientConnection": {"enabled": False}, + "cores": "4", + "discoverySource": "SSMS", "edition": "Developer", "hostType": "Physical Server", "instanceName": "name of instance", - "licenseType": "Free", - "patchLevel": "patchlevel", - "productId": "sql id", - "status": "Registered", - "tcpDynamicPorts": "1433", - "tcpStaticPorts": "1433", - "vCore": "4", + "migration": {"assessment": {"enabled": False}}, + "monitoring": {"enabled": False}, + "serviceType": "Engine", "version": "SQL Server 2012", }, "tags": {"mytag": "myval"}, @@ -60,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/CreateOrUpdateSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_license.py new file mode 100644 index 000000000000..ddbbafed0816 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_or_update_sql_server_license.py @@ -0,0 +1,53 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_or_update_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_licenses.create( + resource_group_name="testrg", + sql_server_license_name="testsqlServerLicense", + sql_server_license={ + "location": "northeurope", + "properties": { + "activationState": "Deactivated", + "billingPlan": "PAYG", + "licenseCategory": "Core", + "physicalCores": 24, + "scopeType": "Subscription", + }, + "tags": {"mytag": "myval"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateOrUpdateSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_availability_group.py new file mode 100644 index 000000000000..9e0ece84d122 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_availability_group.py @@ -0,0 +1,94 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.begin_create_availability_group( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + create_ag_configuration={ + "automatedBackupPreference": "SECONDARY", + "availabilityGroupName": "myNewAg", + "clusterType": "WSFC", + "databases": ["database1", "database2"], + "dbFailover": "ON", + "dtcSupport": "NONE", + "failureConditionLevel": 3, + "healthCheckTimeout": 30000, + "listener": { + "dnsName": "myNewAgListener", + "ipV4AddressesAndMasks": [ + {"ipAddress": "192.1.168.5", "mask": "255.255.255.0"}, + {"ipAddress": "10.1.168.5", "mask": "255.255.255.0"}, + ], + "port": 1433, + }, + "replicas": [ + { + "availabilityMode": "SYNCHRONOUS_COMMIT", + "backupPriority": 50, + "endpointConnectLogin": "NT Server\\MSSSQLSERVER", + "endpointName": "inst1DBMEndpoint", + "endpointUrl": "TCP://testSqlServer_INST1.testSqlserverDomain:5022", + "failoverMode": "AUTOMATIC", + "primaryRoleAllowConnections": "ALL", + "primaryRoleReadOnlyRoutingList": None, + "secondaryRoleAllowConnections": "ALL", + "secondaryRoleReadOnlyRoutingUrl": None, + "seedingMode": "AUTOMATIC", + "serverInstance": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlServerInstances/testSqlServer_INST1/", + "sessionTimeout": 10, + }, + { + "availabilityMode": "SYNCHRONOUS_COMMIT", + "backupPriority": 50, + "endpointConnectLogin": "NT Server\\MSSSQLSERVER", + "endpointName": "inst2DBMEndpoint", + "endpointUrl": "TCP://testSqlServer_INST2.testSqlserverDomain:5022", + "failoverMode": "AUTOMATIC", + "primaryRoleAllowConnections": "ALL", + "primaryRoleReadOnlyRoutingList": None, + "secondaryRoleAllowConnections": "ALL", + "secondaryRoleReadOnlyRoutingUrl": None, + "seedingMode": "AUTOMATIC", + "serverInstance": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlServerInstances/testSqlServer_INST2/", + "sessionTimeout": 10, + }, + ], + "requiredSynchronizedSecondariesToCommit": 0, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_distributed_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_distributed_availability_group.py new file mode 100644 index 000000000000..e0c19b1f5c8a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/create_sql_server_distributed_availability_group.py @@ -0,0 +1,61 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python create_sql_server_distributed_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.begin_create_distributed_availability_group( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + create_dag_configuration={ + "availabilityGroupName": "myNewDag", + "primaryAvailabilityGroup": { + "availabilityGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlServerInstances/testSqlServer_INST1/availabilityGroups/testAG1", + "availabilityMode": "ASYNCHRONOUS_COMMIT", + "certificateConfiguration": {"certificateName": "myCert"}, + "failoverMode": "MANUAL", + "listenerUrl": "TCP://testAG1.contoso.com:5022", + "seedingMode": "AUTOMATIC", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.AzureArcData/sqlServerInstances/testSqlServer_INST2/availabilityGroups/testAG2", + "availabilityMode": "ASYNCHRONOUS_COMMIT", + "certificateConfiguration": {"certificateName": "myCert"}, + "failoverMode": "MANUAL", + "listenerUrl": "TCP://testAG2.contoso.com:5022", + "seedingMode": "AUTOMATIC", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/CreateSqlServerDistributedAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_active_directory_connector.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_active_directory_connector.py index a1c32a845fff..0ff254052cbd 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_active_directory_connector.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_active_directory_connector.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.active_directory_connectors.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteActiveDirectoryConnector.json +# x-ms-original-file: 2026-03-01-preview/DeleteActiveDirectoryConnector.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..e2d3b950ab22 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.sql_server_availability_groups.begin_delete( + resource_group_name="testrg", + sql_server_instance_name="testsqlInstanceAvailabilityGroup", + availability_group_name="testAG", + ).result() + + +# x-ms-original-file: 2026-03-01-preview/DeleteArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_database.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_database.py new file mode 100644 index 000000000000..66e936f17fb8 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_arc_sql_server_database.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_arc_sql_server_database.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.sql_server_databases.begin_delete( + resource_group_name="testrg", + sql_server_instance_name="testsqlManagedInstance", + database_name="testdb", + ).result() + + +# x-ms-original-file: 2026-03-01-preview/DeleteArcSqlServerDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_data_controller.py index c74cce4587b1..52792637b53b 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_data_controller.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.data_controllers.begin_delete_data_controller( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteDataController.json +# x-ms-original-file: 2026-03-01-preview/DeleteDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_failover_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_failover_group.py new file mode 100644 index 000000000000..f2d03b8729e7 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_failover_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_failover_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.failover_groups.begin_delete( + resource_group_name="testrg", + sql_managed_instance_name="testSqlManagedInstance", + failover_group_name="testFailoverGroupName", + ).result() + + +# x-ms-original-file: 2026-03-01-preview/DeleteFailoverGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_mi_link.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_mi_link.py new file mode 100644 index 000000000000..a3d22318fe5d --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_mi_link.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_mi_link.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.sql_server_availability_groups.begin_delete_mi_link( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testDAG", + ).result() + + +# x-ms-original-file: 2026-03-01-preview/DeleteMiLink.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_postgres_instance.py index 2dcb5f762f97..d183a55a93f7 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_postgres_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.postgres_instances.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeletePostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/DeletePostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_managed_instance.py index c2a7553d3feb..fbb8152b06c4 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_managed_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sql_managed_instances.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/DeleteSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_esu_license.py new file mode 100644 index 000000000000..a1a2c33a61b4 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_esu_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.sql_server_esu_licenses.delete( + resource_group_name="testrg", + sql_server_esu_license_name="testsqlServerEsuLicense", + ) + + +# x-ms-original-file: 2026-03-01-preview/DeleteSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_instance.py index 6f7588369785..acfd8705f0ca 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sql_server_instances.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/DeleteSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/DeleteSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_license.py new file mode 100644 index 000000000000..73e978ad78ee --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/delete_sql_server_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python delete_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.sql_server_licenses.delete( + resource_group_name="testrg", + sql_server_license_name="testsqlServerLicense", + ) + + +# x-ms-original-file: 2026-03-01-preview/DeleteSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..9ba641343dcc --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_arc_sql_server_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python failover_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.failover( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/FailoverArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_mi_link.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_mi_link.py new file mode 100644 index 000000000000..363e36648c6a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/failover_mi_link.py @@ -0,0 +1,47 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python failover_mi_link.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.begin_failover_mi_link( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testDAG", + managed_instance_resource_id={ + "managedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl" + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/failoverMiLink.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/filtered_list_by_sql_server_instance_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/filtered_list_by_sql_server_instance_availability_group.py new file mode 100644 index 000000000000..e6bb1e8c8b58 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/filtered_list_by_sql_server_instance_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python filtered_list_by_sql_server_instance_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.get_all_availability_groups( + resource_group_name="exampleResourceGroup", + sql_server_instance_name="exampleSqlServerInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/FilteredListBySqlServerInstanceAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/force_failover_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/force_failover_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..d52fcc5aac31 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/force_failover_arc_sql_server_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python force_failover_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.force_failover_allow_data_loss( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/ForceFailoverArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_active_directory_connector.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_active_directory_connector.py index 57277cc83758..b925bab7623d 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_active_directory_connector.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_active_directory_connector.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.active_directory_connectors.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetActiveDirectoryConnector.json +# x-ms-original-file: 2026-03-01-preview/GetActiveDirectoryConnector.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..5c0045afd628 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.get( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_database.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_database.py new file mode 100644 index 000000000000..157578fa3555 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_arc_sql_server_database.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_arc_sql_server_database.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_databases.get( + resource_group_name="testrg", + sql_server_instance_name="testSqlServerInstance", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetArcSqlServerDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_data_controller.py index cc1da78683f8..dc8e70f5a63d 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_data_controller.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_controllers.get_data_controller( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetDataController.json +# x-ms-original-file: 2026-03-01-preview/GetDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_failover_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_failover_group.py new file mode 100644 index 000000000000..efc0af88ceb5 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_failover_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_failover_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_groups.get( + resource_group_name="testrg", + sql_managed_instance_name="testSqlManagedInstance", + failover_group_name="testFailoverGroupName", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetFailoverGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_postgres_instance.py index baea0aa33ac2..11ea79a1352b 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_postgres_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.postgres_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetPostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/GetPostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_managed_instance.py index 1d972feda9c8..3efddddb301f 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_managed_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_managed_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/GetSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_esu_license.py new file mode 100644 index 000000000000..9b1c1b1cbc4a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_esu_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_esu_licenses.get( + resource_group_name="testrg", + sql_server_esu_license_name="testsqlServerEsuLicense", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance.py index 2d60bc7d41a2..84fdb8862ae1 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_server_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/GetSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_bpa.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_bpa.py new file mode 100644 index 000000000000..897a17b23cd1 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_bpa.py @@ -0,0 +1,48 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_bpa.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_best_practices_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + sql_server_instance_bpa_request={ + "queryType": "Basic", + "reportId": "ad43a05f-efed-448a-ae53-5e4abd29068f", + "reportType": "AssessmentSummary", + }, + ).result() + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceBpa.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs.py new file mode 100644 index 000000000000..9ff6249b832a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_jobs.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_jobs( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceJobs.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs_status.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs_status.py new file mode 100644 index 000000000000..41750271e12e --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_jobs_status.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_jobs_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, + 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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.get_jobs_status( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceJobsStatus.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_migration_readiness_report.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_migration_readiness_report.py new file mode 100644 index 000000000000..1ca044d8d9bb --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_migration_readiness_report.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_migration_readiness_report.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_migration_readiness_report( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceMigrationReadinessReport.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports.py new file mode 100644 index 000000000000..243054dde1bc --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_target_recommendation_reports.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_target_recommendation_reports( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceTargetRecommendationReports.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_last_page.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_last_page.py new file mode 100644 index 000000000000..d9d597c188dc --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_last_page.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_target_recommendation_reports_last_page.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_target_recommendation_reports( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceTargetRecommendationReportsLastPage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_with_filters.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_with_filters.py new file mode 100644 index 000000000000..d49ff59c49d9 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_target_recommendation_reports_with_filters.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_target_recommendation_reports_with_filters.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_target_recommendation_reports( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceTargetRecommendationReportsWithFilters.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_telemetry.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_telemetry.py new file mode 100644 index 000000000000..fa89fbfc6a55 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_instance_telemetry.py @@ -0,0 +1,47 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_instance_telemetry.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_get_telemetry( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + sql_server_instance_telemetry_request={ + "datasetName": "sqlserver_storage_io", + "startTime": "2023-09-30T00:00:00Z", + }, + ).result() + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerInstanceTelemetry.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_license.py new file mode 100644 index 000000000000..6de6287445de --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/get_sql_server_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python get_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_licenses.get( + resource_group_name="testrg", + sql_server_license_name="testsqlServerLicense", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/GetSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_data_controller_active_directory_connector.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_data_controller_active_directory_connector.py index 5eab857a04d5..ef3c0bbdee4e 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_data_controller_active_directory_connector.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_data_controller_active_directory_connector.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.active_directory_connectors.list( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByDataControllerActiveDirectoryConnector.json +# x-ms-original-file: 2026-03-01-preview/ListByDataControllerActiveDirectoryConnector.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_data_controller.py index d4f66eabdc3b..812f5235b96b 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_data_controller.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_controllers.list_in_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupDataController.json +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_postgres_instance.py index 84eb3da60a61..e235df37a320 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_postgres_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.postgres_instances.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupPostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupPostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_managed_instance.py index e757937e7a07..b9aafc327001 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_managed_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_managed_instances.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_esu_license.py new file mode 100644 index 000000000000..83921f5081b0 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_esu_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_by_resource_group_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_esu_licenses.list_by_resource_group( + resource_group_name="testrg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_instance.py index 8cd4c919e3cb..4046cfb73133 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_server_instances.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListByResourceGroupSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_license.py new file mode 100644 index 000000000000..c5a642c3d88b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_resource_group_sql_server_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_by_resource_group_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_licenses.list_by_resource_group( + resource_group_name="testrg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListByResourceGroupSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_managed_instance_failover_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_managed_instance_failover_group.py new file mode 100644 index 000000000000..9f003d32dada --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_managed_instance_failover_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_by_sql_managed_instance_failover_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.failover_groups.list( + resource_group_name="testrg", + sql_managed_instance_name="testSqlManagedInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListBySqlManagedInstanceFailoverGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_availability_group.py new file mode 100644 index 000000000000..0cd10c3ddbe3 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_by_sql_server_instance_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.list( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListBySqlServerInstanceAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_database.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_database.py new file mode 100644 index 000000000000..67231a92f98d --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_by_sql_server_instance_database.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_by_sql_server_instance_database.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_databases.list( + resource_group_name="testrg", + sql_server_instance_name="testSqlServerInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListBySqlServerInstanceDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_operation.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_operation.py index c0dfd1afe01d..99ebd63490db 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_operation.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_operation.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListOperation.json +# x-ms-original-file: 2026-03-01-preview/ListOperation.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_data_controller.py index cd80f02e19ec..b91667bd27b3 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_data_controller.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_controllers.list_in_subscription() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionDataController.json +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_postgres_instance.py index 0245b1194313..c3833429cf5a 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_postgres_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.postgres_instances.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionPostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionPostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_managed_instance.py index 82f3a49c3858..28aad60a3796 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_managed_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_managed_instances.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_esu_license.py new file mode 100644 index 000000000000..13e09e53f700 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_esu_license.py @@ -0,0 +1,40 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_subscription_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_esu_licenses.list() + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_instance.py index 463001809149..36d8e4446dd5 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_server_instances.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/ListSubscriptionSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_license.py new file mode 100644 index 000000000000..accb45c4a4cf --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/list_subscription_sql_server_license.py @@ -0,0 +1,40 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python list_subscription_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_licenses.list() + for item in response: + print(item) + + +# x-ms-original-file: 2026-03-01-preview/ListSubscriptionSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/post_upgrade_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/post_upgrade_sql_server_instance.py new file mode 100644 index 000000000000..77be3b31d825 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/post_upgrade_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python post_upgrade_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.post_upgrade( + resource_group_name="testrg", + sql_server_instance_name="testsqlServerInstance", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/PostUpgradeSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/pre_upgrade_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/pre_upgrade_sql_server_instance.py new file mode 100644 index 000000000000..40a2465558fb --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/pre_upgrade_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python pre_upgrade_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.pre_upgrade( + resource_group_name="testrg", + sql_server_instance_name="testsqlServerInstance", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/PreUpgradeSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/remove_databases_from_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/remove_databases_from_availability_group.py new file mode 100644 index 000000000000..43418f73b06d --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/remove_databases_from_availability_group.py @@ -0,0 +1,44 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python remove_databases_from_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.remove_databases( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + databases={"values": ["db1"]}, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RemoveDatabasesFromAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practice_assessment_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practice_assessment_sql_server_instance.py new file mode 100644 index 000000000000..8f70951b6162 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practice_assessment_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_best_practice_assessment_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_run_best_practice_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunBestPracticeAssessmentSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practices_assessment_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practices_assessment_sql_server_instance.py new file mode 100644 index 000000000000..3c3b1fe354ec --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_best_practices_assessment_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_best_practices_assessment_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.run_best_practices_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunBestPracticesAssessmentSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_managed_instance_link_assessment.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_managed_instance_link_assessment.py new file mode 100644 index 000000000000..e9265c0ee912 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_managed_instance_link_assessment.py @@ -0,0 +1,57 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_managed_instance_link_assessment.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_run_managed_instance_link_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + sql_server_instance_managed_instance_link_assessment_request={ + "assessmentCategories": [ + "SqlInstance", + "ManagedInstance", + "ManagedInstanceCrossValidation", + "DagCrossValidation", + ], + "availabilityGroupName": "AG_testdb", + "azureManagedInstanceResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testmi", + "azureManagedInstanceRole": "Secondary", + "databaseNames": ["testdb", "testdb2", "testdb3"], + "distributedAvailabilityGroupName": "MiLinkDag", + "sqlServerIpAddress": "192.168.1.2", + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunManagedInstanceLinkAssessment.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_assessment_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_assessment_sql_server_instance.py new file mode 100644 index 000000000000..13660468b9b7 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_assessment_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_migration_assessment_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.run_migration_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunMigrationAssessmentSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_readiness_assessment_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_readiness_assessment_sql_server_instance.py new file mode 100644 index 000000000000..9d6e0ad393fd --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_migration_readiness_assessment_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_migration_readiness_assessment_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_run_migration_readiness_assessment( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunMigrationReadinessAssessmentSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_target_recommendation_job_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_target_recommendation_job_sql_server_instance.py new file mode 100644 index 000000000000..65db6cbdaf74 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/run_target_recommendation_job_sql_server_instance.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python run_target_recommendation_job_sql_server_instance.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_instances.begin_run_target_recommendation_job( + resource_group_name="testrg", + sql_server_instance_name="testsqlserver", + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/RunTargetRecommendationJobSqlServerInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..f459ebc27749 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_arc_sql_server_availability_group.py @@ -0,0 +1,44 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python update_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.begin_update( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + sql_server_availability_group_update={"tags": {"mytag": "myval1"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/UpdateArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_data_controller.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_data_controller.py index b034d3769575..92bd20a8a271 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_data_controller.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_data_controller.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_controllers.begin_patch_data_controller( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateDataController.json +# x-ms-original-file: 2026-03-01-preview/UpdateDataController.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_postgres_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_postgres_instance.py index ed734acfcd36..d79ae4449fdb 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_postgres_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_postgres_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.postgres_instances.update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdatePostgresInstance.json +# x-ms-original-file: 2026-03-01-preview/UpdatePostgresInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_managed_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_managed_instance.py index 13ef871a1051..4b26d9dac76e 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_managed_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_managed_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_managed_instances.update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlManagedInstance.json +# x-ms-original-file: 2026-03-01-preview/UpdateSqlManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_database.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_database.py new file mode 100644 index 000000000000..de4b767a1a0b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_database.py @@ -0,0 +1,44 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python update_sql_server_database.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_databases.begin_update( + resource_group_name="testrg", + sql_server_instance_name="testsqlManagedInstance", + database_name="testdb", + sql_server_database_update={"tags": {"mytag": "myval1"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-03-01-preview/UpdateSqlServerDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_esu_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_esu_license.py new file mode 100644 index 000000000000..6492d91c0d70 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_esu_license.py @@ -0,0 +1,46 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python update_sql_server_esu_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_esu_licenses.update( + resource_group_name="testrg", + sql_server_esu_license_name="testsqlServerEsuLicense", + parameters={ + "properties": {"activationState": "Active", "billingPlan": "Paid", "physicalCores": 28}, + "tags": {"mytag": "myval"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/UpdateSqlServerEsuLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_instance.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_instance.py index d54e47df1d39..dd1645d4a4bc 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_instance.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_instance.py @@ -1,9 +1,8 @@ -# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,17 +27,17 @@ def main(): client = AzureArcDataManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.sql_server_instances.update( + response = client.sql_server_instances.begin_update( resource_group_name="testrg", sql_server_instance_name="testsqlServerInstance", parameters={"tags": {"mytag": "myval"}}, - ) + ).result() print(response) -# x-ms-original-file: specification/azurearcdata/resource-manager/Microsoft.AzureArcData/preview/2022-03-01-preview/examples/UpdateSqlServerInstance.json +# x-ms-original-file: 2026-03-01-preview/UpdateSqlServerInstance.json if __name__ == "__main__": main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_license.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_license.py new file mode 100644 index 000000000000..dc45999cf490 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/update_sql_server_license.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python update_sql_server_license.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_licenses.update( + resource_group_name="testrg", + sql_server_license_name="testsqlServerLicense", + parameters={"tags": {"mytag": "myval"}}, + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/UpdateSqlServerLicense.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/view_arc_sql_server_availability_group.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/view_arc_sql_server_availability_group.py new file mode 100644 index 000000000000..ebb3784427cd --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_samples/view_arc_sql_server_availability_group.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.azurearcdata import AzureArcDataManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurearcdata +# USAGE + python view_arc_sql_server_availability_group.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 = AzureArcDataManagementClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sql_server_availability_groups.detail_view( + resource_group_name="testrg", + sql_server_instance_name="testSqlServer_INST1", + availability_group_name="testAG", + ) + print(response) + + +# x-ms-original-file: 2026-03-01-preview/ViewArcSqlServerAvailabilityGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/conftest.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/conftest.py index 870836644fdb..d87be4c124d7 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/conftest.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations.py index 9699c4f01c71..b2a49ae6bb9e 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_active_directory_connectors_list(self, resource_group): - response = self.client.active_directory_connectors.list( + def test_active_directory_connectors_get(self, resource_group): + response = self.client.active_directory_connectors.get( resource_group_name=resource_group.name, data_controller_name="str", - api_version="2022-03-01-preview", + active_directory_connector_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -41,20 +41,20 @@ def test_active_directory_connectors_begin_create(self, resource_group): "properties": { "spec": { "activeDirectory": { + "realm": "str", "domainControllers": { "primaryDomainController": {"hostname": "str"}, "secondaryDomainControllers": [{"hostname": "str"}], }, - "realm": "str", "netbiosDomainName": "str", "ouDistinguishedName": "str", - "serviceAccountProvisioning": "manual", + "serviceAccountProvisioning": "str", }, "dns": { "nameserverIPAddresses": ["str"], "domainName": "str", - "preferK8sDnsForPtrLookups": True, - "replicas": 1, + "preferK8sDnsForPtrLookups": bool, + "replicas": 0, }, }, "domainServiceAccountLoginInformation": {"password": "str", "username": "str"}, @@ -73,7 +73,6 @@ def test_active_directory_connectors_begin_create(self, resource_group): }, "type": "str", }, - api_version="2022-03-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +85,6 @@ def test_active_directory_connectors_begin_delete(self, resource_group): resource_group_name=resource_group.name, data_controller_name="str", active_directory_connector_name="str", - api_version="2022-03-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -94,13 +92,11 @@ def test_active_directory_connectors_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_active_directory_connectors_get(self, resource_group): - response = self.client.active_directory_connectors.get( + def test_active_directory_connectors_list(self, resource_group): + response = self.client.active_directory_connectors.list( resource_group_name=resource_group.name, data_controller_name="str", - active_directory_connector_name="str", - api_version="2022-03-01-preview", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations_async.py index 12be8a0726ce..bc44597fe38b 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_active_directory_connectors_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_active_directory_connectors_list(self, resource_group): - response = self.client.active_directory_connectors.list( + async def test_active_directory_connectors_get(self, resource_group): + response = await self.client.active_directory_connectors.get( resource_group_name=resource_group.name, data_controller_name="str", - api_version="2022-03-01-preview", + active_directory_connector_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -43,20 +43,20 @@ async def test_active_directory_connectors_begin_create(self, resource_group): "properties": { "spec": { "activeDirectory": { + "realm": "str", "domainControllers": { "primaryDomainController": {"hostname": "str"}, "secondaryDomainControllers": [{"hostname": "str"}], }, - "realm": "str", "netbiosDomainName": "str", "ouDistinguishedName": "str", - "serviceAccountProvisioning": "manual", + "serviceAccountProvisioning": "str", }, "dns": { "nameserverIPAddresses": ["str"], "domainName": "str", - "preferK8sDnsForPtrLookups": True, - "replicas": 1, + "preferK8sDnsForPtrLookups": bool, + "replicas": 0, }, }, "domainServiceAccountLoginInformation": {"password": "str", "username": "str"}, @@ -75,7 +75,6 @@ async def test_active_directory_connectors_begin_create(self, resource_group): }, "type": "str", }, - api_version="2022-03-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +89,6 @@ async def test_active_directory_connectors_begin_delete(self, resource_group): resource_group_name=resource_group.name, data_controller_name="str", active_directory_connector_name="str", - api_version="2022-03-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -99,13 +97,11 @@ async def test_active_directory_connectors_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_active_directory_connectors_get(self, resource_group): - response = await self.client.active_directory_connectors.get( + async def test_active_directory_connectors_list(self, resource_group): + response = self.client.active_directory_connectors.list( resource_group_name=resource_group.name, data_controller_name="str", - active_directory_connector_name="str", - api_version="2022-03-01-preview", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations.py index ea54735e7bd7..71e79a27395a 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,22 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_data_controllers_list_in_subscription(self, resource_group): - response = self.client.data_controllers.list_in_subscription( - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_data_controllers_list_in_group(self, resource_group): - response = self.client.data_controllers.list_in_group( + def test_data_controllers_get_data_controller(self, resource_group): + response = self.client.data_controllers.get_data_controller( resource_group_name=resource_group.name, - api_version="2022-03-01-preview", + data_controller_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -51,7 +41,7 @@ def test_data_controllers_begin_put_data_controller(self, resource_group): "basicLoginInformation": {"password": "str", "username": "str"}, "clusterId": "str", "extensionId": "str", - "infrastructure": "other", + "infrastructure": "str", "k8sRaw": {}, "lastUploadedDate": "2020-02-20 00:00:00", "logAnalyticsWorkspaceConfig": {"primaryKey": "str", "workspaceId": "str"}, @@ -89,36 +79,11 @@ def test_data_controllers_begin_put_data_controller(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", ).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_data_controllers_begin_delete_data_controller(self, resource_group): - response = self.client.data_controllers.begin_delete_data_controller( - resource_group_name=resource_group.name, - data_controller_name="str", - api_version="2022-03-01-preview", - ).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_data_controllers_get_data_controller(self, resource_group): - response = self.client.data_controllers.get_data_controller( - resource_group_name=resource_group.name, - data_controller_name="str", - api_version="2022-03-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_data_controllers_begin_patch_data_controller(self, resource_group): @@ -130,7 +95,7 @@ def test_data_controllers_begin_patch_data_controller(self, resource_group): "basicLoginInformation": {"password": "str", "username": "str"}, "clusterId": "str", "extensionId": "str", - "infrastructure": "other", + "infrastructure": "str", "k8sRaw": {}, "lastUploadedDate": "2020-02-20 00:00:00", "logAnalyticsWorkspaceConfig": {"primaryKey": "str", "workspaceId": "str"}, @@ -156,8 +121,36 @@ def test_data_controllers_begin_patch_data_controller(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2022-03-01-preview", ).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_data_controllers_begin_delete_data_controller(self, resource_group): + response = self.client.data_controllers.begin_delete_data_controller( + resource_group_name=resource_group.name, + data_controller_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_data_controllers_list_in_group(self, resource_group): + response = self.client.data_controllers.list_in_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_data_controllers_list_in_subscription(self, resource_group): + response = self.client.data_controllers.list_in_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations_async.py index 12fd8d82d8f1..40495f18a9ce 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_data_controllers_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,22 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_data_controllers_list_in_subscription(self, resource_group): - response = self.client.data_controllers.list_in_subscription( - api_version="2022-03-01-preview", - ) - 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_data_controllers_list_in_group(self, resource_group): - response = self.client.data_controllers.list_in_group( + async def test_data_controllers_get_data_controller(self, resource_group): + response = await self.client.data_controllers.get_data_controller( resource_group_name=resource_group.name, - api_version="2022-03-01-preview", + data_controller_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -53,7 +43,7 @@ async def test_data_controllers_begin_put_data_controller(self, resource_group): "basicLoginInformation": {"password": "str", "username": "str"}, "clusterId": "str", "extensionId": "str", - "infrastructure": "other", + "infrastructure": "str", "k8sRaw": {}, "lastUploadedDate": "2020-02-20 00:00:00", "logAnalyticsWorkspaceConfig": {"primaryKey": "str", "workspaceId": "str"}, @@ -91,39 +81,12 @@ async def test_data_controllers_begin_put_data_controller(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", ) ).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_data_controllers_begin_delete_data_controller(self, resource_group): - response = await ( - await self.client.data_controllers.begin_delete_data_controller( - resource_group_name=resource_group.name, - data_controller_name="str", - api_version="2022-03-01-preview", - ) - ).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_data_controllers_get_data_controller(self, resource_group): - response = await self.client.data_controllers.get_data_controller( - resource_group_name=resource_group.name, - data_controller_name="str", - api_version="2022-03-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_data_controllers_begin_patch_data_controller(self, resource_group): @@ -136,7 +99,7 @@ async def test_data_controllers_begin_patch_data_controller(self, resource_group "basicLoginInformation": {"password": "str", "username": "str"}, "clusterId": "str", "extensionId": "str", - "infrastructure": "other", + "infrastructure": "str", "k8sRaw": {}, "lastUploadedDate": "2020-02-20 00:00:00", "logAnalyticsWorkspaceConfig": {"primaryKey": "str", "workspaceId": "str"}, @@ -162,9 +125,39 @@ async def test_data_controllers_begin_patch_data_controller(self, resource_group }, "tags": {"str": "str"}, }, - api_version="2022-03-01-preview", ) ).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_data_controllers_begin_delete_data_controller(self, resource_group): + response = await ( + await self.client.data_controllers.begin_delete_data_controller( + resource_group_name=resource_group.name, + data_controller_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_data_controllers_list_in_group(self, resource_group): + response = self.client.data_controllers.list_in_group( + resource_group_name=resource_group.name, + ) + 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_data_controllers_list_in_subscription(self, resource_group): + response = self.client.data_controllers.list_in_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations.py new file mode 100644 index 000000000000..75db8aaff68b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations.py @@ -0,0 +1,93 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +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 TestAzureArcDataManagementFailoverGroupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_groups_get(self, resource_group): + response = self.client.failover_groups.get( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_groups_begin_create(self, resource_group): + response = self.client.failover_groups.begin_create( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_name="str", + failover_group_resource={ + "properties": { + "partnerManagedInstanceId": "str", + "spec": { + "role": "str", + "partnerMI": "str", + "partnerMirroringCert": "str", + "partnerMirroringURL": "str", + "partnerSyncMode": "str", + "sharedName": "str", + "sourceMI": "str", + }, + "provisioningState": "str", + "status": {}, + }, + "id": "str", + "name": "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 + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_groups_begin_delete(self, resource_group): + response = self.client.failover_groups.begin_delete( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_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_failover_groups_list(self, resource_group): + response = self.client.failover_groups.list( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations_async.py new file mode 100644 index 000000000000..051674e47138 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_failover_groups_operations_async.py @@ -0,0 +1,98 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +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 TestAzureArcDataManagementFailoverGroupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_groups_get(self, resource_group): + response = await self.client.failover_groups.get( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_groups_begin_create(self, resource_group): + response = await ( + await self.client.failover_groups.begin_create( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_name="str", + failover_group_resource={ + "properties": { + "partnerManagedInstanceId": "str", + "spec": { + "role": "str", + "partnerMI": "str", + "partnerMirroringCert": "str", + "partnerMirroringURL": "str", + "partnerSyncMode": "str", + "sharedName": "str", + "sourceMI": "str", + }, + "provisioningState": "str", + "status": {}, + }, + "id": "str", + "name": "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 + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_groups_begin_delete(self, resource_group): + response = await ( + await self.client.failover_groups.begin_delete( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + failover_group_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_failover_groups_list(self, resource_group): + response = self.client.failover_groups.list( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations.py index f071c65f2ac0..17d26913ef60 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,9 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2022-03-01-preview", - ) + response = self.client.operations.list() result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations_async.py index af9f70aef3a1..23b374cdcaa8 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -22,9 +22,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2022-03-01-preview", - ) + response = self.client.operations.list() result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations.py index f586cd636016..caf60df507f6 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestAzureArcDataManagementPostgresInstancesOperations(AzureMgmtRecordedTes def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_postgres_instances_list(self, resource_group): - response = self.client.postgres_instances.list( - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_postgres_instances_list_by_resource_group(self, resource_group): - response = self.client.postgres_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_postgres_instances_get(self, resource_group): response = self.client.postgres_instances.get( resource_group_name=resource_group.name, postgres_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -73,7 +51,7 @@ def test_postgres_instances_begin_create(self, resource_group): "sku": { "name": "str", "capacity": 0, - "dev": True, + "dev": bool, "family": "str", "size": "str", "tier": "Hyperscale", @@ -89,19 +67,6 @@ def test_postgres_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", - ).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_postgres_instances_begin_delete(self, resource_group): - response = self.client.postgres_instances.begin_delete( - resource_group_name=resource_group.name, - postgres_instance_name="str", - api_version="2022-03-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,8 +89,36 @@ def test_postgres_instances_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2022-03-01-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_postgres_instances_begin_delete(self, resource_group): + response = self.client.postgres_instances.begin_delete( + resource_group_name=resource_group.name, + postgres_instance_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_postgres_instances_list_by_resource_group(self, resource_group): + response = self.client.postgres_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_postgres_instances_list(self, resource_group): + response = self.client.postgres_instances.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations_async.py index c48d5ec797ec..4fdd88dcd445 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_postgres_instances_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestAzureArcDataManagementPostgresInstancesOperationsAsync(AzureMgmtRecord def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_postgres_instances_list(self, resource_group): - response = self.client.postgres_instances.list( - api_version="2022-03-01-preview", - ) - 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_postgres_instances_list_by_resource_group(self, resource_group): - response = self.client.postgres_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - 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_postgres_instances_get(self, resource_group): response = await self.client.postgres_instances.get( resource_group_name=resource_group.name, postgres_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -75,7 +53,7 @@ async def test_postgres_instances_begin_create(self, resource_group): "sku": { "name": "str", "capacity": 0, - "dev": True, + "dev": bool, "family": "str", "size": "str", "tier": "Hyperscale", @@ -91,21 +69,6 @@ async def test_postgres_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", - ) - ).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_postgres_instances_begin_delete(self, resource_group): - response = await ( - await self.client.postgres_instances.begin_delete( - resource_group_name=resource_group.name, - postgres_instance_name="str", - api_version="2022-03-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -129,8 +92,38 @@ async def test_postgres_instances_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2022-03-01-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_postgres_instances_begin_delete(self, resource_group): + response = await ( + await self.client.postgres_instances.begin_delete( + resource_group_name=resource_group.name, + postgres_instance_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_postgres_instances_list_by_resource_group(self, resource_group): + response = self.client.postgres_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + 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_postgres_instances_list(self, resource_group): + response = self.client.postgres_instances.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations.py index 3de55858ba63..bea036f18527 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestAzureArcDataManagementSqlManagedInstancesOperations(AzureMgmtRecordedT def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_managed_instances_list(self, resource_group): - response = self.client.sql_managed_instances.list( - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_managed_instances_list_by_resource_group(self, resource_group): - response = self.client.sql_managed_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sql_managed_instances_get(self, resource_group): response = self.client.sql_managed_instances.get( resource_group_name=resource_group.name, sql_managed_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -73,24 +51,29 @@ def test_sql_managed_instances_begin_create(self, resource_group): "scheduling": { "default": {"resources": {"limits": {"str": "str"}, "requests": {"str": "str"}}} }, + "security": { + "activeDirectory": { + "accountName": "str", + "connector": {"name": "str", "namespace": "str"}, + "encryptionTypes": ["str"], + "keytabSecret": "str", + }, + "adminLoginSecret": "str", + "serviceCertificateSecret": "str", + "transparentDataEncryption": {"mode": "str", "protectorSecret": "str"}, + }, + "settings": {"network": {"forceencryption": 0, "tlsciphers": "str", "tlsprotocols": "str"}}, } }, "lastUploadedDate": "2020-02-20 00:00:00", - "licenseType": "BasePrice", + "licenseType": "str", "provisioningState": "str", "startTime": "str", }, "extendedLocation": {"name": "str", "type": "str"}, "id": "str", "name": "str", - "sku": { - "name": "vCore", - "capacity": 0, - "dev": True, - "family": "str", - "size": "str", - "tier": "GeneralPurpose", - }, + "sku": {"name": "vCore", "capacity": 0, "dev": bool, "family": "str", "size": "str", "tier": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -102,19 +85,29 @@ def test_sql_managed_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", ).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_sql_managed_instances_update(self, resource_group): + response = self.client.sql_managed_instances.update( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + parameters={"tags": {"str": "str"}}, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sql_managed_instances_begin_delete(self, resource_group): response = self.client.sql_managed_instances.begin_delete( resource_group_name=resource_group.name, sql_managed_instance_name="str", - api_version="2022-03-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -122,13 +115,18 @@ def test_sql_managed_instances_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_managed_instances_update(self, resource_group): - response = self.client.sql_managed_instances.update( + def test_sql_managed_instances_list_by_resource_group(self, resource_group): + response = self.client.sql_managed_instances.list_by_resource_group( resource_group_name=resource_group.name, - sql_managed_instance_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2022-03-01-preview", ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_managed_instances_list(self, resource_group): + response = self.client.sql_managed_instances.list() + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations_async.py index ede013ba748f..ba1fda9499ac 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_managed_instances_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestAzureArcDataManagementSqlManagedInstancesOperationsAsync(AzureMgmtReco def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_managed_instances_list(self, resource_group): - response = self.client.sql_managed_instances.list( - api_version="2022-03-01-preview", - ) - 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_sql_managed_instances_list_by_resource_group(self, resource_group): - response = self.client.sql_managed_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - 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_sql_managed_instances_get(self, resource_group): response = await self.client.sql_managed_instances.get( resource_group_name=resource_group.name, sql_managed_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -75,24 +53,31 @@ async def test_sql_managed_instances_begin_create(self, resource_group): "scheduling": { "default": {"resources": {"limits": {"str": "str"}, "requests": {"str": "str"}}} }, + "security": { + "activeDirectory": { + "accountName": "str", + "connector": {"name": "str", "namespace": "str"}, + "encryptionTypes": ["str"], + "keytabSecret": "str", + }, + "adminLoginSecret": "str", + "serviceCertificateSecret": "str", + "transparentDataEncryption": {"mode": "str", "protectorSecret": "str"}, + }, + "settings": { + "network": {"forceencryption": 0, "tlsciphers": "str", "tlsprotocols": "str"} + }, } }, "lastUploadedDate": "2020-02-20 00:00:00", - "licenseType": "BasePrice", + "licenseType": "str", "provisioningState": "str", "startTime": "str", }, "extendedLocation": {"name": "str", "type": "str"}, "id": "str", "name": "str", - "sku": { - "name": "vCore", - "capacity": 0, - "dev": True, - "family": "str", - "size": "str", - "tier": "GeneralPurpose", - }, + "sku": {"name": "vCore", "capacity": 0, "dev": bool, "family": "str", "size": "str", "tier": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -104,13 +89,24 @@ async def test_sql_managed_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", ) ).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_sql_managed_instances_update(self, resource_group): + response = await self.client.sql_managed_instances.update( + resource_group_name=resource_group.name, + sql_managed_instance_name="str", + parameters={"tags": {"str": "str"}}, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sql_managed_instances_begin_delete(self, resource_group): @@ -118,7 +114,6 @@ async def test_sql_managed_instances_begin_delete(self, resource_group): await self.client.sql_managed_instances.begin_delete( resource_group_name=resource_group.name, sql_managed_instance_name="str", - api_version="2022-03-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -127,13 +122,18 @@ async def test_sql_managed_instances_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_managed_instances_update(self, resource_group): - response = await self.client.sql_managed_instances.update( + async def test_sql_managed_instances_list_by_resource_group(self, resource_group): + response = self.client.sql_managed_instances.list_by_resource_group( resource_group_name=resource_group.name, - sql_managed_instance_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2022-03-01-preview", ) + 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_sql_managed_instances_list(self, resource_group): + response = self.client.sql_managed_instances.list() + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations.py new file mode 100644 index 000000000000..30aa65e75c38 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations.py @@ -0,0 +1,511 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerAvailabilityGroupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_begin_create_availability_group(self, resource_group): + response = self.client.sql_server_availability_groups.begin_create_availability_group( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_ag_configuration={ + "automatedBackupPreference": "str", + "availabilityGroupName": "str", + "clusterType": "str", + "databases": ["str"], + "dbFailover": "str", + "dtcSupport": "str", + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "replicas": [ + { + "availabilityMode": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "primaryRoleAllowConnections": "str", + "primaryRoleReadOnlyRoutingList": ["str"], + "secondaryRoleAllowConnections": "str", + "secondaryRoleReadOnlyRoutingUrl": "str", + "seedingMode": "str", + "serverInstance": "str", + "sessionTimeout": 0, + } + ], + "requiredSynchronizedSecondariesToCommit": 0, + }, + ).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_sql_server_availability_groups_begin_create_distributed_availability_group(self, resource_group): + response = self.client.sql_server_availability_groups.begin_create_distributed_availability_group( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_dag_configuration={ + "availabilityGroupName": "str", + "primaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "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_sql_server_availability_groups_begin_create_managed_instance_link(self, resource_group): + response = self.client.sql_server_availability_groups.begin_create_managed_instance_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_managed_instance_link_configuration={ + "availabilityGroup": { + "automatedBackupPreference": "str", + "availabilityGroupName": "str", + "clusterType": "str", + "databases": ["str"], + "dbFailover": "str", + "dtcSupport": "str", + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "replicas": [ + { + "availabilityMode": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "primaryRoleAllowConnections": "str", + "primaryRoleReadOnlyRoutingList": ["str"], + "secondaryRoleAllowConnections": "str", + "secondaryRoleReadOnlyRoutingUrl": "str", + "seedingMode": "str", + "serverInstance": "str", + "sessionTimeout": 0, + } + ], + "requiredSynchronizedSecondariesToCommit": 0, + }, + "distributedAvailabilityGroup": { + "availabilityGroupName": "str", + "primaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + }, + "miLinkConfiguration": {"instanceAvailabilityGroupName": "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_sql_server_availability_groups_get(self, resource_group): + response = self.client.sql_server_availability_groups.get( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_create(self, resource_group): + response = self.client.sql_server_availability_groups.create( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + sql_server_availability_group_resource={ + "location": "str", + "properties": { + "availabilityGroupId": "str", + "collectionTimestamp": "2020-02-20 00:00:00", + "databases": { + "nextLink": "str", + "value": [ + { + "databaseName": "str", + "databaseStateDescription": "str", + "isCommitParticipant": bool, + "isLocal": bool, + "isPrimaryReplica": bool, + "isSuspended": bool, + "replicaName": "str", + "suspendReasonDescription": "str", + "synchronizationHealthDescription": "str", + "synchronizationStateDescription": "str", + } + ], + }, + "info": { + "automatedBackupPreferenceDescription": "str", + "basicFeatures": bool, + "clusterTypeDescription": "str", + "dbFailover": bool, + "dtcSupport": bool, + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "isContained": bool, + "isDistributed": bool, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "primaryRecoveryHealthDescription": "str", + "primaryReplica": "str", + "replicationPartnerType": "str", + "requiredSynchronizedSecondariesToCommit": 0, + "secondaryRecoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + "version": 0, + }, + "instanceName": "str", + "provisioningState": "str", + "replicas": { + "nextLink": "str", + "value": [ + { + "configure": { + "availabilityMode": "str", + "availabilityModeDescription": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "failoverModeDescription": "str", + "primaryAllowConnections": "str", + "primaryRoleAllowConnectionsDescription": "str", + "readOnlyRoutingUrl": "str", + "readWriteRoutingUrl": "str", + "replicaCreateDate": "2020-02-20 00:00:00", + "replicaModifyDate": "2020-02-20 00:00:00", + "secondaryAllowConnections": "str", + "secondaryRoleAllowConnectionsDescription": "str", + "seedingMode": "str", + "seedingModeDescription": "str", + "sessionTimeout": 0, + }, + "replicaId": "str", + "replicaName": "str", + "replicaResourceId": "str", + "state": { + "availabilityGroupReplicaRole": "str", + "connectedStateDescription": "str", + "lastConnectErrorDescription": "str", + "lastConnectErrorTimestamp": "2020-02-20 00:00:00", + "operationalStateDescription": "str", + "recoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + }, + } + ], + }, + "serverName": "str", + "vmId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_begin_update(self, resource_group): + response = self.client.sql_server_availability_groups.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + sql_server_availability_group_update={ + "properties": { + "availabilityGroupId": "str", + "collectionTimestamp": "2020-02-20 00:00:00", + "databases": { + "nextLink": "str", + "value": [ + { + "databaseName": "str", + "databaseStateDescription": "str", + "isCommitParticipant": bool, + "isLocal": bool, + "isPrimaryReplica": bool, + "isSuspended": bool, + "replicaName": "str", + "suspendReasonDescription": "str", + "synchronizationHealthDescription": "str", + "synchronizationStateDescription": "str", + } + ], + }, + "info": { + "automatedBackupPreferenceDescription": "str", + "basicFeatures": bool, + "clusterTypeDescription": "str", + "dbFailover": bool, + "dtcSupport": bool, + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "isContained": bool, + "isDistributed": bool, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "primaryRecoveryHealthDescription": "str", + "primaryReplica": "str", + "replicationPartnerType": "str", + "requiredSynchronizedSecondariesToCommit": 0, + "secondaryRecoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + "version": 0, + }, + "instanceName": "str", + "provisioningState": "str", + "replicas": { + "nextLink": "str", + "value": [ + { + "configure": { + "availabilityMode": "str", + "availabilityModeDescription": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "failoverModeDescription": "str", + "primaryAllowConnections": "str", + "primaryRoleAllowConnectionsDescription": "str", + "readOnlyRoutingUrl": "str", + "readWriteRoutingUrl": "str", + "replicaCreateDate": "2020-02-20 00:00:00", + "replicaModifyDate": "2020-02-20 00:00:00", + "secondaryAllowConnections": "str", + "secondaryRoleAllowConnectionsDescription": "str", + "seedingMode": "str", + "seedingModeDescription": "str", + "sessionTimeout": 0, + }, + "replicaId": "str", + "replicaName": "str", + "replicaResourceId": "str", + "state": { + "availabilityGroupReplicaRole": "str", + "connectedStateDescription": "str", + "lastConnectErrorDescription": "str", + "lastConnectErrorTimestamp": "2020-02-20 00:00:00", + "operationalStateDescription": "str", + "recoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + }, + } + ], + }, + "serverName": "str", + "vmId": "str", + }, + "tags": {"str": "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_sql_server_availability_groups_begin_delete(self, resource_group): + response = self.client.sql_server_availability_groups.begin_delete( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_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_sql_server_availability_groups_list(self, resource_group): + response = self.client.sql_server_availability_groups.list( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_detail_view(self, resource_group): + response = self.client.sql_server_availability_groups.detail_view( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_failover(self, resource_group): + response = self.client.sql_server_availability_groups.failover( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_force_failover_allow_data_loss(self, resource_group): + response = self.client.sql_server_availability_groups.force_failover_allow_data_loss( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_add_databases(self, resource_group): + response = self.client.sql_server_availability_groups.add_databases( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + databases={"values": ["str"]}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_availability_groups_begin_failover_mi_link(self, resource_group): + response = self.client.sql_server_availability_groups.begin_failover_mi_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + managed_instance_resource_id={"force": bool, "managedInstanceId": "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_sql_server_availability_groups_begin_delete_mi_link(self, resource_group): + response = self.client.sql_server_availability_groups.begin_delete_mi_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_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_sql_server_availability_groups_remove_databases(self, resource_group): + response = self.client.sql_server_availability_groups.remove_databases( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + databases={"values": ["str"]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations_async.py new file mode 100644 index 000000000000..05735700ddf6 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_availability_groups_operations_async.py @@ -0,0 +1,526 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerAvailabilityGroupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_begin_create_availability_group(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_create_availability_group( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_ag_configuration={ + "automatedBackupPreference": "str", + "availabilityGroupName": "str", + "clusterType": "str", + "databases": ["str"], + "dbFailover": "str", + "dtcSupport": "str", + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "replicas": [ + { + "availabilityMode": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "primaryRoleAllowConnections": "str", + "primaryRoleReadOnlyRoutingList": ["str"], + "secondaryRoleAllowConnections": "str", + "secondaryRoleReadOnlyRoutingUrl": "str", + "seedingMode": "str", + "serverInstance": "str", + "sessionTimeout": 0, + } + ], + "requiredSynchronizedSecondariesToCommit": 0, + }, + ) + ).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_sql_server_availability_groups_begin_create_distributed_availability_group(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_create_distributed_availability_group( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_dag_configuration={ + "availabilityGroupName": "str", + "primaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "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_sql_server_availability_groups_begin_create_managed_instance_link(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_create_managed_instance_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + create_managed_instance_link_configuration={ + "availabilityGroup": { + "automatedBackupPreference": "str", + "availabilityGroupName": "str", + "clusterType": "str", + "databases": ["str"], + "dbFailover": "str", + "dtcSupport": "str", + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "replicas": [ + { + "availabilityMode": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "primaryRoleAllowConnections": "str", + "primaryRoleReadOnlyRoutingList": ["str"], + "secondaryRoleAllowConnections": "str", + "secondaryRoleReadOnlyRoutingUrl": "str", + "seedingMode": "str", + "serverInstance": "str", + "sessionTimeout": 0, + } + ], + "requiredSynchronizedSecondariesToCommit": 0, + }, + "distributedAvailabilityGroup": { + "availabilityGroupName": "str", + "primaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + "secondaryAvailabilityGroup": { + "availabilityGroup": "str", + "availabilityMode": "str", + "certificateConfiguration": {"certificateName": "str"}, + "failoverMode": "str", + "listenerUrl": "str", + "seedingMode": "str", + }, + }, + "miLinkConfiguration": {"instanceAvailabilityGroupName": "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_sql_server_availability_groups_get(self, resource_group): + response = await self.client.sql_server_availability_groups.get( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_create(self, resource_group): + response = await self.client.sql_server_availability_groups.create( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + sql_server_availability_group_resource={ + "location": "str", + "properties": { + "availabilityGroupId": "str", + "collectionTimestamp": "2020-02-20 00:00:00", + "databases": { + "nextLink": "str", + "value": [ + { + "databaseName": "str", + "databaseStateDescription": "str", + "isCommitParticipant": bool, + "isLocal": bool, + "isPrimaryReplica": bool, + "isSuspended": bool, + "replicaName": "str", + "suspendReasonDescription": "str", + "synchronizationHealthDescription": "str", + "synchronizationStateDescription": "str", + } + ], + }, + "info": { + "automatedBackupPreferenceDescription": "str", + "basicFeatures": bool, + "clusterTypeDescription": "str", + "dbFailover": bool, + "dtcSupport": bool, + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "isContained": bool, + "isDistributed": bool, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "primaryRecoveryHealthDescription": "str", + "primaryReplica": "str", + "replicationPartnerType": "str", + "requiredSynchronizedSecondariesToCommit": 0, + "secondaryRecoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + "version": 0, + }, + "instanceName": "str", + "provisioningState": "str", + "replicas": { + "nextLink": "str", + "value": [ + { + "configure": { + "availabilityMode": "str", + "availabilityModeDescription": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "failoverModeDescription": "str", + "primaryAllowConnections": "str", + "primaryRoleAllowConnectionsDescription": "str", + "readOnlyRoutingUrl": "str", + "readWriteRoutingUrl": "str", + "replicaCreateDate": "2020-02-20 00:00:00", + "replicaModifyDate": "2020-02-20 00:00:00", + "secondaryAllowConnections": "str", + "secondaryRoleAllowConnectionsDescription": "str", + "seedingMode": "str", + "seedingModeDescription": "str", + "sessionTimeout": 0, + }, + "replicaId": "str", + "replicaName": "str", + "replicaResourceId": "str", + "state": { + "availabilityGroupReplicaRole": "str", + "connectedStateDescription": "str", + "lastConnectErrorDescription": "str", + "lastConnectErrorTimestamp": "2020-02-20 00:00:00", + "operationalStateDescription": "str", + "recoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + }, + } + ], + }, + "serverName": "str", + "vmId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_begin_update(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + sql_server_availability_group_update={ + "properties": { + "availabilityGroupId": "str", + "collectionTimestamp": "2020-02-20 00:00:00", + "databases": { + "nextLink": "str", + "value": [ + { + "databaseName": "str", + "databaseStateDescription": "str", + "isCommitParticipant": bool, + "isLocal": bool, + "isPrimaryReplica": bool, + "isSuspended": bool, + "replicaName": "str", + "suspendReasonDescription": "str", + "synchronizationHealthDescription": "str", + "synchronizationStateDescription": "str", + } + ], + }, + "info": { + "automatedBackupPreferenceDescription": "str", + "basicFeatures": bool, + "clusterTypeDescription": "str", + "dbFailover": bool, + "dtcSupport": bool, + "failureConditionLevel": 0, + "healthCheckTimeout": 0, + "isContained": bool, + "isDistributed": bool, + "listener": { + "dnsName": "str", + "ipV4AddressesAndMasks": [{"ipAddress": "str", "mask": "str"}], + "ipV6Addresses": ["str"], + "port": 0, + }, + "primaryRecoveryHealthDescription": "str", + "primaryReplica": "str", + "replicationPartnerType": "str", + "requiredSynchronizedSecondariesToCommit": 0, + "secondaryRecoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + "version": 0, + }, + "instanceName": "str", + "provisioningState": "str", + "replicas": { + "nextLink": "str", + "value": [ + { + "configure": { + "availabilityMode": "str", + "availabilityModeDescription": "str", + "backupPriority": 0, + "certificateName": "str", + "endpointAuthenticationMode": "str", + "endpointConnectLogin": "str", + "endpointName": "str", + "endpointUrl": "str", + "failoverMode": "str", + "failoverModeDescription": "str", + "primaryAllowConnections": "str", + "primaryRoleAllowConnectionsDescription": "str", + "readOnlyRoutingUrl": "str", + "readWriteRoutingUrl": "str", + "replicaCreateDate": "2020-02-20 00:00:00", + "replicaModifyDate": "2020-02-20 00:00:00", + "secondaryAllowConnections": "str", + "secondaryRoleAllowConnectionsDescription": "str", + "seedingMode": "str", + "seedingModeDescription": "str", + "sessionTimeout": 0, + }, + "replicaId": "str", + "replicaName": "str", + "replicaResourceId": "str", + "state": { + "availabilityGroupReplicaRole": "str", + "connectedStateDescription": "str", + "lastConnectErrorDescription": "str", + "lastConnectErrorTimestamp": "2020-02-20 00:00:00", + "operationalStateDescription": "str", + "recoveryHealthDescription": "str", + "synchronizationHealthDescription": "str", + }, + } + ], + }, + "serverName": "str", + "vmId": "str", + }, + "tags": {"str": "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_sql_server_availability_groups_begin_delete(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_delete( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_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_sql_server_availability_groups_list(self, resource_group): + response = self.client.sql_server_availability_groups.list( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + 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_sql_server_availability_groups_detail_view(self, resource_group): + response = await self.client.sql_server_availability_groups.detail_view( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_failover(self, resource_group): + response = await self.client.sql_server_availability_groups.failover( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_force_failover_allow_data_loss(self, resource_group): + response = await self.client.sql_server_availability_groups.force_failover_allow_data_loss( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_add_databases(self, resource_group): + response = await self.client.sql_server_availability_groups.add_databases( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + databases={"values": ["str"]}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_availability_groups_begin_failover_mi_link(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_failover_mi_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + managed_instance_resource_id={"force": bool, "managedInstanceId": "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_sql_server_availability_groups_begin_delete_mi_link(self, resource_group): + response = await ( + await self.client.sql_server_availability_groups.begin_delete_mi_link( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_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_sql_server_availability_groups_remove_databases(self, resource_group): + response = await self.client.sql_server_availability_groups.remove_databases( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + availability_group_name="str", + databases={"values": ["str"]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations.py new file mode 100644 index 000000000000..feab1793e7dc --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations.py @@ -0,0 +1,454 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerDatabasesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_databases_get(self, resource_group): + response = self.client.sql_server_databases.get( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_databases_create(self, resource_group): + response = self.client.sql_server_databases.create( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + sql_server_database_resource={ + "location": "str", + "properties": { + "backupInformation": { + "lastFullBackup": "2020-02-20 00:00:00", + "lastLogBackup": "2020-02-20 00:00:00", + }, + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "collationName": "str", + "compatibilityLevel": 0, + "createMode": "str", + "dataFileSizeMB": 0.0, + "databaseCreationDate": "2020-02-20 00:00:00", + "databaseOptions": { + "isAutoCloseOn": bool, + "isAutoCreateStatsOn": bool, + "isAutoShrinkOn": bool, + "isAutoUpdateStatsOn": bool, + "isEncrypted": bool, + "isHekatonFilesOn": bool, + "isMemoryOptimizationEnabled": bool, + "isRemoteDataArchiveEnabled": bool, + "isTrustworthyOn": bool, + "numberOfHekatonFiles": 0, + }, + "earliestRestoreDate": "2020-02-20 00:00:00", + "isReadOnly": bool, + "lastDatabaseUploadTime": "2020-02-20 00:00:00", + "logFileSizeMB": 0.0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "databaseAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "issueCategory": "str", + "moreInformation": "str", + } + ], + "targetReadiness": { + "azureSqlDatabase": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + }, + "jobs": [ + { + "additionalAttributes": [{"keyName": "str", "keyValue": "str"}], + "endTime": "2020-02-20 00:00:00", + "initiatedFrom": "str", + "lastError": "str", + "migrationMode": "str", + "migrationTrackingId": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", + "targetResourceId": "str", + "targetType": "str", + } + ], + }, + "provisioningState": "str", + "recoveryMode": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sizeMB": 0.0, + "sourceDatabaseId": "str", + "spaceAvailableMB": 0.0, + "state": "str", + "vmId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_databases_begin_update(self, resource_group): + response = self.client.sql_server_databases.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + sql_server_database_update={ + "properties": { + "backupInformation": { + "lastFullBackup": "2020-02-20 00:00:00", + "lastLogBackup": "2020-02-20 00:00:00", + }, + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "collationName": "str", + "compatibilityLevel": 0, + "createMode": "str", + "dataFileSizeMB": 0.0, + "databaseCreationDate": "2020-02-20 00:00:00", + "databaseOptions": { + "isAutoCloseOn": bool, + "isAutoCreateStatsOn": bool, + "isAutoShrinkOn": bool, + "isAutoUpdateStatsOn": bool, + "isEncrypted": bool, + "isHekatonFilesOn": bool, + "isMemoryOptimizationEnabled": bool, + "isRemoteDataArchiveEnabled": bool, + "isTrustworthyOn": bool, + "numberOfHekatonFiles": 0, + }, + "earliestRestoreDate": "2020-02-20 00:00:00", + "isReadOnly": bool, + "lastDatabaseUploadTime": "2020-02-20 00:00:00", + "logFileSizeMB": 0.0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "databaseAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "issueCategory": "str", + "moreInformation": "str", + } + ], + "targetReadiness": { + "azureSqlDatabase": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + }, + "jobs": [ + { + "additionalAttributes": [{"keyName": "str", "keyValue": "str"}], + "endTime": "2020-02-20 00:00:00", + "initiatedFrom": "str", + "lastError": "str", + "migrationMode": "str", + "migrationTrackingId": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", + "targetResourceId": "str", + "targetType": "str", + } + ], + }, + "provisioningState": "str", + "recoveryMode": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sizeMB": 0.0, + "sourceDatabaseId": "str", + "spaceAvailableMB": 0.0, + "state": "str", + "vmId": "str", + }, + "tags": {"str": "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_sql_server_databases_begin_delete(self, resource_group): + response = self.client.sql_server_databases.begin_delete( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_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_sql_server_databases_list(self, resource_group): + response = self.client.sql_server_databases.list( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations_async.py new file mode 100644 index 000000000000..60be4c49f543 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_databases_operations_async.py @@ -0,0 +1,459 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerDatabasesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_databases_get(self, resource_group): + response = await self.client.sql_server_databases.get( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_databases_create(self, resource_group): + response = await self.client.sql_server_databases.create( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + sql_server_database_resource={ + "location": "str", + "properties": { + "backupInformation": { + "lastFullBackup": "2020-02-20 00:00:00", + "lastLogBackup": "2020-02-20 00:00:00", + }, + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "collationName": "str", + "compatibilityLevel": 0, + "createMode": "str", + "dataFileSizeMB": 0.0, + "databaseCreationDate": "2020-02-20 00:00:00", + "databaseOptions": { + "isAutoCloseOn": bool, + "isAutoCreateStatsOn": bool, + "isAutoShrinkOn": bool, + "isAutoUpdateStatsOn": bool, + "isEncrypted": bool, + "isHekatonFilesOn": bool, + "isMemoryOptimizationEnabled": bool, + "isRemoteDataArchiveEnabled": bool, + "isTrustworthyOn": bool, + "numberOfHekatonFiles": 0, + }, + "earliestRestoreDate": "2020-02-20 00:00:00", + "isReadOnly": bool, + "lastDatabaseUploadTime": "2020-02-20 00:00:00", + "logFileSizeMB": 0.0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "databaseAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "issueCategory": "str", + "moreInformation": "str", + } + ], + "targetReadiness": { + "azureSqlDatabase": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + }, + "jobs": [ + { + "additionalAttributes": [{"keyName": "str", "keyValue": "str"}], + "endTime": "2020-02-20 00:00:00", + "initiatedFrom": "str", + "lastError": "str", + "migrationMode": "str", + "migrationTrackingId": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", + "targetResourceId": "str", + "targetType": "str", + } + ], + }, + "provisioningState": "str", + "recoveryMode": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sizeMB": 0.0, + "sourceDatabaseId": "str", + "spaceAvailableMB": 0.0, + "state": "str", + "vmId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_databases_begin_update(self, resource_group): + response = await ( + await self.client.sql_server_databases.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_name="str", + sql_server_database_update={ + "properties": { + "backupInformation": { + "lastFullBackup": "2020-02-20 00:00:00", + "lastLogBackup": "2020-02-20 00:00:00", + }, + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "collationName": "str", + "compatibilityLevel": 0, + "createMode": "str", + "dataFileSizeMB": 0.0, + "databaseCreationDate": "2020-02-20 00:00:00", + "databaseOptions": { + "isAutoCloseOn": bool, + "isAutoCreateStatsOn": bool, + "isAutoShrinkOn": bool, + "isAutoUpdateStatsOn": bool, + "isEncrypted": bool, + "isHekatonFilesOn": bool, + "isMemoryOptimizationEnabled": bool, + "isRemoteDataArchiveEnabled": bool, + "isTrustworthyOn": bool, + "numberOfHekatonFiles": 0, + }, + "earliestRestoreDate": "2020-02-20 00:00:00", + "isReadOnly": bool, + "lastDatabaseUploadTime": "2020-02-20 00:00:00", + "logFileSizeMB": 0.0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "databaseAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "issueCategory": "str", + "moreInformation": "str", + } + ], + "targetReadiness": { + "azureSqlDatabase": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "impactedObjectsSummary": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numOfBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + }, + "jobs": [ + { + "additionalAttributes": [{"keyName": "str", "keyValue": "str"}], + "endTime": "2020-02-20 00:00:00", + "initiatedFrom": "str", + "lastError": "str", + "migrationMode": "str", + "migrationTrackingId": "str", + "startTime": "2020-02-20 00:00:00", + "status": "str", + "targetResourceId": "str", + "targetType": "str", + } + ], + }, + "provisioningState": "str", + "recoveryMode": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sizeMB": 0.0, + "sourceDatabaseId": "str", + "spaceAvailableMB": 0.0, + "state": "str", + "vmId": "str", + }, + "tags": {"str": "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_sql_server_databases_begin_delete(self, resource_group): + response = await ( + await self.client.sql_server_databases.begin_delete( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + database_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_sql_server_databases_list(self, resource_group): + response = self.client.sql_server_databases.list( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations.py new file mode 100644 index 000000000000..daea0641f4d7 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations.py @@ -0,0 +1,121 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerEsuLicensesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_get(self, resource_group): + response = self.client.sql_server_esu_licenses.get( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_create(self, resource_group): + response = self.client.sql_server_esu_licenses.create( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + sql_server_esu_license={ + "location": "str", + "properties": { + "activationState": "str", + "billingPlan": "str", + "physicalCores": 0, + "scopeType": "str", + "version": "str", + "activatedAt": "2020-02-20 00:00:00", + "tenantId": "str", + "terminatedAt": "2020-02-20 00:00:00", + "uniqueId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_update(self, resource_group): + response = self.client.sql_server_esu_licenses.update( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + parameters={ + "properties": { + "activatedAt": "2020-02-20 00:00:00", + "activationState": "str", + "billingPlan": "str", + "physicalCores": 0, + "scopeType": "str", + "tenantId": "str", + "terminatedAt": "2020-02-20 00:00:00", + "uniqueId": "str", + "version": "str", + }, + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_delete(self, resource_group): + response = self.client.sql_server_esu_licenses.delete( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_list_by_resource_group(self, resource_group): + response = self.client.sql_server_esu_licenses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_list(self, resource_group): + response = self.client.sql_server_esu_licenses.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async.py new file mode 100644 index 000000000000..82d06c773394 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async.py @@ -0,0 +1,122 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerEsuLicensesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_get(self, resource_group): + response = await self.client.sql_server_esu_licenses.get( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_create(self, resource_group): + response = await self.client.sql_server_esu_licenses.create( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + sql_server_esu_license={ + "location": "str", + "properties": { + "activationState": "str", + "billingPlan": "str", + "physicalCores": 0, + "scopeType": "str", + "version": "str", + "activatedAt": "2020-02-20 00:00:00", + "tenantId": "str", + "terminatedAt": "2020-02-20 00:00:00", + "uniqueId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_update(self, resource_group): + response = await self.client.sql_server_esu_licenses.update( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + parameters={ + "properties": { + "activatedAt": "2020-02-20 00:00:00", + "activationState": "str", + "billingPlan": "str", + "physicalCores": 0, + "scopeType": "str", + "tenantId": "str", + "terminatedAt": "2020-02-20 00:00:00", + "uniqueId": "str", + "version": "str", + }, + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_delete(self, resource_group): + response = await self.client.sql_server_esu_licenses.delete( + resource_group_name=resource_group.name, + sql_server_esu_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_list_by_resource_group(self, resource_group): + response = self.client.sql_server_esu_licenses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + 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_sql_server_esu_licenses_list(self, resource_group): + response = self.client.sql_server_esu_licenses.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations.py index e4b9c705baa6..0f340226d7aa 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestAzureArcDataManagementSqlServerInstancesOperations(AzureMgmtRecordedTe def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_server_instances_list(self, resource_group): - response = self.client.sql_server_instances.list( - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_server_instances_list_by_resource_group(self, resource_group): - response = self.client.sql_server_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sql_server_instances_get(self, resource_group): response = self.client.sql_server_instances.get( resource_group_name=resource_group.name, sql_server_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -62,24 +40,249 @@ def test_sql_server_instances_begin_create(self, resource_group): "id": "str", "name": "str", "properties": { - "containerResourceId": "str", - "status": "str", + "alwaysOnRole": "str", + "authentication": { + "mode": "str", + "sqlServerEntraIdentity": [{"clientId": "str", "identityType": "str"}], + }, "azureDefenderStatus": "str", "azureDefenderStatusLastUpdated": "2020-02-20 00:00:00", + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "bestPracticesAssessment": { + "enabled": bool, + "schedule": { + "cronTrigger": {"expression": "str", "startTime": "str", "timeZone": "str"}, + "enabled": bool, + }, + }, + "clientConnection": {"enabled": bool}, "collation": "str", + "containerResourceId": "str", + "cores": "str", "createTime": "str", "currentVersion": "str", + "databaseMirroringEndpoint": { + "certificateExpiryDate": "2020-02-20 00:00:00", + "certificateName": "str", + "connectionAuth": "str", + "encryptionAlgorithm": "str", + "endpointName": "str", + "ipAddress": "str", + "isDynamicPort": bool, + "isEncryptionEnabled": bool, + "port": 0, + "role": "str", + }, + "dbMasterKeyExists": bool, + "discoverySource": "str", "edition": "str", + "failoverCluster": { + "hostIPAddresses": [{"ipAddress": "str", "subnetMask": "str"}], + "hostNames": ["str"], + "id": "str", + "networkName": "str", + "sqlInstanceIds": ["str"], + }, "hostType": "str", "instanceName": "str", + "isDigiCertPkiCertTrustConfigured": bool, + "isHadrEnabled": bool, + "isMicrosoftPkiCertTrustConfigured": bool, + "lastInventoryUploadTime": "2020-02-20 00:00:00", + "lastUsageUploadTime": "2020-02-20 00:00:00", "licenseType": "str", + "maxServerMemoryMB": 0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "assessmentViewedTime": "2020-02-20 00:00:00", + "enabled": bool, + "impactedObjectsSummary": { + "azureSqlDatabase": [{"featureId": "str", "issueCategory": "str", "numberImpacted": 0}], + "azureSqlManagedInstance": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + }, + "serverAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "impactedObjects": [{"impactDetail": "str", "name": "str", "objectType": "str"}], + "issueCategory": "str", + "moreInformation": "str", + } + ], + "settings": { + "comfortFactor": 0, + "costOptions": { + "computeAndStorageCostOption": "str", + "sqlLicenseCostOption": "str", + "windowsLicenseCostOption": "str", + }, + "currency": "str", + "discountPercentage": 0.0, + "lookbackPeriodInDays": 0, + "percentile": 0.0, + "strategy": "str", + "targetLocation": "str", + }, + "skuRecommendationResults": { + "azureSqlDatabase": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": {"availableVmSkus": ["str"], "virtualMachineFamily": "str"}, + "computeSize": 0, + "dataDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "logDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "tempDbDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "virtualMachineSize": { + "azureSkuName": "str", + "computeSize": 0, + "maxNetworkInterfaces": 0, + "sizeName": "str", + "vCPUsAvailable": 0, + "virtualMachineFamily": "str", + }, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + "version": "str", + }, + "targetResourceId": "str", + "targetSelectedTime": "2020-02-20 00:00:00", + }, + "monitoring": {"enabled": bool}, "patchLevel": "str", "productId": "str", "provisioningState": "str", + "serviceType": "str", + "status": "str", "tcpDynamicPorts": "str", "tcpStaticPorts": "str", + "traceFlags": [0], + "upgradeLockedUntil": "2020-02-20 00:00:00", "vCore": "str", "version": "str", + "vmId": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -92,7 +295,265 @@ def test_sql_server_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", + ).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_sql_server_instances_begin_update(self, resource_group): + response = self.client.sql_server_instances.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + parameters={ + "properties": { + "alwaysOnRole": "str", + "authentication": { + "mode": "str", + "sqlServerEntraIdentity": [{"clientId": "str", "identityType": "str"}], + }, + "azureDefenderStatus": "str", + "azureDefenderStatusLastUpdated": "2020-02-20 00:00:00", + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "bestPracticesAssessment": { + "enabled": bool, + "schedule": { + "cronTrigger": {"expression": "str", "startTime": "str", "timeZone": "str"}, + "enabled": bool, + }, + }, + "clientConnection": {"enabled": bool}, + "collation": "str", + "containerResourceId": "str", + "cores": "str", + "createTime": "str", + "currentVersion": "str", + "databaseMirroringEndpoint": { + "certificateExpiryDate": "2020-02-20 00:00:00", + "certificateName": "str", + "connectionAuth": "str", + "encryptionAlgorithm": "str", + "endpointName": "str", + "ipAddress": "str", + "isDynamicPort": bool, + "isEncryptionEnabled": bool, + "port": 0, + "role": "str", + }, + "dbMasterKeyExists": bool, + "discoverySource": "str", + "edition": "str", + "failoverCluster": { + "hostIPAddresses": [{"ipAddress": "str", "subnetMask": "str"}], + "hostNames": ["str"], + "id": "str", + "networkName": "str", + "sqlInstanceIds": ["str"], + }, + "hostType": "str", + "instanceName": "str", + "isDigiCertPkiCertTrustConfigured": bool, + "isHadrEnabled": bool, + "isMicrosoftPkiCertTrustConfigured": bool, + "lastInventoryUploadTime": "2020-02-20 00:00:00", + "lastUsageUploadTime": "2020-02-20 00:00:00", + "licenseType": "str", + "maxServerMemoryMB": 0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "assessmentViewedTime": "2020-02-20 00:00:00", + "enabled": bool, + "impactedObjectsSummary": { + "azureSqlDatabase": [{"featureId": "str", "issueCategory": "str", "numberImpacted": 0}], + "azureSqlManagedInstance": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + }, + "serverAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "impactedObjects": [{"impactDetail": "str", "name": "str", "objectType": "str"}], + "issueCategory": "str", + "moreInformation": "str", + } + ], + "settings": { + "comfortFactor": 0, + "costOptions": { + "computeAndStorageCostOption": "str", + "sqlLicenseCostOption": "str", + "windowsLicenseCostOption": "str", + }, + "currency": "str", + "discountPercentage": 0.0, + "lookbackPeriodInDays": 0, + "percentile": 0.0, + "strategy": "str", + "targetLocation": "str", + }, + "skuRecommendationResults": { + "azureSqlDatabase": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": {"availableVmSkus": ["str"], "virtualMachineFamily": "str"}, + "computeSize": 0, + "dataDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "logDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "tempDbDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "virtualMachineSize": { + "azureSkuName": "str", + "computeSize": 0, + "maxNetworkInterfaces": 0, + "sizeName": "str", + "vCPUsAvailable": 0, + "virtualMachineFamily": "str", + }, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + "version": "str", + }, + "targetResourceId": "str", + "targetSelectedTime": "2020-02-20 00:00:00", + }, + "monitoring": {"enabled": bool}, + "patchLevel": "str", + "productId": "str", + "provisioningState": "str", + "serviceType": "str", + "status": "str", + "tcpDynamicPorts": "str", + "tcpStaticPorts": "str", + "traceFlags": [0], + "upgradeLockedUntil": "2020-02-20 00:00:00", + "vCore": "str", + "version": "str", + "vmId": "str", + }, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -104,7 +565,6 @@ def test_sql_server_instances_begin_delete(self, resource_group): response = self.client.sql_server_instances.begin_delete( resource_group_name=resource_group.name, sql_server_instance_name="str", - api_version="2022-03-01-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -112,13 +572,206 @@ def test_sql_server_instances_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_server_instances_update(self, resource_group): - response = self.client.sql_server_instances.update( + def test_sql_server_instances_list_by_resource_group(self, resource_group): + response = self.client.sql_server_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_list(self, resource_group): + response = self.client.sql_server_instances.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_get_telemetry(self, resource_group): + response = self.client.sql_server_instances.begin_get_telemetry( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_telemetry_request={ + "datasetName": "str", + "aggregationType": "str", + "databaseNames": ["str"], + "endTime": "2020-02-20 00:00:00", + "interval": "1 day, 0:00:00", + "startTime": "2020-02-20 00:00:00", + }, + ).result() # call '.result()' to poll until service return final result + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_get_best_practices_assessment(self, resource_group): + response = self.client.sql_server_instances.begin_get_best_practices_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_bpa_request={ + "queryType": "str", + "reportId": "str", + "reportType": "str", + "skipToken": "str", + }, + ).result() # call '.result()' to poll until service return final result + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_run_migration_assessment(self, resource_group): + response = self.client.sql_server_instances.run_migration_assessment( resource_group_name=resource_group.name, sql_server_instance_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2022-03-01-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_run_target_recommendation_job(self, resource_group): + response = self.client.sql_server_instances.begin_run_target_recommendation_job( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_get_target_recommendation_reports(self, resource_group): + response = self.client.sql_server_instances.begin_get_target_recommendation_reports( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_get_migration_readiness_report(self, resource_group): + response = self.client.sql_server_instances.begin_get_migration_readiness_report( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_run_best_practices_assessment(self, resource_group): + response = self.client.sql_server_instances.run_best_practices_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_run_best_practice_assessment(self, resource_group): + response = self.client.sql_server_instances.begin_run_best_practice_assessment( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_run_migration_readiness_assessment(self, resource_group): + response = self.client.sql_server_instances.begin_run_migration_readiness_assessment( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_get_jobs_status(self, resource_group): + response = self.client.sql_server_instances.get_jobs_status( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_get_jobs(self, resource_group): + response = self.client.sql_server_instances.begin_get_jobs( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_pre_upgrade(self, resource_group): + response = self.client.sql_server_instances.pre_upgrade( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_post_upgrade(self, resource_group): + response = self.client.sql_server_instances.post_upgrade( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_begin_run_managed_instance_link_assessment(self, resource_group): + response = self.client.sql_server_instances.begin_run_managed_instance_link_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_managed_instance_link_assessment_request={ + "availabilityGroupName": "str", + "azureManagedInstanceResourceId": "str", + "databaseNames": ["str"], + "distributedAvailabilityGroupName": "str", + "assessmentCategories": ["str"], + "azureManagedInstanceRole": "str", + "sqlServerIpAddress": "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_sql_server_instances_get_all_availability_groups(self, resource_group): + response = self.client.sql_server_instances.get_all_availability_groups( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations_async.py index fe695873435f..85a107e4a52b 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations_async.py +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_instances_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestAzureArcDataManagementSqlServerInstancesOperationsAsync(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_server_instances_list(self, resource_group): - response = self.client.sql_server_instances.list( - api_version="2022-03-01-preview", - ) - 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_sql_server_instances_list_by_resource_group(self, resource_group): - response = self.client.sql_server_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-03-01-preview", - ) - 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_sql_server_instances_get(self, resource_group): response = await self.client.sql_server_instances.get( resource_group_name=resource_group.name, sql_server_instance_name="str", - api_version="2022-03-01-preview", ) # please add some check logic here by yourself @@ -64,24 +42,253 @@ async def test_sql_server_instances_begin_create(self, resource_group): "id": "str", "name": "str", "properties": { - "containerResourceId": "str", - "status": "str", + "alwaysOnRole": "str", + "authentication": { + "mode": "str", + "sqlServerEntraIdentity": [{"clientId": "str", "identityType": "str"}], + }, "azureDefenderStatus": "str", "azureDefenderStatusLastUpdated": "2020-02-20 00:00:00", + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "bestPracticesAssessment": { + "enabled": bool, + "schedule": { + "cronTrigger": {"expression": "str", "startTime": "str", "timeZone": "str"}, + "enabled": bool, + }, + }, + "clientConnection": {"enabled": bool}, "collation": "str", + "containerResourceId": "str", + "cores": "str", "createTime": "str", "currentVersion": "str", + "databaseMirroringEndpoint": { + "certificateExpiryDate": "2020-02-20 00:00:00", + "certificateName": "str", + "connectionAuth": "str", + "encryptionAlgorithm": "str", + "endpointName": "str", + "ipAddress": "str", + "isDynamicPort": bool, + "isEncryptionEnabled": bool, + "port": 0, + "role": "str", + }, + "dbMasterKeyExists": bool, + "discoverySource": "str", "edition": "str", + "failoverCluster": { + "hostIPAddresses": [{"ipAddress": "str", "subnetMask": "str"}], + "hostNames": ["str"], + "id": "str", + "networkName": "str", + "sqlInstanceIds": ["str"], + }, "hostType": "str", "instanceName": "str", + "isDigiCertPkiCertTrustConfigured": bool, + "isHadrEnabled": bool, + "isMicrosoftPkiCertTrustConfigured": bool, + "lastInventoryUploadTime": "2020-02-20 00:00:00", + "lastUsageUploadTime": "2020-02-20 00:00:00", "licenseType": "str", + "maxServerMemoryMB": 0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "assessmentViewedTime": "2020-02-20 00:00:00", + "enabled": bool, + "impactedObjectsSummary": { + "azureSqlDatabase": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "azureSqlManagedInstance": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + }, + "serverAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "impactedObjects": [ + {"impactDetail": "str", "name": "str", "objectType": "str"} + ], + "issueCategory": "str", + "moreInformation": "str", + } + ], + "settings": { + "comfortFactor": 0, + "costOptions": { + "computeAndStorageCostOption": "str", + "sqlLicenseCostOption": "str", + "windowsLicenseCostOption": "str", + }, + "currency": "str", + "discountPercentage": 0.0, + "lookbackPeriodInDays": 0, + "percentile": 0.0, + "strategy": "str", + "targetLocation": "str", + }, + "skuRecommendationResults": { + "azureSqlDatabase": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": {"availableVmSkus": ["str"], "virtualMachineFamily": "str"}, + "computeSize": 0, + "dataDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "logDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "tempDbDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "virtualMachineSize": { + "azureSkuName": "str", + "computeSize": 0, + "maxNetworkInterfaces": 0, + "sizeName": "str", + "vCPUsAvailable": 0, + "virtualMachineFamily": "str", + }, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + "version": "str", + }, + "targetResourceId": "str", + "targetSelectedTime": "2020-02-20 00:00:00", + }, + "monitoring": {"enabled": bool}, "patchLevel": "str", "productId": "str", "provisioningState": "str", + "serviceType": "str", + "status": "str", "tcpDynamicPorts": "str", "tcpStaticPorts": "str", + "traceFlags": [0], + "upgradeLockedUntil": "2020-02-20 00:00:00", "vCore": "str", "version": "str", + "vmId": "str", }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -94,7 +301,271 @@ async def test_sql_server_instances_begin_create(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-03-01-preview", + ) + ).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_sql_server_instances_begin_update(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_update( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + parameters={ + "properties": { + "alwaysOnRole": "str", + "authentication": { + "mode": "str", + "sqlServerEntraIdentity": [{"clientId": "str", "identityType": "str"}], + }, + "azureDefenderStatus": "str", + "azureDefenderStatusLastUpdated": "2020-02-20 00:00:00", + "backupPolicy": { + "differentialBackupHours": 0, + "fullBackupDays": 0, + "retentionPeriodDays": 0, + "transactionLogBackupMinutes": 0, + }, + "bestPracticesAssessment": { + "enabled": bool, + "schedule": { + "cronTrigger": {"expression": "str", "startTime": "str", "timeZone": "str"}, + "enabled": bool, + }, + }, + "clientConnection": {"enabled": bool}, + "collation": "str", + "containerResourceId": "str", + "cores": "str", + "createTime": "str", + "currentVersion": "str", + "databaseMirroringEndpoint": { + "certificateExpiryDate": "2020-02-20 00:00:00", + "certificateName": "str", + "connectionAuth": "str", + "encryptionAlgorithm": "str", + "endpointName": "str", + "ipAddress": "str", + "isDynamicPort": bool, + "isEncryptionEnabled": bool, + "port": 0, + "role": "str", + }, + "dbMasterKeyExists": bool, + "discoverySource": "str", + "edition": "str", + "failoverCluster": { + "hostIPAddresses": [{"ipAddress": "str", "subnetMask": "str"}], + "hostNames": ["str"], + "id": "str", + "networkName": "str", + "sqlInstanceIds": ["str"], + }, + "hostType": "str", + "instanceName": "str", + "isDigiCertPkiCertTrustConfigured": bool, + "isHadrEnabled": bool, + "isMicrosoftPkiCertTrustConfigured": bool, + "lastInventoryUploadTime": "2020-02-20 00:00:00", + "lastUsageUploadTime": "2020-02-20 00:00:00", + "licenseType": "str", + "maxServerMemoryMB": 0, + "migration": { + "assessment": { + "assessmentUploadTime": "2020-02-20 00:00:00", + "assessmentViewedTime": "2020-02-20 00:00:00", + "enabled": bool, + "impactedObjectsSummary": { + "azureSqlDatabase": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + "azureSqlManagedInstance": [ + {"featureId": "str", "issueCategory": "str", "numberImpacted": 0} + ], + }, + "serverAssessments": [ + { + "appliesToMigrationTargetPlatform": "str", + "featureId": "str", + "impactedObjects": [ + {"impactDetail": "str", "name": "str", "objectType": "str"} + ], + "issueCategory": "str", + "moreInformation": "str", + } + ], + "settings": { + "comfortFactor": 0, + "costOptions": { + "computeAndStorageCostOption": "str", + "sqlLicenseCostOption": "str", + "windowsLicenseCostOption": "str", + }, + "currency": "str", + "discountPercentage": 0.0, + "lookbackPeriodInDays": 0, + "percentile": 0.0, + "strategy": "str", + "targetLocation": "str", + }, + "skuRecommendationResults": { + "azureSqlDatabase": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlManagedInstance": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": { + "computeTier": "str", + "hardwareType": "str", + "sqlPurchasingModel": "str", + "sqlServiceTier": "str", + "zoneRedundancyAvailable": bool, + }, + "computeSize": 0, + "maxStorageIops": 0.0, + "maxThroughputMBps": 0.0, + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "storageMaxSizeInMb": 0.0, + }, + }, + "azureSqlVirtualMachine": { + "monthlyCost": { + "computeCost": 0.0, + "iopsCost": 0.0, + "sqlLicenseCost": 0.0, + "storageCost": 0.0, + "totalCost": 0.0, + "windowsLicenseCost": 0.0, + }, + "monthlyCostOptions": [ + { + "keyName": "str", + "keyValue": {"computeCost": 0.0, "iopsCost": 0.0, "storageCost": 0.0}, + } + ], + "numberOfServerBlockerIssues": 0, + "recommendationStatus": "str", + "targetSku": { + "category": {"availableVmSkus": ["str"], "virtualMachineFamily": "str"}, + "computeSize": 0, + "dataDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "logDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "predictedDataSizeInMb": 0.0, + "predictedLogSizeInMb": 0.0, + "tempDbDiskSizes": [ + { + "caching": "str", + "diskType": "str", + "maxIops": 0.0, + "maxSizeInGib": 0.0, + "maxThroughputInMbps": 0.0, + "redundancy": "str", + "size": "str", + } + ], + "virtualMachineSize": { + "azureSkuName": "str", + "computeSize": 0, + "maxNetworkInterfaces": 0, + "sizeName": "str", + "vCPUsAvailable": 0, + "virtualMachineFamily": "str", + }, + }, + }, + }, + "targetRecommendationGenerationTime": "2020-02-20 00:00:00", + "version": "str", + }, + "targetResourceId": "str", + "targetSelectedTime": "2020-02-20 00:00:00", + }, + "monitoring": {"enabled": bool}, + "patchLevel": "str", + "productId": "str", + "provisioningState": "str", + "serviceType": "str", + "status": "str", + "tcpDynamicPorts": "str", + "tcpStaticPorts": "str", + "traceFlags": [0], + "upgradeLockedUntil": "2020-02-20 00:00:00", + "vCore": "str", + "version": "str", + "vmId": "str", + }, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -108,7 +579,6 @@ async def test_sql_server_instances_begin_delete(self, resource_group): await self.client.sql_server_instances.begin_delete( resource_group_name=resource_group.name, sql_server_instance_name="str", - api_version="2022-03-01-preview", ) ).result() # call '.result()' to poll until service return final result @@ -117,13 +587,224 @@ async def test_sql_server_instances_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_server_instances_update(self, resource_group): - response = await self.client.sql_server_instances.update( + async def test_sql_server_instances_list_by_resource_group(self, resource_group): + response = self.client.sql_server_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + 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_sql_server_instances_list(self, resource_group): + response = self.client.sql_server_instances.list() + 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_sql_server_instances_begin_get_telemetry(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_get_telemetry( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_telemetry_request={ + "datasetName": "str", + "aggregationType": "str", + "databaseNames": ["str"], + "endTime": "2020-02-20 00:00:00", + "interval": "1 day, 0:00:00", + "startTime": "2020-02-20 00:00:00", + }, + ) + ).result() # call '.result()' to poll until service return final result + 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_sql_server_instances_begin_get_best_practices_assessment(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_get_best_practices_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_bpa_request={ + "queryType": "str", + "reportId": "str", + "reportType": "str", + "skipToken": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + 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_sql_server_instances_run_migration_assessment(self, resource_group): + response = await self.client.sql_server_instances.run_migration_assessment( resource_group_name=resource_group.name, sql_server_instance_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2022-03-01-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_begin_run_target_recommendation_job(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_run_target_recommendation_job( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_get_target_recommendation_reports(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_get_target_recommendation_reports( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_get_migration_readiness_report(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_get_migration_readiness_report( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_run_best_practices_assessment(self, resource_group): + response = await self.client.sql_server_instances.run_best_practices_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_begin_run_best_practice_assessment(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_run_best_practice_assessment( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_begin_run_migration_readiness_assessment(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_run_migration_readiness_assessment( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_get_jobs_status(self, resource_group): + response = await self.client.sql_server_instances.get_jobs_status( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_begin_get_jobs(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_get_jobs( + resource_group_name=resource_group.name, + sql_server_instance_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_sql_server_instances_pre_upgrade(self, resource_group): + response = await self.client.sql_server_instances.pre_upgrade( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_post_upgrade(self, resource_group): + response = await self.client.sql_server_instances.post_upgrade( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_begin_run_managed_instance_link_assessment(self, resource_group): + response = await ( + await self.client.sql_server_instances.begin_run_managed_instance_link_assessment( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + sql_server_instance_managed_instance_link_assessment_request={ + "availabilityGroupName": "str", + "azureManagedInstanceResourceId": "str", + "databaseNames": ["str"], + "distributedAvailabilityGroupName": "str", + "assessmentCategories": ["str"], + "azureManagedInstanceRole": "str", + "sqlServerIpAddress": "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_sql_server_instances_get_all_availability_groups(self, resource_group): + response = self.client.sql_server_instances.get_all_availability_groups( + resource_group_name=resource_group.name, + sql_server_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations.py new file mode 100644 index 000000000000..2b37a2bfc3cf --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations.py @@ -0,0 +1,119 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerLicensesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_get(self, resource_group): + response = self.client.sql_server_licenses.get( + resource_group_name=resource_group.name, + sql_server_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_create(self, resource_group): + response = self.client.sql_server_licenses.create( + resource_group_name=resource_group.name, + sql_server_license_name="str", + sql_server_license={ + "location": "str", + "properties": { + "activationState": "str", + "billingPlan": "str", + "licenseCategory": "str", + "physicalCores": 0, + "scopeType": "str", + "lastActivatedAt": "2020-02-20 00:00:00", + "lastDeactivatedAt": "2020-02-20 00:00:00", + "tenantId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_update(self, resource_group): + response = self.client.sql_server_licenses.update( + resource_group_name=resource_group.name, + sql_server_license_name="str", + parameters={ + "properties": { + "activationState": "str", + "billingPlan": "str", + "lastActivatedAt": "2020-02-20 00:00:00", + "lastDeactivatedAt": "2020-02-20 00:00:00", + "licenseCategory": "str", + "physicalCores": 0, + "scopeType": "str", + "tenantId": "str", + }, + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_delete(self, resource_group): + response = self.client.sql_server_licenses.delete( + resource_group_name=resource_group.name, + sql_server_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_list_by_resource_group(self, resource_group): + response = self.client.sql_server_licenses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_list(self, resource_group): + response = self.client.sql_server_licenses.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations_async.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations_async.py new file mode 100644 index 000000000000..c2922319633b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/generated_tests/test_azure_arc_data_management_sql_server_licenses_operations_async.py @@ -0,0 +1,120 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +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 TestAzureArcDataManagementSqlServerLicensesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_get(self, resource_group): + response = await self.client.sql_server_licenses.get( + resource_group_name=resource_group.name, + sql_server_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_create(self, resource_group): + response = await self.client.sql_server_licenses.create( + resource_group_name=resource_group.name, + sql_server_license_name="str", + sql_server_license={ + "location": "str", + "properties": { + "activationState": "str", + "billingPlan": "str", + "licenseCategory": "str", + "physicalCores": 0, + "scopeType": "str", + "lastActivatedAt": "2020-02-20 00:00:00", + "lastDeactivatedAt": "2020-02-20 00:00:00", + "tenantId": "str", + }, + "id": "str", + "name": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_update(self, resource_group): + response = await self.client.sql_server_licenses.update( + resource_group_name=resource_group.name, + sql_server_license_name="str", + parameters={ + "properties": { + "activationState": "str", + "billingPlan": "str", + "lastActivatedAt": "2020-02-20 00:00:00", + "lastDeactivatedAt": "2020-02-20 00:00:00", + "licenseCategory": "str", + "physicalCores": 0, + "scopeType": "str", + "tenantId": "str", + }, + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_delete(self, resource_group): + response = await self.client.sql_server_licenses.delete( + resource_group_name=resource_group.name, + sql_server_license_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_list_by_resource_group(self, resource_group): + response = self.client.sql_server_licenses.list_by_resource_group( + resource_group_name=resource_group.name, + ) + 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_sql_server_licenses_list(self, resource_group): + response = self.client.sql_server_licenses.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/pyproject.toml b/sdk/azurearcdata/azure-mgmt-azurearcdata/pyproject.toml index 27d03a524aaa..57be003f71bb 100644 --- a/sdk/azurearcdata/azure-mgmt-azurearcdata/pyproject.toml +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Azurearcdata Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "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", @@ -79,7 +79,7 @@ package_name = "azure-mgmt-azurearcdata" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Azure Arc Data Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true title = "AzureArcDataManagementClient" need_msrestazure = false diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/conftest.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/conftest.py new file mode 100644 index 000000000000..d87be4c124d7 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/conftest.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. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + azurearcdatamanagement_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + azurearcdatamanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + azurearcdatamanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + azurearcdatamanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=azurearcdatamanagement_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=azurearcdatamanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=azurearcdatamanagement_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=azurearcdatamanagement_client_secret, value="00000000-0000-0000-0000-000000000000" + ) + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_async_test.py new file mode 100644 index 000000000000..8b9198c7e716 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementDataControllersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_data_controllers_list_in_subscription(self, resource_group): + response = self.client.data_controllers.list_in_subscription() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_test.py new file mode 100644 index 000000000000..9e0737765a19 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_data_controllers_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementDataControllersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_data_controllers_list_in_subscription(self, resource_group): + response = self.client.data_controllers.list_in_subscription() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_async_test.py new file mode 100644 index 000000000000..0ea46ddb571f --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_test.py new file mode 100644 index 000000000000..6a39ad2fa38b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_async_test.py new file mode 100644 index 000000000000..797ec41df514 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementPostgresInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_postgres_instances_list(self, resource_group): + response = self.client.postgres_instances.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_test.py new file mode 100644 index 000000000000..dc4b88ee7e66 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_postgres_instances_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementPostgresInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_postgres_instances_list(self, resource_group): + response = self.client.postgres_instances.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_async_test.py new file mode 100644 index 000000000000..f3248670acd7 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlManagedInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_managed_instances_list(self, resource_group): + response = self.client.sql_managed_instances.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_test.py new file mode 100644 index 000000000000..355be05d1d9a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_managed_instances_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlManagedInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_managed_instances_list(self, resource_group): + response = self.client.sql_managed_instances.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async_test.py new file mode 100644 index 000000000000..3adb1502705b --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerEsuLicensesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_esu_licenses_list(self, resource_group): + response = self.client.sql_server_esu_licenses.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_test.py new file mode 100644 index 000000000000..894053bf1785 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_esu_licenses_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerEsuLicensesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_esu_licenses_list(self, resource_group): + response = self.client.sql_server_esu_licenses.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_async_test.py new file mode 100644 index 000000000000..7a617e1934d0 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_instances_list(self, resource_group): + response = self.client.sql_server_instances.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_test.py new file mode 100644 index 000000000000..2c0d47d64f1c --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_instances_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_instances_list(self, resource_group): + response = self.client.sql_server_instances.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_async_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_async_test.py new file mode 100644 index 000000000000..6b22a1f5d28a --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_async_test.py @@ -0,0 +1,27 @@ +# 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.azurearcdata.aio import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerLicensesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_server_licenses_list(self, resource_group): + response = self.client.sql_server_licenses.list() + result = [r async for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_test.py b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_test.py new file mode 100644 index 000000000000..eb02fce49bdb --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tests/test_azure_arc_data_management_sql_server_licenses_operations_test.py @@ -0,0 +1,26 @@ +# 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.azurearcdata import AzureArcDataManagementClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestAzureArcDataManagementSqlServerLicensesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureArcDataManagementClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_server_licenses_list(self, resource_group): + response = self.client.sql_server_licenses.list() + result = [r for r in response] + assert len(result) diff --git a/sdk/azurearcdata/azure-mgmt-azurearcdata/tsp-location.yaml b/sdk/azurearcdata/azure-mgmt-azurearcdata/tsp-location.yaml new file mode 100644 index 000000000000..e817ce7afa77 --- /dev/null +++ b/sdk/azurearcdata/azure-mgmt-azurearcdata/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azurearcdata/AzureArcData.Management +commit: 0e47f51219c4dac6a75e69a75d158298b852eda3 +repo: Azure/azure-rest-api-specs +additionalDirectories: