diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md b/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md index 833882b21937..3260454baf22 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/CHANGELOG.md @@ -1,5 +1,116 @@ # Release History +## 2.0.0 (2025-05-13) + +### Features Added + + - Client `OracleDatabaseMgmtClient` added operation group `exadb_vm_clusters` + - Client `OracleDatabaseMgmtClient` added operation group `exascale_db_storage_vaults` + - Client `OracleDatabaseMgmtClient` added operation group `flex_components` + - Client `OracleDatabaseMgmtClient` added operation group `gi_minor_versions` + - Client `OracleDatabaseMgmtClient` added operation group `exascale_db_nodes` + - Model `AutonomousDatabaseBackupUpdate` added property `id` + - Model `AutonomousDatabaseBackupUpdate` added property `name` + - Model `AutonomousDatabaseBackupUpdate` added property `type` + - Model `AutonomousDatabaseBackupUpdate` added property `system_data` + - Model `AutonomousDatabaseBaseProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseBaseProperties` added property `remote_disaster_recovery_configuration` + - Model `AutonomousDatabaseCloneProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseCloneProperties` added property `remote_disaster_recovery_configuration` + - Model `AutonomousDatabaseProperties` added property `time_disaster_recovery_role_changed` + - Model `AutonomousDatabaseProperties` added property `remote_disaster_recovery_configuration` + - Model `CloudExadataInfrastructureProperties` added property `defined_file_system_configuration` + - Model `CloudExadataInfrastructureProperties` added property `database_server_type` + - Model `CloudExadataInfrastructureProperties` added property `storage_server_type` + - Model `CloudExadataInfrastructureProperties` added property `compute_model` + - Model `CloudVmClusterProperties` added property `file_system_configuration_details` + - Model `CloudVmClusterProperties` added property `compute_model` + - Model `CloudVmClusterUpdateProperties` added property `file_system_configuration_details` + - Enum `DataBaseType` added member `CLONE_FROM_BACKUP_TIMESTAMP` + - Enum `DataBaseType` added member `CROSS_REGION_DISASTER_RECOVERY` + - Model `DbServerProperties` added property `compute_model` + - Model `DbSystemShapeProperties` added property `shape_name` + - Model `DbSystemShapeProperties` added property `compute_model` + - Model `DbSystemShapeProperties` added property `are_server_types_supported` + - Model `DbSystemShapeProperties` added property `display_name` + - Model `OracleSubscriptionProperties` added property `azure_subscription_ids` + - Model `OracleSubscriptionProperties` added property `add_subscription_operation_state` + - Model `OracleSubscriptionProperties` added property `last_operation_status_detail` + - Model `PeerDbDetails` added property `peer_db_ocid` + - Model `PeerDbDetails` added property `peer_db_location` + - Added enum `AddSubscriptionOperationState` + - Added model `AutonomousDatabaseCrossRegionDisasterRecoveryProperties` + - Added model `AutonomousDatabaseFromBackupTimestampProperties` + - Added model `AzureSubscriptions` + - Added model `DbActionResponse` + - Added model `DbNodeDetails` + - Added model `DefinedFileSystemConfiguration` + - Added model `DisasterRecoveryConfigurationDetails` + - Added model `ExadbVmCluster` + - Added enum `ExadbVmClusterLifecycleState` + - Added model `ExadbVmClusterListResult` + - Added model `ExadbVmClusterProperties` + - Added model `ExadbVmClusterStorageDetails` + - Added model `ExadbVmClusterUpdate` + - Added model `ExadbVmClusterUpdateProperties` + - Added model `ExascaleDbNode` + - Added model `ExascaleDbNodeListResult` + - Added model `ExascaleDbNodeProperties` + - Added model `ExascaleDbStorageDetails` + - Added model `ExascaleDbStorageInputDetails` + - Added model `ExascaleDbStorageVault` + - Added enum `ExascaleDbStorageVaultLifecycleState` + - Added model `ExascaleDbStorageVaultListResult` + - Added model `ExascaleDbStorageVaultProperties` + - Added model `ExascaleDbStorageVaultTagsUpdate` + - Added model `FileSystemConfigurationDetails` + - Added model `FlexComponent` + - Added model `FlexComponentListResult` + - Added model `FlexComponentProperties` + - Added model `GiMinorVersion` + - Added model `GiMinorVersionListResult` + - Added model `GiMinorVersionProperties` + - Added enum `GridImageType` + - Added enum `HardwareType` + - Added model `RemoveVirtualMachineFromExadbVmClusterDetails` + - Added enum `ShapeFamily` + - Added enum `SystemShapes` + - Model `AutonomousDatabaseBackupsOperations` added method `list_by_parent` + - Model `AutonomousDatabasesOperations` added method `begin_change_disaster_recovery_configuration` + - Model `DbNodesOperations` added method `list_by_parent` + - Model `DbServersOperations` added method `list_by_parent` + - Model `OracleSubscriptionsOperations` added method `begin_add_azure_subscriptions` + - Model `VirtualNetworkAddressesOperations` added method `list_by_parent` + - Added model `ExadbVmClustersOperations` + - Added model `ExascaleDbNodesOperations` + - Added model `ExascaleDbStorageVaultsOperations` + - Added model `FlexComponentsOperations` + - Added model `GiMinorVersionsOperations` + - Method `AutonomousDatabasesOperations.begin_change_disaster_recovery_configuration` has a new overload `def begin_change_disaster_recovery_configuration(self: None, resource_group_name: str, autonomousdatabasename: str, body: DisasterRecoveryConfigurationDetails, content_type: str)` + - Method `AutonomousDatabasesOperations.begin_change_disaster_recovery_configuration` has a new overload `def begin_change_disaster_recovery_configuration(self: None, resource_group_name: str, autonomousdatabasename: str, body: IO[bytes], content_type: str)` + - Method `OracleSubscriptionsOperations.begin_add_azure_subscriptions` has a new overload `def begin_add_azure_subscriptions(self: None, body: AzureSubscriptions, content_type: str)` + - Method `OracleSubscriptionsOperations.begin_add_azure_subscriptions` has a new overload `def begin_add_azure_subscriptions(self: None, body: IO[bytes], content_type: str)` + - Method `ExadbVmClustersOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, exadb_vm_cluster_name: str, resource: ExadbVmCluster, content_type: str)` + - Method `ExadbVmClustersOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, exadb_vm_cluster_name: str, resource: IO[bytes], content_type: str)` + - Method `ExadbVmClustersOperations.begin_remove_vms` has a new overload `def begin_remove_vms(self: None, resource_group_name: str, exadb_vm_cluster_name: str, body: RemoveVirtualMachineFromExadbVmClusterDetails, content_type: str)` + - Method `ExadbVmClustersOperations.begin_remove_vms` has a new overload `def begin_remove_vms(self: None, resource_group_name: str, exadb_vm_cluster_name: str, body: IO[bytes], content_type: str)` + - Method `ExadbVmClustersOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, exadb_vm_cluster_name: str, properties: ExadbVmClusterUpdate, content_type: str)` + - Method `ExadbVmClustersOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, exadb_vm_cluster_name: str, properties: IO[bytes], content_type: str)` + - Method `ExascaleDbNodesOperations.begin_action` has a new overload `def begin_action(self: None, resource_group_name: str, exadb_vm_cluster_name: str, exascale_db_node_name: str, body: DbNodeAction, content_type: str)` + - Method `ExascaleDbNodesOperations.begin_action` has a new overload `def begin_action(self: None, resource_group_name: str, exadb_vm_cluster_name: str, exascale_db_node_name: str, body: IO[bytes], content_type: str)` + - Method `ExascaleDbStorageVaultsOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, exascale_db_storage_vault_name: str, resource: ExascaleDbStorageVault, content_type: str)` + - Method `ExascaleDbStorageVaultsOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, exascale_db_storage_vault_name: str, resource: IO[bytes], content_type: str)` + - Method `ExascaleDbStorageVaultsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, exascale_db_storage_vault_name: str, properties: ExascaleDbStorageVaultTagsUpdate, content_type: str)` + - Method `ExascaleDbStorageVaultsOperations.begin_update` has a new overload `def begin_update(self: None, resource_group_name: str, exascale_db_storage_vault_name: str, properties: IO[bytes], content_type: str)` + +### Breaking Changes + + - Deleted or renamed model `AutonomousDatabaseBackupUpdateProperties` + - Deleted or renamed method `AutonomousDatabaseBackupsOperations.list_by_autonomous_database` + - Deleted or renamed method `DbNodesOperations.list_by_cloud_vm_cluster` + - Deleted or renamed method `DbServersOperations.list_by_cloud_exadata_infrastructure` + - Deleted or renamed method `VirtualNetworkAddressesOperations.list_by_cloud_vm_cluster` + ## 1.0.0 (2024-07-04) ### Other Changes diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md b/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md index d8be03bef386..50195d4b3844 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Oracledatabase Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) 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/oracledatabase/azure-mgmt-oracledatabase/_meta.json b/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json index 42c469843afc..3a53a3dcb276 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/_meta.json @@ -1,11 +1,11 @@ { - "commit": "a83c34348fbd25ad79a05e36816b91da0122b583", + "commit": "b9a8c9e8eb8998a222f126a005d1ab633f1daad9", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.19", + "@autorest/python@6.34.1", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/oracle/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.19 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/oracle/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/oracle/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py index d771d453e326..f5de9044d637 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "OracleDatabaseMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py index 8ea73084e943..b677c82e4b5e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for OracleDatabaseMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-09-01") + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py index 868640f5c6e8..7c66723b8c8d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_oracle_database_mgmt_client.py @@ -7,16 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models from ._configuration import OracleDatabaseMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( AutonomousDatabaseBackupsOperations, AutonomousDatabaseCharacterSetsOperations, @@ -30,6 +33,11 @@ DbSystemShapesOperations, DnsPrivateViewsOperations, DnsPrivateZonesOperations, + ExadbVmClustersOperations, + ExascaleDbNodesOperations, + ExascaleDbStorageVaultsOperations, + FlexComponentsOperations, + GiMinorVersionsOperations, GiVersionsOperations, Operations, OracleSubscriptionsOperations, @@ -38,11 +46,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class OracleDatabaseMgmtClient: # pylint: disable=too-many-instance-attributes """OracleDatabaseMgmtClient. :ivar operations: Operations operations @@ -55,6 +62,11 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke azure.mgmt.oracledatabase.operations.CloudExadataInfrastructuresOperations :ivar cloud_vm_clusters: CloudVmClustersOperations operations :vartype cloud_vm_clusters: azure.mgmt.oracledatabase.operations.CloudVmClustersOperations + :ivar exadb_vm_clusters: ExadbVmClustersOperations operations + :vartype exadb_vm_clusters: azure.mgmt.oracledatabase.operations.ExadbVmClustersOperations + :ivar exascale_db_storage_vaults: ExascaleDbStorageVaultsOperations operations + :vartype exascale_db_storage_vaults: + azure.mgmt.oracledatabase.operations.ExascaleDbStorageVaultsOperations :ivar autonomous_database_character_sets: AutonomousDatabaseCharacterSetsOperations operations :vartype autonomous_database_character_sets: azure.mgmt.oracledatabase.operations.AutonomousDatabaseCharacterSetsOperations @@ -71,8 +83,12 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :vartype dns_private_views: azure.mgmt.oracledatabase.operations.DnsPrivateViewsOperations :ivar dns_private_zones: DnsPrivateZonesOperations operations :vartype dns_private_zones: azure.mgmt.oracledatabase.operations.DnsPrivateZonesOperations + :ivar flex_components: FlexComponentsOperations operations + :vartype flex_components: azure.mgmt.oracledatabase.operations.FlexComponentsOperations :ivar gi_versions: GiVersionsOperations operations :vartype gi_versions: azure.mgmt.oracledatabase.operations.GiVersionsOperations + :ivar gi_minor_versions: GiMinorVersionsOperations operations + :vartype gi_minor_versions: azure.mgmt.oracledatabase.operations.GiMinorVersionsOperations :ivar system_versions: SystemVersionsOperations operations :vartype system_versions: azure.mgmt.oracledatabase.operations.SystemVersionsOperations :ivar oracle_subscriptions: OracleSubscriptionsOperations operations @@ -88,13 +104,15 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations :vartype virtual_network_addresses: azure.mgmt.oracledatabase.operations.VirtualNetworkAddressesOperations + :ivar exascale_db_nodes: ExascaleDbNodesOperations operations + :vartype exascale_db_nodes: azure.mgmt.oracledatabase.operations.ExascaleDbNodesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :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 "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". 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 @@ -102,15 +120,17 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = OracleDatabaseMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -129,7 +149,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -145,6 +165,12 @@ def __init__( self.cloud_vm_clusters = CloudVmClustersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.exadb_vm_clusters = ExadbVmClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_storage_vaults = ExascaleDbStorageVaultsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -161,7 +187,11 @@ def __init__( self.dns_private_zones = DnsPrivateZonesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.flex_components = FlexComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_minor_versions = GiMinorVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.oracle_subscriptions = OracleSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -174,6 +204,9 @@ def __init__( self.virtual_network_addresses = VirtualNetworkAddressesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.exascale_db_nodes = ExascaleDbNodesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. @@ -200,7 +233,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: def close(self) -> None: self._client.close() - def __enter__(self) -> "OracleDatabaseMgmtClient": + def __enter__(self) -> Self: self._client.__enter__() return self diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py similarity index 58% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py index 0dafe0e287ff..0af9b28f6607 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_vendor.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/__init__.py @@ -4,13 +4,3 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py similarity index 83% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py index f0c6180722c8..f5187701d7be 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_serialization.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -48,11 +30,8 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, - Mapping, ) try: @@ -62,13 +41,13 @@ 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 _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +70,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +93,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -144,6 +125,8 @@ def _json_attemp(data): # context otherwise. _LOGGER.critical("Wasn't XML not JSON, failing") raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod @@ -153,6 +136,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -177,80 +165,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -298,13 +244,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -324,7 +280,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -344,7 +304,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -378,12 +340,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -393,30 +358,31 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -424,9 +390,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -446,21 +414,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -499,11 +471,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -538,7 +512,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -558,13 +532,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -590,12 +567,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -631,7 +610,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -662,17 +642,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -701,7 +681,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -710,11 +690,13 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -726,21 +708,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -757,19 +738,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -778,21 +760,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -803,7 +784,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -819,11 +800,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -839,23 +819,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -869,8 +852,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -880,15 +862,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -943,9 +923,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -969,7 +948,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -977,6 +956,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1001,7 +981,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1032,56 +1012,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1089,11 +1074,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1103,30 +1089,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1139,12 +1127,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1170,13 +1159,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1184,11 +1174,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1209,7 +1199,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1230,17 +1222,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1277,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1329,22 +1333,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1352,7 +1355,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1361,9 +1364,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - 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_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1399,27 +1402,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1438,13 +1443,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1474,9 +1479,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1503,6 +1507,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1514,7 +1520,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1529,10 +1535,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1550,10 +1558,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1577,24 +1587,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1603,15 +1624,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1625,7 +1647,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1645,14 +1671,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1669,6 +1695,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1679,13 +1706,14 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1718,11 +1746,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1730,8 +1757,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1741,24 +1769,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1766,6 +1793,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1779,8 +1807,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1792,6 +1819,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1802,9 +1830,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1820,8 +1848,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1832,8 +1861,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1847,8 +1877,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1863,8 +1894,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1875,8 +1907,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1885,16 +1918,16 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1908,8 +1941,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1922,31 +1956,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1974,8 +2009,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1983,8 +2017,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1994,5 +2029,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py index c47f66669f1b..48944bf3938a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2.0.0" diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py index 6439ec348295..362764b54c0a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._oracle_database_mgmt_client import OracleDatabaseMgmtClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "OracleDatabaseMgmtClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py index 1b748e31fdd6..fa001d1e0002 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for OracleDatabaseMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -28,13 +27,13 @@ class OracleDatabaseMgmtClientConfiguration: # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2023-09-01") + api_version: str = kwargs.pop("api_version", "2025-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py index 9fd6887a3098..a69518a4ecda 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/_oracle_database_mgmt_client.py @@ -7,15 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +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 +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import OracleDatabaseMgmtClientConfiguration from .operations import ( AutonomousDatabaseBackupsOperations, @@ -30,6 +33,11 @@ DbSystemShapesOperations, DnsPrivateViewsOperations, DnsPrivateZonesOperations, + ExadbVmClustersOperations, + ExascaleDbNodesOperations, + ExascaleDbStorageVaultsOperations, + FlexComponentsOperations, + GiMinorVersionsOperations, GiVersionsOperations, Operations, OracleSubscriptionsOperations, @@ -38,11 +46,10 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class OracleDatabaseMgmtClient: # pylint: disable=too-many-instance-attributes """OracleDatabaseMgmtClient. :ivar operations: Operations operations @@ -55,6 +62,11 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke azure.mgmt.oracledatabase.aio.operations.CloudExadataInfrastructuresOperations :ivar cloud_vm_clusters: CloudVmClustersOperations operations :vartype cloud_vm_clusters: azure.mgmt.oracledatabase.aio.operations.CloudVmClustersOperations + :ivar exadb_vm_clusters: ExadbVmClustersOperations operations + :vartype exadb_vm_clusters: azure.mgmt.oracledatabase.aio.operations.ExadbVmClustersOperations + :ivar exascale_db_storage_vaults: ExascaleDbStorageVaultsOperations operations + :vartype exascale_db_storage_vaults: + azure.mgmt.oracledatabase.aio.operations.ExascaleDbStorageVaultsOperations :ivar autonomous_database_character_sets: AutonomousDatabaseCharacterSetsOperations operations :vartype autonomous_database_character_sets: azure.mgmt.oracledatabase.aio.operations.AutonomousDatabaseCharacterSetsOperations @@ -71,8 +83,12 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :vartype dns_private_views: azure.mgmt.oracledatabase.aio.operations.DnsPrivateViewsOperations :ivar dns_private_zones: DnsPrivateZonesOperations operations :vartype dns_private_zones: azure.mgmt.oracledatabase.aio.operations.DnsPrivateZonesOperations + :ivar flex_components: FlexComponentsOperations operations + :vartype flex_components: azure.mgmt.oracledatabase.aio.operations.FlexComponentsOperations :ivar gi_versions: GiVersionsOperations operations :vartype gi_versions: azure.mgmt.oracledatabase.aio.operations.GiVersionsOperations + :ivar gi_minor_versions: GiMinorVersionsOperations operations + :vartype gi_minor_versions: azure.mgmt.oracledatabase.aio.operations.GiMinorVersionsOperations :ivar system_versions: SystemVersionsOperations operations :vartype system_versions: azure.mgmt.oracledatabase.aio.operations.SystemVersionsOperations :ivar oracle_subscriptions: OracleSubscriptionsOperations operations @@ -88,13 +104,15 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke :ivar virtual_network_addresses: VirtualNetworkAddressesOperations operations :vartype virtual_network_addresses: azure.mgmt.oracledatabase.aio.operations.VirtualNetworkAddressesOperations + :ivar exascale_db_nodes: ExascaleDbNodesOperations operations + :vartype exascale_db_nodes: azure.mgmt.oracledatabase.aio.operations.ExascaleDbNodesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :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 "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2025-03-01". 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 @@ -102,15 +120,17 @@ class OracleDatabaseMgmtClient: # pylint: disable=client-accepts-api-version-ke """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = OracleDatabaseMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -129,7 +149,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -145,6 +167,12 @@ def __init__( self.cloud_vm_clusters = CloudVmClustersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.exadb_vm_clusters = ExadbVmClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.exascale_db_storage_vaults = ExascaleDbStorageVaultsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.autonomous_database_character_sets = AutonomousDatabaseCharacterSetsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -161,7 +189,11 @@ def __init__( self.dns_private_zones = DnsPrivateZonesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.flex_components = FlexComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.gi_versions = GiVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gi_minor_versions = GiMinorVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.system_versions = SystemVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.oracle_subscriptions = OracleSubscriptionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -174,6 +206,9 @@ def __init__( self.virtual_network_addresses = VirtualNetworkAddressesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.exascale_db_nodes = ExascaleDbNodesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any @@ -202,7 +237,7 @@ def _send_request( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "OracleDatabaseMgmtClient": + async def __aenter__(self) -> Self: await self._client.__aenter__() return self diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py index 6cd78dc91ca1..791a7724582a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/__init__.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,27 +6,38 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._autonomous_databases_operations import AutonomousDatabasesOperations -from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations -from ._cloud_vm_clusters_operations import CloudVmClustersOperations -from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations -from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations -from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations -from ._db_system_shapes_operations import DbSystemShapesOperations -from ._dns_private_views_operations import DnsPrivateViewsOperations -from ._dns_private_zones_operations import DnsPrivateZonesOperations -from ._gi_versions_operations import GiVersionsOperations -from ._system_versions_operations import SystemVersionsOperations -from ._oracle_subscriptions_operations import OracleSubscriptionsOperations -from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations -from ._db_servers_operations import DbServersOperations -from ._db_nodes_operations import DbNodesOperations -from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._autonomous_databases_operations import AutonomousDatabasesOperations # type: ignore +from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations # type: ignore +from ._cloud_vm_clusters_operations import CloudVmClustersOperations # type: ignore +from ._exadb_vm_clusters_operations import ExadbVmClustersOperations # type: ignore +from ._exascale_db_storage_vaults_operations import ExascaleDbStorageVaultsOperations # type: ignore +from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations # type: ignore +from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations # type: ignore +from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations # type: ignore +from ._db_system_shapes_operations import DbSystemShapesOperations # type: ignore +from ._dns_private_views_operations import DnsPrivateViewsOperations # type: ignore +from ._dns_private_zones_operations import DnsPrivateZonesOperations # type: ignore +from ._flex_components_operations import FlexComponentsOperations # type: ignore +from ._gi_versions_operations import GiVersionsOperations # type: ignore +from ._gi_minor_versions_operations import GiMinorVersionsOperations # type: ignore +from ._system_versions_operations import SystemVersionsOperations # type: ignore +from ._oracle_subscriptions_operations import OracleSubscriptionsOperations # type: ignore +from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations # type: ignore +from ._db_servers_operations import DbServersOperations # type: ignore +from ._db_nodes_operations import DbNodesOperations # type: ignore +from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations # type: ignore +from ._exascale_db_nodes_operations import ExascaleDbNodesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -33,19 +45,24 @@ "AutonomousDatabasesOperations", "CloudExadataInfrastructuresOperations", "CloudVmClustersOperations", + "ExadbVmClustersOperations", + "ExascaleDbStorageVaultsOperations", "AutonomousDatabaseCharacterSetsOperations", "AutonomousDatabaseNationalCharacterSetsOperations", "AutonomousDatabaseVersionsOperations", "DbSystemShapesOperations", "DnsPrivateViewsOperations", "DnsPrivateZonesOperations", + "FlexComponentsOperations", "GiVersionsOperations", + "GiMinorVersionsOperations", "SystemVersionsOperations", "OracleSubscriptionsOperations", "AutonomousDatabaseBackupsOperations", "DbServersOperations", "DbNodesOperations", "VirtualNetworkAddressesOperations", + "ExascaleDbNodesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py index c156a1fe6e40..d98247e79264 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_backups_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,19 +32,16 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._autonomous_database_backups_operations import ( build_create_or_update_request, build_delete_request, build_get_request, - build_list_by_autonomous_database_request, + build_list_by_parent_request, build_update_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,13 +60,13 @@ class AutonomousDatabaseBackupsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_autonomous_database( + def list_by_parent( self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any ) -> AsyncIterable["_models.AutonomousDatabaseBackup"]: """List AutonomousDatabaseBackup resources by AutonomousDatabase. @@ -90,7 +88,7 @@ def list_by_autonomous_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseBackupListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +99,7 @@ def list_by_autonomous_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_autonomous_database_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, subscription_id=self._config.subscription_id, @@ -109,7 +107,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -125,7 +122,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -172,7 +168,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -195,7 +191,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -210,7 +205,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -224,8 +219,8 @@ async def _create_or_update_initial( adbbackupid: str, resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +233,7 @@ async def _create_or_update_initial( 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.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -260,10 +255,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -271,18 +266,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - 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 = self._deserialize("AutonomousDatabaseBackup", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -402,10 +401,11 @@ async def begin_create_or_update( 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("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -437,8 +437,8 @@ async def _update_initial( adbbackupid: str, properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabaseBackup]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +451,7 @@ async def _update_initial( 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[Optional[_models.AutonomousDatabaseBackup]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -473,10 +473,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -484,19 +484,21 @@ async def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -615,10 +617,11 @@ async def begin_update( 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("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -642,10 +645,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -657,7 +660,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -668,10 +671,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -679,6 +682,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -688,8 +695,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -717,7 +728,7 @@ async def begin_delete( 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, adbbackupid=adbbackupid, @@ -727,6 +738,7 @@ async def begin_delete( 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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py index fbef63286512..b60e9e892920 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_character_sets_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,24 +20,20 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._autonomous_database_character_sets_operations import ( build_get_request, build_list_by_location_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -56,14 +52,14 @@ class AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-lon def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AutonomousDatabaseCharacterSet"]: - """List AutonomousDatabaseCharacterSet resources by Location. + """List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -79,7 +75,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseCharacterSetListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +93,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -113,7 +108,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -155,7 +149,7 @@ async def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -177,7 +171,6 @@ async def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _mode headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -192,7 +185,7 @@ async def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _mode error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseCharacterSet", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseCharacterSet", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py index 2d8c1fc08ab2..1376fa02d3ed 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_national_character_sets_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,24 +21,20 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._autonomous_database_national_character_sets_operations import ( build_get_request, build_list_by_location_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -56,16 +53,16 @@ class AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location( self, location: str, **kwargs: Any ) -> AsyncIterable["_models.AutonomousDatabaseNationalCharacterSet"]: - """List AutonomousDatabaseNationalCharacterSet resources by Location. + """List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -81,7 +78,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseNationalCharacterSetListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -99,7 +96,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -115,7 +111,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -159,7 +154,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -181,7 +176,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -196,7 +190,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSet", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSet", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py index 675b6181b104..3b0d82ddcc0e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_database_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._autonomous_database_versions_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,14 +49,14 @@ class AutonomousDatabaseVersionsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AutonomousDbVersion"]: - """List AutonomousDbVersion resources by Location. + """List AutonomousDbVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -75,7 +71,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDbVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -93,7 +89,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +104,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -151,7 +145,7 @@ async def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +167,6 @@ async def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -188,7 +181,7 @@ async def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDbVersion", pipeline_response) + deserialized = self._deserialize("AutonomousDbVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py index d37a1ca09bb8..44d5da89a6fb 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_autonomous_databases_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +19,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,8 +33,9 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._autonomous_databases_operations import ( + build_change_disaster_recovery_configuration_request, build_create_or_update_request, build_delete_request, build_failover_request, @@ -45,11 +48,8 @@ build_switchover_request, build_update_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,10 +68,10 @@ class AutonomousDatabasesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.AutonomousDatabase"]: @@ -88,7 +88,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Autonomo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -105,7 +105,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -121,7 +120,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -171,7 +169,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -189,7 +187,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -205,7 +202,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -250,7 +246,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +268,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -287,7 +282,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -300,8 +295,8 @@ async def _create_or_update_initial( autonomousdatabasename: str, resource: Union[_models.AutonomousDatabase, IO[bytes]], **kwargs: Any - ) -> _models.AutonomousDatabase: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +309,7 @@ async def _create_or_update_initial( 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.AutonomousDatabase] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -335,10 +330,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -346,18 +341,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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 = self._deserialize("AutonomousDatabase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -467,10 +466,11 @@ async def begin_create_or_update( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -501,8 +501,8 @@ async def _update_initial( autonomousdatabasename: str, properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +515,7 @@ async def _update_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -536,10 +536,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -547,19 +547,21 @@ async def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -668,10 +670,11 @@ async def begin_update( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -695,10 +698,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -710,7 +713,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -720,10 +723,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -731,6 +734,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -740,8 +747,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -767,7 +778,7 @@ async def begin_delete( 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, api_version=api_version, @@ -776,6 +787,7 @@ async def begin_delete( 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 @@ -799,14 +811,217 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + async def _change_disaster_recovery_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "DisasterRecoveryConfigurationDetails") + + _request = build_change_disaster_recovery_configuration_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + 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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.DisasterRecoveryConfigurationDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :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 AutonomousDatabase or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is either a + DisasterRecoveryConfigurationDetails type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails or IO[bytes] + :return: An instance of AsyncLROPoller that returns either AutonomousDatabase or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :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.AutonomousDatabase] = 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._change_disaster_recovery_configuration_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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("AutonomousDatabase", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _failover_initial( self, resource_group_name: str, autonomousdatabasename: str, body: Union[_models.PeerDbDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -819,7 +1034,7 @@ async def _failover_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -840,10 +1055,10 @@ async def _failover_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -851,19 +1066,21 @@ async def _failover_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -972,10 +1189,11 @@ async def begin_failover( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1076,7 +1294,7 @@ async def generate_wallet( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1110,7 +1328,6 @@ async def generate_wallet( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -1125,7 +1342,7 @@ async def generate_wallet( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseWalletFile", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseWalletFile", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1138,8 +1355,8 @@ async def _restore_initial( autonomousdatabasename: str, body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1152,7 +1369,7 @@ async def _restore_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1173,10 +1390,10 @@ async def _restore_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1184,19 +1401,21 @@ async def _restore_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1305,10 +1524,11 @@ async def begin_restore( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1334,8 +1554,8 @@ def get_long_running_output(pipeline_response): async def _shrink_initial( self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1347,7 +1567,7 @@ async def _shrink_initial( _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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_shrink_request( resource_group_name=resource_group_name, @@ -1357,10 +1577,10 @@ async def _shrink_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1368,19 +1588,21 @@ async def _shrink_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1422,10 +1644,11 @@ async def begin_shrink( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1455,8 +1678,8 @@ async def _switchover_initial( autonomousdatabasename: str, body: Union[_models.PeerDbDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1692,7 @@ async def _switchover_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1490,10 +1713,10 @@ async def _switchover_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1501,19 +1724,21 @@ async def _switchover_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1622,10 +1847,11 @@ async def begin_switchover( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py index 8fcb5a0b3098..d942a520053e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_exadata_infrastructures_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,7 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._cloud_exadata_infrastructures_operations import ( build_add_storage_capacity_request, build_create_or_update_request, @@ -41,11 +42,8 @@ build_list_by_subscription_request, build_update_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,10 +62,10 @@ class CloudExadataInfrastructuresOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudExadataInfrastructure"]: @@ -85,7 +83,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudExa api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +100,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -118,7 +115,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -169,7 +165,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +183,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -203,7 +198,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -248,7 +242,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -270,7 +264,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -285,7 +278,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -298,8 +291,8 @@ async def _create_or_update_initial( cloudexadatainfrastructurename: str, resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +305,7 @@ async def _create_or_update_initial( 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.CloudExadataInfrastructure] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -333,10 +326,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -344,18 +337,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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 = self._deserialize("CloudExadataInfrastructure", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -465,10 +462,11 @@ async def begin_create_or_update( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -499,8 +497,8 @@ async def _update_initial( cloudexadatainfrastructurename: str, properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +511,7 @@ async def _update_initial( 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[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -534,10 +532,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -545,19 +543,21 @@ async def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -667,10 +667,11 @@ async def begin_update( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -694,10 +695,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +710,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -719,10 +720,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -730,6 +731,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -739,8 +744,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -766,7 +775,7 @@ async def begin_delete( 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, cloudexadatainfrastructurename=cloudexadatainfrastructurename, api_version=api_version, @@ -775,6 +784,7 @@ async def begin_delete( 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 @@ -800,8 +810,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _add_storage_capacity_initial( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -813,7 +823,7 @@ async def _add_storage_capacity_initial( _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[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_add_storage_capacity_request( resource_group_name=resource_group_name, @@ -823,10 +833,10 @@ async def _add_storage_capacity_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -834,19 +844,21 @@ async def _add_storage_capacity_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -887,10 +899,11 @@ async def begin_add_storage_capacity( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py index f36dae9ee560..abd2f3d06d0e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_cloud_vm_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, 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, @@ -18,12 +19,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,7 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._cloud_vm_clusters_operations import ( build_add_vms_request, build_create_or_update_request, @@ -43,11 +45,8 @@ build_remove_vms_request, build_update_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,10 +65,10 @@ class CloudVmClustersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudVmCluster"]: @@ -86,7 +85,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CloudVmC api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -103,7 +102,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -119,7 +117,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -169,7 +166,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -187,7 +184,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -203,7 +199,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -246,7 +241,7 @@ async def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -268,7 +263,6 @@ async def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -283,7 +277,7 @@ async def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -296,8 +290,8 @@ async def _create_or_update_initial( cloudvmclustername: str, resource: Union[_models.CloudVmCluster, IO[bytes]], **kwargs: Any - ) -> _models.CloudVmCluster: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -310,7 +304,7 @@ async def _create_or_update_initial( 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.CloudVmCluster] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -331,10 +325,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -342,18 +336,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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 = self._deserialize("CloudVmCluster", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -460,10 +458,11 @@ async def begin_create_or_update( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -494,8 +493,8 @@ async def _update_initial( cloudvmclustername: str, properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +507,7 @@ async def _update_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -529,10 +528,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -540,19 +539,21 @@ async def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -658,10 +659,11 @@ async def begin_update( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -685,10 +687,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -700,7 +702,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -710,10 +712,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -721,6 +723,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -730,8 +736,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -757,7 +767,7 @@ async def begin_delete( 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, api_version=api_version, @@ -766,6 +776,7 @@ async def begin_delete( 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 @@ -795,8 +806,8 @@ async def _add_vms_initial( cloudvmclustername: str, body: Union[_models.AddRemoveDbNode, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,7 +820,7 @@ async def _add_vms_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -830,10 +841,10 @@ async def _add_vms_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -841,19 +852,21 @@ async def _add_vms_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -959,10 +972,11 @@ async def begin_add_vms( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1062,7 +1076,7 @@ async def list_private_ip_addresses( :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1110,6 @@ async def list_private_ip_addresses( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -1111,7 +1124,7 @@ async def list_private_ip_addresses( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("[PrivateIpAddressProperties]", pipeline_response) + deserialized = self._deserialize("[PrivateIpAddressProperties]", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1124,8 +1137,8 @@ async def _remove_vms_initial( cloudvmclustername: str, body: Union[_models.AddRemoveDbNode, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1151,7 @@ async def _remove_vms_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1159,10 +1172,10 @@ async def _remove_vms_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1170,19 +1183,21 @@ async def _remove_vms_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1288,10 +1303,11 @@ async def begin_remove_vms( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py index e2282ff5e363..e26f7099d934 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_nodes_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,17 +32,10 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request -from ...operations._db_nodes_operations import ( - build_action_request, - build_get_request, - build_list_by_cloud_vm_cluster_request, -) +from ..._utils.serialization import Deserializer, Serializer +from ...operations._db_nodes_operations import build_action_request, build_get_request, build_list_by_parent_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,13 +54,13 @@ class DbNodesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_vm_cluster( + def list_by_parent( self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any ) -> AsyncIterable["_models.DbNode"]: """List DbNode resources by CloudVmCluster. @@ -86,7 +80,7 @@ def list_by_cloud_vm_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbNodeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +91,7 @@ def list_by_cloud_vm_cluster( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_vm_cluster_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, subscription_id=self._config.subscription_id, @@ -105,7 +99,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -121,7 +114,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -168,7 +160,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.DbNode :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -191,7 +183,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -206,7 +197,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbNode", pipeline_response) + deserialized = self._deserialize("DbNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -220,8 +211,8 @@ async def _action_initial( dbnodeocid: str, body: Union[_models.DbNodeAction, IO[bytes]], **kwargs: Any - ) -> Optional[_models.DbNode]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -234,7 +225,7 @@ async def _action_initial( 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[Optional[_models.DbNode]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -256,10 +247,10 @@ async def _action_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -267,19 +258,21 @@ async def _action_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DbNode", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -395,10 +388,11 @@ async def begin_action( 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("DbNode", pipeline_response) + deserialized = self._deserialize("DbNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py index 7486cba97bfd..893cf66fc87e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_servers_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request -from ...operations._db_servers_operations import build_get_request, build_list_by_cloud_exadata_infrastructure_request +from ..._utils.serialization import Deserializer, Serializer +from ...operations._db_servers_operations import build_get_request, build_list_by_parent_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,13 +49,13 @@ class DbServersOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_exadata_infrastructure( + def list_by_parent( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any ) -> AsyncIterable["_models.DbServer"]: """List DbServer resources by CloudExadataInfrastructure. @@ -79,7 +75,7 @@ def list_by_cloud_exadata_infrastructure( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbServerListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -90,7 +86,7 @@ def list_by_cloud_exadata_infrastructure( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_exadata_infrastructure_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudexadatainfrastructurename=cloudexadatainfrastructurename, subscription_id=self._config.subscription_id, @@ -98,7 +94,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -114,7 +109,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -161,7 +155,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.DbServer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -184,7 +178,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -199,7 +192,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbServer", pipeline_response) + deserialized = self._deserialize("DbServer", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py index d3886d5f0334..af656da474e1 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_db_system_shapes_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._db_system_shapes_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,17 +49,21 @@ class DbSystemShapesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DbSystemShape"]: - """List DbSystemShape resources by Location. + def list_by_location( + self, location: str, zone: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.DbSystemShape"]: + """List DbSystemShape resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str :return: An iterator like instance of either DbSystemShape or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] @@ -75,7 +75,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbSystemShapeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -89,11 +89,11 @@ def prepare_request(next_link=None): _request = build_list_by_location_request( location=location, subscription_id=self._config.subscription_id, + zone=zone, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +109,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -151,7 +150,7 @@ async def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +172,6 @@ async def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _mo headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -188,7 +186,7 @@ async def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _mo error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbSystemShape", pipeline_response) + deserialized = self._deserialize("DbSystemShape", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py index 3e3eca3bdf66..53d14931b7fa 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_views_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._dns_private_views_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,14 +49,14 @@ class DnsPrivateViewsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DnsPrivateView"]: - """List DnsPrivateView resources by Location. + """List DnsPrivateView resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -75,7 +71,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DnsPrivateViewListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -93,7 +89,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +104,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -151,7 +145,7 @@ async def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +167,6 @@ async def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _m headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -188,7 +181,7 @@ async def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _m error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DnsPrivateView", pipeline_response) + deserialized = self._deserialize("DnsPrivateView", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py index 68ed09996dab..e46f805f4c68 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_dns_private_zones_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._dns_private_zones_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,14 +49,14 @@ class DnsPrivateZonesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.DnsPrivateZone"]: - """List DnsPrivateZone resources by Location. + """List DnsPrivateZone resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -75,7 +71,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DnsPrivateZoneListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -93,7 +89,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +104,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -151,7 +145,7 @@ async def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +167,6 @@ async def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _m headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -188,7 +181,7 @@ async def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _m error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DnsPrivateZone", pipeline_response) + deserialized = self._deserialize("DnsPrivateZone", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exadb_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exadb_vm_clusters_operations.py new file mode 100644 index 000000000000..69d28819a855 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exadb_vm_clusters_operations.py @@ -0,0 +1,999 @@ +# 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, AsyncIterable, AsyncIterator, Callable, Dict, 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._exadb_vm_clusters_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_remove_vms_request, + build_update_request, +) +from .._configuration import OracleDatabaseMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExadbVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exadb_vm_clusters` 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: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by subscription ID. + + :return: An iterator like instance of either ExadbVmCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmClusterListResult] = 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_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("ExadbVmClusterListResult", 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 + ) -> AsyncIterable["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by 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 either ExadbVmCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmClusterListResult] = 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("ExadbVmClusterListResult", 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, exadb_vm_cluster_name: str, **kwargs: Any) -> _models.ExadbVmCluster: + """Get a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: ExadbVmCluster or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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.ExadbVmCluster] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExadbVmCluster", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, 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, "ExadbVmCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: _models.ExadbVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Is either a ExadbVmCluster type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExadbVmCluster", 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.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, 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(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "ExadbVmClusterUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, + exadb_vm_cluster_name: str, + properties: _models.ExadbVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Is either a ExadbVmClusterUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = 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, + exadb_vm_cluster_name=exadb_vm_cluster_name, + properties=properties, + 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("ExadbVmCluster", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, exadb_vm_cluster_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, + exadb_vm_cluster_name=exadb_vm_cluster_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 [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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, exadb_vm_cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_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, + exadb_vm_cluster_name=exadb_vm_cluster_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, lro_options={"final-state-via": "location"}, **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 + + async def _remove_vms_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "RemoveVirtualMachineFromExadbVmClusterDetails") + + _request = build_remove_vms_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: _models.RemoveVirtualMachineFromExadbVmClusterDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Is either a + RemoveVirtualMachineFromExadbVmClusterDetails type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + body=body, + 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("ExadbVmCluster", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_nodes_operations.py new file mode 100644 index 000000000000..78922906b105 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_nodes_operations.py @@ -0,0 +1,422 @@ +# 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, AsyncIterable, AsyncIterator, Callable, Dict, 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._exascale_db_nodes_operations import ( + build_action_request, + build_get_request, + build_list_by_parent_request, +) +from .._configuration import OracleDatabaseMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExascaleDbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_nodes` 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: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExascaleDbNode"]: + """List ExascaleDbNode resources by ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An iterator like instance of either ExascaleDbNode or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbNode] + :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.ExascaleDbNodeListResult] = 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_parent_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExascaleDbNodeListResult", 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, exadb_vm_cluster_name: str, exascale_db_node_name: str, **kwargs: Any + ) -> _models.ExascaleDbNode: + """Get a ExascaleDbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :return: ExascaleDbNode or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbNode + :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.ExascaleDbNode] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_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("ExascaleDbNode", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _action_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "DbNodeAction") + + _request = build_action_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Is either a DbNodeAction type or a IO[bytes] + type. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or IO[bytes] + :return: An instance of AsyncLROPoller that returns either DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :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.DbActionResponse] = 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._action_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + body=body, + 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("DbActionResponse", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DbActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DbActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_storage_vaults_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_storage_vaults_operations.py new file mode 100644 index 000000000000..d1f8370ead60 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_exascale_db_storage_vaults_operations.py @@ -0,0 +1,808 @@ +# 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, AsyncIterable, AsyncIterator, Callable, Dict, 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._exascale_db_storage_vaults_operations import ( + build_create_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_update_request, +) +from .._configuration import OracleDatabaseMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ExascaleDbStorageVaultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_storage_vaults` 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: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by subscription ID. + + :return: An iterator like instance of either ExascaleDbStorageVault or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVaultListResult] = 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_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("ExascaleDbStorageVaultListResult", 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 + ) -> AsyncIterable["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by 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 either ExascaleDbStorageVault or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVaultListResult] = 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("ExascaleDbStorageVaultListResult", 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, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> _models.ExascaleDbStorageVault: + """Get a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: ExascaleDbStorageVault or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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.ExascaleDbStorageVault] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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("ExascaleDbStorageVault", 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, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, 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, "ExascaleDbStorageVault") + + _request = build_create_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, + exascale_db_storage_vault_name: str, + resource: _models.ExascaleDbStorageVault, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Is either a ExascaleDbStorageVault type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVault] = 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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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("ExascaleDbStorageVault", 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.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, 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(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "ExascaleDbStorageVaultTagsUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, + exascale_db_storage_vault_name: str, + properties: _models.ExascaleDbStorageVaultTagsUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate + :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 ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Is either a + ExascaleDbStorageVaultTagsUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ExascaleDbStorageVault or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVault] = 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, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + properties=properties, + 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("ExascaleDbStorageVault", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, exascale_db_storage_vault_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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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 [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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_flex_components_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_flex_components_operations.py new file mode 100644 index 000000000000..5ee858895fb5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_flex_components_operations.py @@ -0,0 +1,195 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +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, + map_error, +) +from azure.core.pipeline import PipelineResponse +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 ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._flex_components_operations import build_get_request, build_list_by_parent_request +from .._configuration import OracleDatabaseMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class FlexComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`flex_components` 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: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, location: str, shape: Optional[Union[str, _models.SystemShapes]] = None, **kwargs: Any + ) -> AsyncIterable["_models.FlexComponent"]: + """List FlexComponent resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :param shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :type shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :return: An iterator like instance of either FlexComponent or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.FlexComponent] + :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.FlexComponentListResult] = 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_parent_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + 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("FlexComponentListResult", 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, location: str, flex_component_name: str, **kwargs: Any) -> _models.FlexComponent: + """Get a FlexComponent. + + :param location: The name of the Azure region. Required. + :type location: str + :param flex_component_name: The name of the FlexComponent. Required. + :type flex_component_name: str + :return: FlexComponent or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.FlexComponent + :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.FlexComponent] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + flex_component_name=flex_component_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("FlexComponent", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_minor_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_minor_versions_operations.py new file mode 100644 index 000000000000..9bdc3f2a125e --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_minor_versions_operations.py @@ -0,0 +1,212 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +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, + map_error, +) +from azure.core.pipeline import PipelineResponse +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 ... import models as _models +from ..._utils.serialization import Deserializer, Serializer +from ...operations._gi_minor_versions_operations import build_get_request, build_list_by_parent_request +from .._configuration import OracleDatabaseMgmtClientConfiguration + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class GiMinorVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.aio.OracleDatabaseMgmtClient`'s + :attr:`gi_minor_versions` 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: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, + location: str, + giversionname: str, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.GiMinorVersion"]: + """List GiMinorVersion resources by GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param shape_family: If provided, filters the results to the set of database versions which are + supported for the given shape family. Known values are: "EXADATA" and "EXADB_XS". Default value + is None. + :type shape_family: str or ~azure.mgmt.oracledatabase.models.ShapeFamily + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str + :return: An iterator like instance of either GiMinorVersion or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :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.GiMinorVersionListResult] = 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_parent_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + shape_family=shape_family, + zone=zone, + 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("GiMinorVersionListResult", 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, location: str, giversionname: str, gi_minor_version_name: str, **kwargs: Any + ) -> _models.GiMinorVersion: + """Get a GiMinorVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param gi_minor_version_name: The name of the GiMinorVersion. Required. + :type gi_minor_version_name: str + :return: GiMinorVersion or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.GiMinorVersion + :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.GiMinorVersion] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + giversionname=giversionname, + gi_minor_version_name=gi_minor_version_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("GiMinorVersion", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py index 02def620d5f9..6894800d8f56 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_gi_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._gi_versions_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,17 +49,28 @@ class GiVersionsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.GiVersion"]: - """List GiVersion resources by Location. + def list_by_location( + self, + location: str, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.GiVersion"]: + """List GiVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str + :param shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :type shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str :return: An iterator like instance of either GiVersion or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] :raises ~azure.core.exceptions.HttpResponseError: @@ -74,7 +81,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GiVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -88,11 +95,12 @@ def prepare_request(next_link=None): _request = build_list_by_location_request( location=location, subscription_id=self._config.subscription_id, + shape=shape, + zone=zone, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -108,7 +116,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -150,7 +157,7 @@ async def get(self, location: str, giversionname: str, **kwargs: Any) -> _models :rtype: ~azure.mgmt.oracledatabase.models.GiVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +179,6 @@ async def get(self, location: str, giversionname: str, **kwargs: Any) -> _models headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -187,7 +193,7 @@ async def get(self, location: str, giversionname: str, **kwargs: Any) -> _models error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GiVersion", pipeline_response) + deserialized = self._deserialize("GiVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py index 7be3a96a0294..5cc4a52679f5 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,20 +20,16 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -52,10 +48,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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) -> AsyncIterable["_models.Operation"]: @@ -71,7 +67,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -87,7 +83,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -103,7 +98,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py index a192583eb309..5548c7391a2b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_oracle_subscriptions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +19,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,8 +33,9 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._oracle_subscriptions_operations import ( + build_add_azure_subscriptions_request, build_create_or_update_request, build_delete_request, build_get_request, @@ -42,11 +45,8 @@ build_list_saas_subscription_details_request, build_update_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,10 +65,10 @@ class OracleSubscriptionsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.OracleSubscription"]: @@ -85,7 +85,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.OracleSu api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OracleSubscriptionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -102,7 +102,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -118,7 +117,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -156,7 +154,7 @@ async def get(self, **kwargs: Any) -> _models.OracleSubscription: :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +174,6 @@ async def get(self, **kwargs: Any) -> _models.OracleSubscription: headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -191,7 +188,7 @@ async def get(self, **kwargs: Any) -> _models.OracleSubscription: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -200,8 +197,8 @@ async def get(self, **kwargs: Any) -> _models.OracleSubscription: async def _create_or_update_initial( self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> _models.OracleSubscription: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -214,7 +211,7 @@ async def _create_or_update_initial( 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.OracleSubscription] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -233,10 +230,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -244,18 +241,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - 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 = self._deserialize("OracleSubscription", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -332,10 +333,11 @@ async def begin_create_or_update( 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("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -362,8 +364,8 @@ def get_long_running_output(pipeline_response): async def _update_initial( self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OracleSubscription]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +378,7 @@ async def _update_initial( 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[Optional[_models.OracleSubscription]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -395,10 +397,10 @@ async def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -406,19 +408,21 @@ async def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -494,10 +498,11 @@ async def begin_update( 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("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -521,8 +526,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _delete_initial(self, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=incon _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( subscription_id=self._config.subscription_id, @@ -542,10 +547,10 @@ async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=incon headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -553,6 +558,10 @@ async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=incon 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -562,8 +571,12 @@ async def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=incon response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete(self, **kwargs: Any) -> AsyncLROPoller[None]: @@ -582,9 +595,10 @@ async def begin_delete(self, **kwargs: Any) -> AsyncLROPoller[None]: 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( # type: ignore + raw_result = await self._delete_initial( 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 @@ -608,8 +622,161 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - async def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.ActivationLinks]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _add_azure_subscriptions_initial( + self, body: Union[_models.AzureSubscriptions, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "AzureSubscriptions") + + _request = build_add_azure_subscriptions_request( + 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 [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) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_add_azure_subscriptions( + self, body: _models.AzureSubscriptions, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_add_azure_subscriptions( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: 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: + """ + + @distributed_trace_async + async def begin_add_azure_subscriptions( + self, body: Union[_models.AzureSubscriptions, IO[bytes]], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Is either a AzureSubscriptions type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions or IO[bytes] + :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 = 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[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._add_azure_subscriptions_initial( + body=body, + 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): # 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, lro_options={"final-state-via": "location"}, **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 + + async def _list_activation_links_initial(self, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -621,7 +788,7 @@ async def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_model _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[Optional[_models.ActivationLinks]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_list_activation_links_request( subscription_id=self._config.subscription_id, @@ -629,10 +796,10 @@ async def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_model headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -640,19 +807,21 @@ async def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_model 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ActivationLinks", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -679,10 +848,11 @@ async def begin_list_activation_links(self, **kwargs: Any) -> AsyncLROPoller[_mo raw_result = await self._list_activation_links_initial( 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): - deserialized = self._deserialize("ActivationLinks", pipeline_response) + deserialized = self._deserialize("ActivationLinks", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -706,8 +876,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models.CloudAccountDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _list_cloud_account_details_initial(self, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +889,7 @@ async def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_ _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[Optional[_models.CloudAccountDetails]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_list_cloud_account_details_request( subscription_id=self._config.subscription_id, @@ -727,10 +897,10 @@ async def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_ headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -738,19 +908,21 @@ async def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_ 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -778,10 +950,11 @@ async def begin_list_cloud_account_details(self, **kwargs: Any) -> AsyncLROPolle raw_result = await self._list_cloud_account_details_initial( 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): - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) + deserialized = self._deserialize("CloudAccountDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -805,8 +978,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_models.SaasSubscriptionDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +991,7 @@ async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Option _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[Optional[_models.SaasSubscriptionDetails]] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_list_saas_subscription_details_request( subscription_id=self._config.subscription_id, @@ -826,10 +999,10 @@ async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Option headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -837,19 +1010,21 @@ async def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Option 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -879,10 +1054,11 @@ async def begin_list_saas_subscription_details( raw_result = await self._list_saas_subscription_details_initial( 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): - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) + deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py index 776fe2e2ca24..4730238b9fab 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_system_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,21 +20,17 @@ map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +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 ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._system_versions_operations import build_get_request, build_list_by_location_request +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,14 +49,14 @@ class SystemVersionsOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_models.SystemVersion"]: - """List SystemVersion resources by Location. + """List SystemVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -75,7 +71,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SystemVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -93,7 +89,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -109,7 +104,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -151,7 +145,7 @@ async def get(self, location: str, systemversionname: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +167,6 @@ async def get(self, location: str, systemversionname: str, **kwargs: Any) -> _mo headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -188,7 +181,7 @@ async def get(self, location: str, systemversionname: str, **kwargs: Any) -> _mo error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SystemVersion", pipeline_response) + deserialized = self._deserialize("SystemVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py index f4d1e4171c97..0c6ee328e7fe 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/aio/operations/_virtual_network_addresses_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +5,12 @@ # 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 -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, 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, @@ -18,12 +18,13 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest +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 @@ -31,18 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request +from ..._utils.serialization import Deserializer, Serializer from ...operations._virtual_network_addresses_operations import ( build_create_or_update_request, build_delete_request, build_get_request, - build_list_by_cloud_vm_cluster_request, + build_list_by_parent_request, ) +from .._configuration import OracleDatabaseMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,13 +59,13 @@ class VirtualNetworkAddressesOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_vm_cluster( + def list_by_parent( self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any ) -> AsyncIterable["_models.VirtualNetworkAddress"]: """List VirtualNetworkAddress resources by CloudVmCluster. @@ -89,7 +87,7 @@ def list_by_cloud_vm_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualNetworkAddressListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -100,7 +98,7 @@ def list_by_cloud_vm_cluster( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_vm_cluster_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, subscription_id=self._config.subscription_id, @@ -108,7 +106,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -124,7 +121,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -171,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +190,6 @@ async def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -209,7 +204,7 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) + deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -223,8 +218,8 @@ async def _create_or_update_initial( virtualnetworkaddressname: str, resource: Union[_models.VirtualNetworkAddress, IO[bytes]], **kwargs: Any - ) -> _models.VirtualNetworkAddress: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +232,7 @@ async def _create_or_update_initial( 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.VirtualNetworkAddress] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,10 +254,10 @@ async def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -270,18 +265,22 @@ async def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - 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 = self._deserialize("VirtualNetworkAddress", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -401,10 +400,11 @@ async def begin_create_or_update( 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("VirtualNetworkAddress", pipeline_response) + deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -429,10 +429,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_initial( # pylint: disable=inconsistent-return-statements + async def _delete_initial( self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +444,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -455,10 +455,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -466,6 +466,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -475,8 +479,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def begin_delete( @@ -504,7 +512,7 @@ async def begin_delete( 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( # type: ignore + raw_result = await self._delete_initial( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, virtualnetworkaddressname=virtualnetworkaddressname, @@ -514,6 +522,7 @@ async def begin_delete( 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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py index 83423a5edb19..bc0c879b6d02 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/__init__.py @@ -5,172 +5,219 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import ActivationLinks -from ._models_py3 import AddRemoveDbNode -from ._models_py3 import AllConnectionStringType -from ._models_py3 import ApexDetailsType -from ._models_py3 import AutonomousDatabase -from ._models_py3 import AutonomousDatabaseBackup -from ._models_py3 import AutonomousDatabaseBackupListResult -from ._models_py3 import AutonomousDatabaseBackupProperties -from ._models_py3 import AutonomousDatabaseBackupUpdate -from ._models_py3 import AutonomousDatabaseBackupUpdateProperties -from ._models_py3 import AutonomousDatabaseBaseProperties -from ._models_py3 import AutonomousDatabaseCharacterSet -from ._models_py3 import AutonomousDatabaseCharacterSetListResult -from ._models_py3 import AutonomousDatabaseCharacterSetProperties -from ._models_py3 import AutonomousDatabaseCloneProperties -from ._models_py3 import AutonomousDatabaseListResult -from ._models_py3 import AutonomousDatabaseNationalCharacterSet -from ._models_py3 import AutonomousDatabaseNationalCharacterSetListResult -from ._models_py3 import AutonomousDatabaseNationalCharacterSetProperties -from ._models_py3 import AutonomousDatabaseProperties -from ._models_py3 import AutonomousDatabaseStandbySummary -from ._models_py3 import AutonomousDatabaseUpdate -from ._models_py3 import AutonomousDatabaseUpdateProperties -from ._models_py3 import AutonomousDatabaseWalletFile -from ._models_py3 import AutonomousDbVersion -from ._models_py3 import AutonomousDbVersionListResult -from ._models_py3 import AutonomousDbVersionProperties -from ._models_py3 import CloudAccountDetails -from ._models_py3 import CloudExadataInfrastructure -from ._models_py3 import CloudExadataInfrastructureListResult -from ._models_py3 import CloudExadataInfrastructureProperties -from ._models_py3 import CloudExadataInfrastructureUpdate -from ._models_py3 import CloudExadataInfrastructureUpdateProperties -from ._models_py3 import CloudVmCluster -from ._models_py3 import CloudVmClusterListResult -from ._models_py3 import CloudVmClusterProperties -from ._models_py3 import CloudVmClusterUpdate -from ._models_py3 import CloudVmClusterUpdateProperties -from ._models_py3 import ConnectionStringType -from ._models_py3 import ConnectionUrlType -from ._models_py3 import CustomerContact -from ._models_py3 import DataCollectionOptions -from ._models_py3 import DayOfWeek -from ._models_py3 import DayOfWeekUpdate -from ._models_py3 import DbIormConfig -from ._models_py3 import DbNode -from ._models_py3 import DbNodeAction -from ._models_py3 import DbNodeListResult -from ._models_py3 import DbNodeProperties -from ._models_py3 import DbServer -from ._models_py3 import DbServerListResult -from ._models_py3 import DbServerPatchingDetails -from ._models_py3 import DbServerProperties -from ._models_py3 import DbSystemShape -from ._models_py3 import DbSystemShapeListResult -from ._models_py3 import DbSystemShapeProperties -from ._models_py3 import DnsPrivateView -from ._models_py3 import DnsPrivateViewListResult -from ._models_py3 import DnsPrivateViewProperties -from ._models_py3 import DnsPrivateZone -from ._models_py3 import DnsPrivateZoneListResult -from ._models_py3 import DnsPrivateZoneProperties -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import EstimatedPatchingTime -from ._models_py3 import ExadataIormConfig -from ._models_py3 import GenerateAutonomousDatabaseWalletDetails -from ._models_py3 import GiVersion -from ._models_py3 import GiVersionListResult -from ._models_py3 import GiVersionProperties -from ._models_py3 import LongTermBackUpScheduleDetails -from ._models_py3 import MaintenanceWindow -from ._models_py3 import Month -from ._models_py3 import NsgCidr -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OracleSubscription -from ._models_py3 import OracleSubscriptionListResult -from ._models_py3 import OracleSubscriptionProperties -from ._models_py3 import OracleSubscriptionUpdate -from ._models_py3 import OracleSubscriptionUpdateProperties -from ._models_py3 import PeerDbDetails -from ._models_py3 import Plan -from ._models_py3 import PlanUpdate -from ._models_py3 import PortRange -from ._models_py3 import PrivateIpAddressProperties -from ._models_py3 import PrivateIpAddressesFilter -from ._models_py3 import ProfileType -from ._models_py3 import ProxyResource -from ._models_py3 import Resource -from ._models_py3 import RestoreAutonomousDatabaseDetails -from ._models_py3 import SaasSubscriptionDetails -from ._models_py3 import ScheduledOperationsType -from ._models_py3 import ScheduledOperationsTypeUpdate -from ._models_py3 import SystemData -from ._models_py3 import SystemVersion -from ._models_py3 import SystemVersionListResult -from ._models_py3 import SystemVersionProperties -from ._models_py3 import SystemVersionsFilter -from ._models_py3 import TrackedResource -from ._models_py3 import ValidationError -from ._models_py3 import ValidationResult -from ._models_py3 import VirtualNetworkAddress -from ._models_py3 import VirtualNetworkAddressListResult -from ._models_py3 import VirtualNetworkAddressProperties +from typing import TYPE_CHECKING -from ._oracle_database_mgmt_client_enums import ActionType -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseBackupLifecycleState -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseBackupType -from ._oracle_database_mgmt_client_enums import AutonomousDatabaseLifecycleState -from ._oracle_database_mgmt_client_enums import AutonomousMaintenanceScheduleType -from ._oracle_database_mgmt_client_enums import AzureResourceProvisioningState -from ._oracle_database_mgmt_client_enums import CloneType -from ._oracle_database_mgmt_client_enums import CloudAccountProvisioningState -from ._oracle_database_mgmt_client_enums import CloudExadataInfrastructureLifecycleState -from ._oracle_database_mgmt_client_enums import CloudVmClusterLifecycleState -from ._oracle_database_mgmt_client_enums import ComputeModel -from ._oracle_database_mgmt_client_enums import ConsumerGroup -from ._oracle_database_mgmt_client_enums import CreatedByType -from ._oracle_database_mgmt_client_enums import DataBaseType -from ._oracle_database_mgmt_client_enums import DataSafeStatusType -from ._oracle_database_mgmt_client_enums import DatabaseEditionType -from ._oracle_database_mgmt_client_enums import DayOfWeekName -from ._oracle_database_mgmt_client_enums import DbNodeActionEnum -from ._oracle_database_mgmt_client_enums import DbNodeMaintenanceType -from ._oracle_database_mgmt_client_enums import DbNodeProvisioningState -from ._oracle_database_mgmt_client_enums import DbServerPatchingStatus -from ._oracle_database_mgmt_client_enums import DbServerProvisioningState -from ._oracle_database_mgmt_client_enums import DisasterRecoveryType -from ._oracle_database_mgmt_client_enums import DiskRedundancy -from ._oracle_database_mgmt_client_enums import DnsPrivateViewsLifecycleState -from ._oracle_database_mgmt_client_enums import DnsPrivateZonesLifecycleState -from ._oracle_database_mgmt_client_enums import GenerateType -from ._oracle_database_mgmt_client_enums import HostFormatType -from ._oracle_database_mgmt_client_enums import Intent -from ._oracle_database_mgmt_client_enums import IormLifecycleState -from ._oracle_database_mgmt_client_enums import LicenseModel -from ._oracle_database_mgmt_client_enums import MonthName -from ._oracle_database_mgmt_client_enums import Objective -from ._oracle_database_mgmt_client_enums import OpenModeType -from ._oracle_database_mgmt_client_enums import OperationsInsightsStatusType -from ._oracle_database_mgmt_client_enums import OracleSubscriptionProvisioningState -from ._oracle_database_mgmt_client_enums import Origin -from ._oracle_database_mgmt_client_enums import PatchingMode -from ._oracle_database_mgmt_client_enums import PermissionLevelType -from ._oracle_database_mgmt_client_enums import Preference -from ._oracle_database_mgmt_client_enums import ProtocolType -from ._oracle_database_mgmt_client_enums import RefreshableModelType -from ._oracle_database_mgmt_client_enums import RefreshableStatusType -from ._oracle_database_mgmt_client_enums import RepeatCadenceType -from ._oracle_database_mgmt_client_enums import ResourceProvisioningState -from ._oracle_database_mgmt_client_enums import RoleType -from ._oracle_database_mgmt_client_enums import SessionModeType -from ._oracle_database_mgmt_client_enums import SourceType -from ._oracle_database_mgmt_client_enums import SyntaxFormatType -from ._oracle_database_mgmt_client_enums import TlsAuthenticationType -from ._oracle_database_mgmt_client_enums import UpdateAction -from ._oracle_database_mgmt_client_enums import ValidationStatus -from ._oracle_database_mgmt_client_enums import VirtualNetworkAddressLifecycleState -from ._oracle_database_mgmt_client_enums import WorkloadType -from ._oracle_database_mgmt_client_enums import ZoneType +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + ActivationLinks, + AddRemoveDbNode, + AllConnectionStringType, + ApexDetailsType, + AutonomousDatabase, + AutonomousDatabaseBackup, + AutonomousDatabaseBackupListResult, + AutonomousDatabaseBackupProperties, + AutonomousDatabaseBackupUpdate, + AutonomousDatabaseBaseProperties, + AutonomousDatabaseCharacterSet, + AutonomousDatabaseCharacterSetListResult, + AutonomousDatabaseCharacterSetProperties, + AutonomousDatabaseCloneProperties, + AutonomousDatabaseCrossRegionDisasterRecoveryProperties, + AutonomousDatabaseFromBackupTimestampProperties, + AutonomousDatabaseListResult, + AutonomousDatabaseNationalCharacterSet, + AutonomousDatabaseNationalCharacterSetListResult, + AutonomousDatabaseNationalCharacterSetProperties, + AutonomousDatabaseProperties, + AutonomousDatabaseStandbySummary, + AutonomousDatabaseUpdate, + AutonomousDatabaseUpdateProperties, + AutonomousDatabaseWalletFile, + AutonomousDbVersion, + AutonomousDbVersionListResult, + AutonomousDbVersionProperties, + AzureSubscriptions, + CloudAccountDetails, + CloudExadataInfrastructure, + CloudExadataInfrastructureListResult, + CloudExadataInfrastructureProperties, + CloudExadataInfrastructureUpdate, + CloudExadataInfrastructureUpdateProperties, + CloudVmCluster, + CloudVmClusterListResult, + CloudVmClusterProperties, + CloudVmClusterUpdate, + CloudVmClusterUpdateProperties, + ConnectionStringType, + ConnectionUrlType, + CustomerContact, + DataCollectionOptions, + DayOfWeek, + DayOfWeekUpdate, + DbActionResponse, + DbIormConfig, + DbNode, + DbNodeAction, + DbNodeDetails, + DbNodeListResult, + DbNodeProperties, + DbServer, + DbServerListResult, + DbServerPatchingDetails, + DbServerProperties, + DbSystemShape, + DbSystemShapeListResult, + DbSystemShapeProperties, + DefinedFileSystemConfiguration, + DisasterRecoveryConfigurationDetails, + DnsPrivateView, + DnsPrivateViewListResult, + DnsPrivateViewProperties, + DnsPrivateZone, + DnsPrivateZoneListResult, + DnsPrivateZoneProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + EstimatedPatchingTime, + ExadataIormConfig, + ExadbVmCluster, + ExadbVmClusterListResult, + ExadbVmClusterProperties, + ExadbVmClusterStorageDetails, + ExadbVmClusterUpdate, + ExadbVmClusterUpdateProperties, + ExascaleDbNode, + ExascaleDbNodeListResult, + ExascaleDbNodeProperties, + ExascaleDbStorageDetails, + ExascaleDbStorageInputDetails, + ExascaleDbStorageVault, + ExascaleDbStorageVaultListResult, + ExascaleDbStorageVaultProperties, + ExascaleDbStorageVaultTagsUpdate, + FileSystemConfigurationDetails, + FlexComponent, + FlexComponentListResult, + FlexComponentProperties, + GenerateAutonomousDatabaseWalletDetails, + GiMinorVersion, + GiMinorVersionListResult, + GiMinorVersionProperties, + GiVersion, + GiVersionListResult, + GiVersionProperties, + LongTermBackUpScheduleDetails, + MaintenanceWindow, + Month, + NsgCidr, + Operation, + OperationDisplay, + OperationListResult, + OracleSubscription, + OracleSubscriptionListResult, + OracleSubscriptionProperties, + OracleSubscriptionUpdate, + OracleSubscriptionUpdateProperties, + PeerDbDetails, + Plan, + PlanUpdate, + PortRange, + PrivateIpAddressProperties, + PrivateIpAddressesFilter, + ProfileType, + ProxyResource, + RemoveVirtualMachineFromExadbVmClusterDetails, + Resource, + RestoreAutonomousDatabaseDetails, + SaasSubscriptionDetails, + ScheduledOperationsType, + ScheduledOperationsTypeUpdate, + SystemData, + SystemVersion, + SystemVersionListResult, + SystemVersionProperties, + SystemVersionsFilter, + TrackedResource, + ValidationError, + ValidationResult, + VirtualNetworkAddress, + VirtualNetworkAddressListResult, + VirtualNetworkAddressProperties, +) + +from ._oracle_database_mgmt_client_enums import ( # type: ignore + ActionType, + AddSubscriptionOperationState, + AutonomousDatabaseBackupLifecycleState, + AutonomousDatabaseBackupType, + AutonomousDatabaseLifecycleState, + AutonomousMaintenanceScheduleType, + AzureResourceProvisioningState, + CloneType, + CloudAccountProvisioningState, + CloudExadataInfrastructureLifecycleState, + CloudVmClusterLifecycleState, + ComputeModel, + ConsumerGroup, + CreatedByType, + DataBaseType, + DataSafeStatusType, + DatabaseEditionType, + DayOfWeekName, + DbNodeActionEnum, + DbNodeMaintenanceType, + DbNodeProvisioningState, + DbServerPatchingStatus, + DbServerProvisioningState, + DisasterRecoveryType, + DiskRedundancy, + DnsPrivateViewsLifecycleState, + DnsPrivateZonesLifecycleState, + ExadbVmClusterLifecycleState, + ExascaleDbStorageVaultLifecycleState, + GenerateType, + GridImageType, + HardwareType, + HostFormatType, + Intent, + IormLifecycleState, + LicenseModel, + MonthName, + Objective, + OpenModeType, + OperationsInsightsStatusType, + OracleSubscriptionProvisioningState, + Origin, + PatchingMode, + PermissionLevelType, + Preference, + ProtocolType, + RefreshableModelType, + RefreshableStatusType, + RepeatCadenceType, + ResourceProvisioningState, + RoleType, + SessionModeType, + ShapeFamily, + SourceType, + SyntaxFormatType, + SystemShapes, + TlsAuthenticationType, + UpdateAction, + ValidationStatus, + VirtualNetworkAddressLifecycleState, + WorkloadType, + ZoneType, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -183,12 +230,13 @@ "AutonomousDatabaseBackupListResult", "AutonomousDatabaseBackupProperties", "AutonomousDatabaseBackupUpdate", - "AutonomousDatabaseBackupUpdateProperties", "AutonomousDatabaseBaseProperties", "AutonomousDatabaseCharacterSet", "AutonomousDatabaseCharacterSetListResult", "AutonomousDatabaseCharacterSetProperties", "AutonomousDatabaseCloneProperties", + "AutonomousDatabaseCrossRegionDisasterRecoveryProperties", + "AutonomousDatabaseFromBackupTimestampProperties", "AutonomousDatabaseListResult", "AutonomousDatabaseNationalCharacterSet", "AutonomousDatabaseNationalCharacterSetListResult", @@ -201,6 +249,7 @@ "AutonomousDbVersion", "AutonomousDbVersionListResult", "AutonomousDbVersionProperties", + "AzureSubscriptions", "CloudAccountDetails", "CloudExadataInfrastructure", "CloudExadataInfrastructureListResult", @@ -218,9 +267,11 @@ "DataCollectionOptions", "DayOfWeek", "DayOfWeekUpdate", + "DbActionResponse", "DbIormConfig", "DbNode", "DbNodeAction", + "DbNodeDetails", "DbNodeListResult", "DbNodeProperties", "DbServer", @@ -230,6 +281,8 @@ "DbSystemShape", "DbSystemShapeListResult", "DbSystemShapeProperties", + "DefinedFileSystemConfiguration", + "DisasterRecoveryConfigurationDetails", "DnsPrivateView", "DnsPrivateViewListResult", "DnsPrivateViewProperties", @@ -241,7 +294,29 @@ "ErrorResponse", "EstimatedPatchingTime", "ExadataIormConfig", + "ExadbVmCluster", + "ExadbVmClusterListResult", + "ExadbVmClusterProperties", + "ExadbVmClusterStorageDetails", + "ExadbVmClusterUpdate", + "ExadbVmClusterUpdateProperties", + "ExascaleDbNode", + "ExascaleDbNodeListResult", + "ExascaleDbNodeProperties", + "ExascaleDbStorageDetails", + "ExascaleDbStorageInputDetails", + "ExascaleDbStorageVault", + "ExascaleDbStorageVaultListResult", + "ExascaleDbStorageVaultProperties", + "ExascaleDbStorageVaultTagsUpdate", + "FileSystemConfigurationDetails", + "FlexComponent", + "FlexComponentListResult", + "FlexComponentProperties", "GenerateAutonomousDatabaseWalletDetails", + "GiMinorVersion", + "GiMinorVersionListResult", + "GiMinorVersionProperties", "GiVersion", "GiVersionListResult", "GiVersionProperties", @@ -265,6 +340,7 @@ "PrivateIpAddressesFilter", "ProfileType", "ProxyResource", + "RemoveVirtualMachineFromExadbVmClusterDetails", "Resource", "RestoreAutonomousDatabaseDetails", "SaasSubscriptionDetails", @@ -282,6 +358,7 @@ "VirtualNetworkAddressListResult", "VirtualNetworkAddressProperties", "ActionType", + "AddSubscriptionOperationState", "AutonomousDatabaseBackupLifecycleState", "AutonomousDatabaseBackupType", "AutonomousDatabaseLifecycleState", @@ -307,7 +384,11 @@ "DiskRedundancy", "DnsPrivateViewsLifecycleState", "DnsPrivateZonesLifecycleState", + "ExadbVmClusterLifecycleState", + "ExascaleDbStorageVaultLifecycleState", "GenerateType", + "GridImageType", + "HardwareType", "HostFormatType", "Intent", "IormLifecycleState", @@ -328,8 +409,10 @@ "ResourceProvisioningState", "RoleType", "SessionModeType", + "ShapeFamily", "SourceType", "SyntaxFormatType", + "SystemShapes", "TlsAuthenticationType", "UpdateAction", "ValidationStatus", @@ -337,5 +420,5 @@ "WorkloadType", "ZoneType", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py index b2e79b9f4d18..68f4df53eaef 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_models_py3.py @@ -1,5 +1,5 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,10 +10,9 @@ import datetime from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from .. import _serialization +from .._utils import serialization as _serialization if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models @@ -41,8 +40,8 @@ class ActivationLinks(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.new_cloud_account_activation_link = None - self.existing_cloud_account_activation_link = None + self.new_cloud_account_activation_link: Optional[str] = None + self.existing_cloud_account_activation_link: Optional[str] = None class AddRemoveDbNode(_serialization.Model): @@ -156,7 +155,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -185,10 +184,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class TrackedResource(Resource): @@ -200,7 +199,7 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -253,7 +252,7 @@ class AutonomousDatabase(TrackedResource): All required parameters must be populated in order to send to server. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -316,7 +315,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -335,7 +334,7 @@ class AutonomousDatabaseBackup(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -409,7 +408,7 @@ def __init__( self.next_link = next_link -class AutonomousDatabaseBackupProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class AutonomousDatabaseBackupProperties(_serialization.Model): """AutonomousDatabaseBackup resource model. Variables are only populated by the server, and will be ignored when sending a request. @@ -436,7 +435,7 @@ class AutonomousDatabaseBackupProperties(_serialization.Model): # pylint: disab "Deleting", "Failed", and "Updating". :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupLifecycleState - :ivar retention_period_in_days: Retention period, in days, for long-term backups. + :ivar retention_period_in_days: Retention period, in days. :vartype retention_period_in_days: int :ivar size_in_tbs: The backup size in terabytes (TB). :vartype size_in_tbs: float @@ -463,7 +462,6 @@ class AutonomousDatabaseBackupProperties(_serialization.Model): # pylint: disab "is_restorable": {"readonly": True}, "lifecycle_details": {"readonly": True}, "lifecycle_state": {"readonly": True}, - "retention_period_in_days": {"maximum": 3650, "minimum": 60}, "size_in_tbs": {"readonly": True}, "time_available_til": {"readonly": True}, "time_started": {"readonly": True}, @@ -498,80 +496,80 @@ def __init__( :keyword display_name: The user-friendly name for the backup. The name does not have to be unique. :paramtype display_name: str - :keyword retention_period_in_days: Retention period, in days, for long-term backups. + :keyword retention_period_in_days: Retention period, in days. :paramtype retention_period_in_days: int """ super().__init__(**kwargs) - self.autonomous_database_ocid = None - self.database_size_in_tbs = None - self.db_version = None + self.autonomous_database_ocid: Optional[str] = None + self.database_size_in_tbs: Optional[float] = None + self.db_version: Optional[str] = None self.display_name = display_name - self.ocid = None - self.is_automatic = None - self.is_restorable = None - self.lifecycle_details = None - self.lifecycle_state = None + self.ocid: Optional[str] = None + self.is_automatic: Optional[bool] = None + self.is_restorable: Optional[bool] = None + self.lifecycle_details: Optional[str] = None + self.lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseBackupLifecycleState"]] = None self.retention_period_in_days = retention_period_in_days - self.size_in_tbs = None - self.time_available_til = None - self.time_started = None - self.time_ended = None - self.backup_type = None - self.provisioning_state = None + self.size_in_tbs: Optional[float] = None + self.time_available_til: Optional[datetime.datetime] = None + self.time_started: Optional[str] = None + self.time_ended: Optional[str] = None + self.backup_type: Optional[Union[str, "_models.AutonomousDatabaseBackupType"]] = None + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None -class AutonomousDatabaseBackupUpdate(_serialization.Model): - """The type used for update operations of the AutonomousDatabaseBackup. - - :ivar properties: The updatable properties of the AutonomousDatabaseBackup. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "AutonomousDatabaseBackupUpdateProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseBackupUpdateProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The updatable properties of the AutonomousDatabaseBackup. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupUpdateProperties - """ - super().__init__(**kwargs) - self.properties = properties - +class AutonomousDatabaseBackupUpdate(ProxyResource): + """AutonomousDatabaseBackup resource definition. -class AutonomousDatabaseBackupUpdateProperties(_serialization.Model): - """The updatable properties of the AutonomousDatabaseBackup. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar retention_period_in_days: Retention period, in days, for long-term backups. - :vartype retention_period_in_days: int + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties """ _validation = { - "retention_period_in_days": {"maximum": 3650, "minimum": 60}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - "retention_period_in_days": {"key": "retentionPeriodInDays", "type": "int"}, + "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": "AutonomousDatabaseBackupProperties"}, } - def __init__(self, *, retention_period_in_days: Optional[int] = None, **kwargs: Any) -> None: + def __init__( + self, *, properties: Optional["_models.AutonomousDatabaseBackupProperties"] = None, **kwargs: Any + ) -> None: """ - :keyword retention_period_in_days: Retention period, in days, for long-term backups. - :paramtype retention_period_in_days: int + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackupProperties """ super().__init__(**kwargs) - self.retention_period_in_days = retention_period_in_days + self.properties = properties -class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes +class AutonomousDatabaseBaseProperties(_serialization.Model): """Autonomous Database base resource model. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AutonomousDatabaseCloneProperties, AutonomousDatabaseProperties + AutonomousDatabaseCloneProperties, AutonomousDatabaseFromBackupTimestampProperties, + AutonomousDatabaseCrossRegionDisasterRecoveryProperties, AutonomousDatabaseProperties Variables are only populated by the server, and will be ignored when sending a request. @@ -579,8 +577,8 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable :ivar admin_password: Admin password. :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous Database Serverless. Known values are: "Early" and "Regular". @@ -615,14 +613,13 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :vartype peer_db_id: str :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -637,6 +634,12 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable switchover. Known values are: "Adg" and "BackupBased". :vartype local_disaster_recovery_type: str or ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data @@ -801,6 +804,8 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable "peer_db_id": {"max_length": 255, "min_length": 1}, "is_remote_data_guard_enabled": {"readonly": True}, "local_disaster_recovery_type": {"readonly": True}, + "time_disaster_recovery_role_changed": {"readonly": True}, + "remote_disaster_recovery_configuration": {"readonly": True}, "local_standby_db": {"readonly": True}, "failed_data_recovery_in_seconds": {"readonly": True}, "ncharacter_set": {"max_length": 255, "min_length": 1}, @@ -863,6 +868,11 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "iso-8601"}, + "remote_disaster_recovery_configuration": { + "key": "remoteDisasterRecoveryConfiguration", + "type": "DisasterRecoveryConfigurationDetails", + }, "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, @@ -927,7 +937,12 @@ class AutonomousDatabaseBaseProperties(_serialization.Model): # pylint: disable } _subtype_map = { - "data_base_type": {"Clone": "AutonomousDatabaseCloneProperties", "Regular": "AutonomousDatabaseProperties"} + "data_base_type": { + "Clone": "AutonomousDatabaseCloneProperties", + "CloneFromBackupTimestamp": "AutonomousDatabaseFromBackupTimestampProperties", + "CrossRegionDisasterRecovery": "AutonomousDatabaseCrossRegionDisasterRecoveryProperties", + "Regular": "AutonomousDatabaseProperties", + } } def __init__( # pylint: disable=too-many-locals @@ -1005,8 +1020,8 @@ def __init__( # pylint: disable=too-many-locals :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :paramtype peer_db_id: str :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -1078,64 +1093,66 @@ def __init__( # pylint: disable=too-many-locals self.display_name = display_name self.is_auto_scaling_enabled = is_auto_scaling_enabled self.is_auto_scaling_for_storage_enabled = is_auto_scaling_for_storage_enabled - self.peer_db_ids = None + self.peer_db_ids: Optional[List[str]] = None self.peer_db_id = peer_db_id self.is_local_data_guard_enabled = is_local_data_guard_enabled - self.is_remote_data_guard_enabled = None - self.local_disaster_recovery_type = None - self.local_standby_db = None - self.failed_data_recovery_in_seconds = None + self.is_remote_data_guard_enabled: Optional[bool] = None + self.local_disaster_recovery_type: Optional[Union[str, "_models.DisasterRecoveryType"]] = None + self.time_disaster_recovery_role_changed: Optional[datetime.datetime] = None + self.remote_disaster_recovery_configuration: Optional["_models.DisasterRecoveryConfigurationDetails"] = None + self.local_standby_db: Optional["_models.AutonomousDatabaseStandbySummary"] = None + self.failed_data_recovery_in_seconds: Optional[int] = None self.is_mtls_connection_required = is_mtls_connection_required self.is_preview_version_with_service_terms_accepted = is_preview_version_with_service_terms_accepted self.license_model = license_model self.ncharacter_set = ncharacter_set - self.lifecycle_details = None - self.provisioning_state = None - self.lifecycle_state = None + self.lifecycle_details: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = None self.scheduled_operations = scheduled_operations self.private_endpoint_ip = private_endpoint_ip self.private_endpoint_label = private_endpoint_label - self.oci_url = None + self.oci_url: Optional[str] = None self.subnet_id = subnet_id self.vnet_id = vnet_id - self.time_created = None - self.time_maintenance_begin = None - self.time_maintenance_end = None - self.actual_used_data_storage_size_in_tbs = None - self.allocated_storage_size_in_tbs = None - self.apex_details = None - self.available_upgrade_versions = None - self.connection_strings = None - self.connection_urls = None - self.data_safe_status = None + self.time_created: Optional[datetime.datetime] = None + self.time_maintenance_begin: Optional[datetime.datetime] = None + self.time_maintenance_end: Optional[datetime.datetime] = None + self.actual_used_data_storage_size_in_tbs: Optional[float] = None + self.allocated_storage_size_in_tbs: Optional[float] = None + self.apex_details: Optional["_models.ApexDetailsType"] = None + self.available_upgrade_versions: Optional[List[str]] = None + self.connection_strings: Optional["_models.ConnectionStringType"] = None + self.connection_urls: Optional["_models.ConnectionUrlType"] = None + self.data_safe_status: Optional[Union[str, "_models.DataSafeStatusType"]] = None self.database_edition = database_edition self.autonomous_database_id = autonomous_database_id - self.in_memory_area_in_gbs = None - self.next_long_term_backup_time_stamp = None + self.in_memory_area_in_gbs: Optional[int] = None + self.next_long_term_backup_time_stamp: Optional[datetime.datetime] = None self.long_term_backup_schedule = long_term_backup_schedule - self.is_preview = None + self.is_preview: Optional[bool] = None self.local_adg_auto_failover_max_data_loss_limit = local_adg_auto_failover_max_data_loss_limit - self.memory_per_oracle_compute_unit_in_gbs = None + self.memory_per_oracle_compute_unit_in_gbs: Optional[int] = None self.open_mode = open_mode - self.operations_insights_status = None + self.operations_insights_status: Optional[Union[str, "_models.OperationsInsightsStatusType"]] = None self.permission_level = permission_level - self.private_endpoint = None - self.provisionable_cpus = None + self.private_endpoint: Optional[str] = None + self.provisionable_cpus: Optional[List[int]] = None self.role = role - self.service_console_url = None - self.sql_web_developer_url = None - self.supported_regions_to_clone_to = None - self.time_data_guard_role_changed = None - self.time_deletion_of_free_autonomous_database = None - self.time_local_data_guard_enabled = None - self.time_of_last_failover = None - self.time_of_last_refresh = None - self.time_of_last_refresh_point = None - self.time_of_last_switchover = None - self.time_reclamation_of_free_autonomous_database = None - self.used_data_storage_size_in_gbs = None - self.used_data_storage_size_in_tbs = None - self.ocid = None + self.service_console_url: Optional[str] = None + self.sql_web_developer_url: Optional[str] = None + self.supported_regions_to_clone_to: Optional[List[str]] = None + self.time_data_guard_role_changed: Optional[str] = None + self.time_deletion_of_free_autonomous_database: Optional[str] = None + self.time_local_data_guard_enabled: Optional[str] = None + self.time_of_last_failover: Optional[str] = None + self.time_of_last_refresh: Optional[str] = None + self.time_of_last_refresh_point: Optional[str] = None + self.time_of_last_switchover: Optional[str] = None + self.time_reclamation_of_free_autonomous_database: Optional[str] = None + self.used_data_storage_size_in_gbs: Optional[int] = None + self.used_data_storage_size_in_tbs: Optional[int] = None + self.ocid: Optional[str] = None self.backup_retention_period_in_days = backup_retention_period_in_days self.whitelisted_ips = whitelisted_ips @@ -1146,7 +1163,7 @@ class AutonomousDatabaseCharacterSet(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1224,8 +1241,6 @@ def __init__( class AutonomousDatabaseCharacterSetProperties(_serialization.Model): """AutonomousDatabaseCharacterSet resource model. - 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 character_set: The Oracle Autonomous Database supported character sets. Required. @@ -1233,22 +1248,23 @@ class AutonomousDatabaseCharacterSetProperties(_serialization.Model): """ _validation = { - "character_set": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, + "character_set": {"required": True, "max_length": 255, "min_length": 1}, } _attribute_map = { "character_set": {"key": "characterSet", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, character_set: str, **kwargs: Any) -> None: + """ + :keyword character_set: The Oracle Autonomous Database supported character sets. Required. + :paramtype character_set: str + """ super().__init__(**kwargs) - self.character_set = None + self.character_set = character_set -class AutonomousDatabaseCloneProperties( - AutonomousDatabaseBaseProperties -): # pylint: disable=too-many-instance-attributes +class AutonomousDatabaseCloneProperties(AutonomousDatabaseBaseProperties): """Autonomous Database clone resource model. Variables are only populated by the server, and will be ignored when sending a request. @@ -1257,8 +1273,8 @@ class AutonomousDatabaseCloneProperties( :ivar admin_password: Admin password. :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous Database Serverless. Known values are: "Early" and "Regular". @@ -1293,14 +1309,13 @@ class AutonomousDatabaseCloneProperties( :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :vartype peer_db_id: str :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -1315,6 +1330,12 @@ class AutonomousDatabaseCloneProperties( switchover. Known values are: "Adg" and "BackupBased". :vartype local_disaster_recovery_type: str or ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data @@ -1468,8 +1489,8 @@ class AutonomousDatabaseCloneProperties( "BackupFromTimestamp", "CloneToRefreshable", "CrossRegionDataguard", and "CrossRegionDisasterRecovery". :vartype source: str or ~azure.mgmt.oracledatabase.models.SourceType - :ivar source_id: The Azure ID of the Autonomous Database that was cloned to create the current - Autonomous Database. Required. + :ivar source_id: The Azure resource ID of the Autonomous Database that was cloned to create the + current Autonomous Database. Required. :vartype source_id: str :ivar clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and "Metadata". @@ -1504,6 +1525,8 @@ class AutonomousDatabaseCloneProperties( "peer_db_id": {"max_length": 255, "min_length": 1}, "is_remote_data_guard_enabled": {"readonly": True}, "local_disaster_recovery_type": {"readonly": True}, + "time_disaster_recovery_role_changed": {"readonly": True}, + "remote_disaster_recovery_configuration": {"readonly": True}, "local_standby_db": {"readonly": True}, "failed_data_recovery_in_seconds": {"readonly": True}, "ncharacter_set": {"max_length": 255, "min_length": 1}, @@ -1571,6 +1594,11 @@ class AutonomousDatabaseCloneProperties( "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "iso-8601"}, + "remote_disaster_recovery_configuration": { + "key": "remoteDisasterRecoveryConfiguration", + "type": "DisasterRecoveryConfigurationDetails", + }, "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, @@ -1722,8 +1750,8 @@ def __init__( # pylint: disable=too-many-locals :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :paramtype peer_db_id: str :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -1782,8 +1810,8 @@ def __init__( # pylint: disable=too-many-locals "BackupFromId", "BackupFromTimestamp", "CloneToRefreshable", "CrossRegionDataguard", and "CrossRegionDisasterRecovery". :paramtype source: str or ~azure.mgmt.oracledatabase.models.SourceType - :keyword source_id: The Azure ID of the Autonomous Database that was cloned to create the - current Autonomous Database. Required. + :keyword source_id: The Azure resource ID of the Autonomous Database that was cloned to create + the current Autonomous Database. Required. :paramtype source_id: str :keyword clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and "Metadata". @@ -1837,162 +1865,17 @@ def __init__( # pylint: disable=too-many-locals self.source = source self.source_id = source_id self.clone_type = clone_type - self.is_reconnect_clone_enabled = None - self.is_refreshable_clone = None + self.is_reconnect_clone_enabled: Optional[bool] = None + self.is_refreshable_clone: Optional[bool] = None self.refreshable_model = refreshable_model - self.refreshable_status = None + self.refreshable_status: Optional[Union[str, "_models.RefreshableStatusType"]] = None self.time_until_reconnect_clone_enabled = time_until_reconnect_clone_enabled -class AutonomousDatabaseListResult(_serialization.Model): - """The response of a AutonomousDatabase list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabase items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.AutonomousDatabase"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabase items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseNationalCharacterSet(ProxyResource): - """AutonomousDatabaseNationalCharacterSets resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties - """ - - _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"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseNationalCharacterSetProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.AutonomousDatabaseNationalCharacterSetProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class AutonomousDatabaseNationalCharacterSetListResult(_serialization.Model): # pylint: disable=name-too-long - """The response of a AutonomousDatabaseNationalCharacterSet list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDatabaseNationalCharacterSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: List["_models.AutonomousDatabaseNationalCharacterSet"], - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. - :paramtype value: - list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AutonomousDatabaseNationalCharacterSetProperties(_serialization.Model): # pylint: disable=name-too-long - """AutonomousDatabaseNationalCharacterSet resource model. - - 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 character_set: The Oracle Autonomous Database supported national character sets. - Required. - :vartype character_set: str - """ - - _validation = { - "character_set": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - } - - _attribute_map = { - "character_set": {"key": "characterSet", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.character_set = None - - -class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: disable=too-many-instance-attributes - """Autonomous Database resource model. +class AutonomousDatabaseCrossRegionDisasterRecoveryProperties( + AutonomousDatabaseBaseProperties +): # pylint: disable=name-too-long + """Autonomous Database Cross Region Disaster Recovery resource model. Variables are only populated by the server, and will be ignored when sending a request. @@ -2000,8 +1883,8 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: :ivar admin_password: Admin password. :vartype admin_password: str - :ivar data_base_type: Database type to be created. Required. Known values are: "Regular" and - "Clone". + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous Database Serverless. Known values are: "Early" and "Regular". @@ -2036,14 +1919,13 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_ids: The list of `OCIDs - `_ of standby databases - located in Autonomous Data Guard remote regions that are associated with the source database. - Note that for Autonomous Database Serverless instances, standby databases located in the same - region as the source primary database do not have OCIDs. + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. :vartype peer_db_ids: list[str] - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :vartype peer_db_id: str :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -2058,6 +1940,12 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: switchover. Known values are: "Adg" and "BackupBased". :vartype local_disaster_recovery_type: str or ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data @@ -2207,6 +2095,27 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. :vartype whitelisted_ips: list[str] + :ivar source: The source of the database. Required. Default value is + "CrossRegionDisasterRecovery". + :vartype source: str + :ivar source_id: The Azure ID of the source Autonomous Database that will be used to create a + new peer database for the DR association. Required. + :vartype source_id: str + :ivar source_location: The name of the region where source Autonomous Database exists. + :vartype source_location: str + :ivar source_ocid: The source database ocid. + :vartype source_ocid: str + :ivar remote_disaster_recovery_type: Indicates the cross-region disaster recovery (DR) type of + the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type + provides business critical DR with a faster recovery time objective (RTO) during failover or + switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Required. Known values are: "Adg" and "BackupBased". + :vartype remote_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :vartype is_replicate_automatic_backups: bool """ _validation = { @@ -2222,6 +2131,8 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: "peer_db_id": {"max_length": 255, "min_length": 1}, "is_remote_data_guard_enabled": {"readonly": True}, "local_disaster_recovery_type": {"readonly": True}, + "time_disaster_recovery_role_changed": {"readonly": True}, + "remote_disaster_recovery_configuration": {"readonly": True}, "local_standby_db": {"readonly": True}, "failed_data_recovery_in_seconds": {"readonly": True}, "ncharacter_set": {"max_length": 255, "min_length": 1}, @@ -2261,6 +2172,10 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: "used_data_storage_size_in_gbs": {"readonly": True}, "used_data_storage_size_in_tbs": {"readonly": True}, "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "source": {"required": True, "constant": True}, + "source_id": {"required": True}, + "source_ocid": {"max_length": 255, "min_length": 1}, + "remote_disaster_recovery_type": {"required": True}, } _attribute_map = { @@ -2284,6 +2199,11 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "iso-8601"}, + "remote_disaster_recovery_configuration": { + "key": "remoteDisasterRecoveryConfiguration", + "type": "DisasterRecoveryConfigurationDetails", + }, "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, @@ -2345,11 +2265,21 @@ class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): # pylint: "ocid": {"key": "ocid", "type": "str"}, "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, + "source": {"key": "source", "type": "str"}, + "source_id": {"key": "sourceId", "type": "str"}, + "source_location": {"key": "sourceLocation", "type": "str"}, + "source_ocid": {"key": "sourceOcid", "type": "str"}, + "remote_disaster_recovery_type": {"key": "remoteDisasterRecoveryType", "type": "str"}, + "is_replicate_automatic_backups": {"key": "isReplicateAutomaticBackups", "type": "bool"}, } + source = "CrossRegionDisasterRecovery" + def __init__( # pylint: disable=too-many-locals self, *, + source_id: str, + remote_disaster_recovery_type: Union[str, "_models.DisasterRecoveryType"], admin_password: Optional[str] = None, autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, character_set: Optional[str] = None, @@ -2384,6 +2314,9 @@ def __init__( # pylint: disable=too-many-locals role: Optional[Union[str, "_models.RoleType"]] = None, backup_retention_period_in_days: Optional[int] = None, whitelisted_ips: Optional[List[str]] = None, + source_location: Optional[str] = None, + source_ocid: Optional[str] = None, + is_replicate_automatic_backups: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -2422,8 +2355,8 @@ def __init__( # pylint: disable=too-many-locals :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :paramtype peer_db_id: str :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -2478,6 +2411,24 @@ def __init__( # pylint: disable=too-many-locals notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. :paramtype whitelisted_ips: list[str] + :keyword source_id: The Azure ID of the source Autonomous Database that will be used to create + a new peer database for the DR association. Required. + :paramtype source_id: str + :keyword source_location: The name of the region where source Autonomous Database exists. + :paramtype source_location: str + :keyword source_ocid: The source database ocid. + :paramtype source_ocid: str + :keyword remote_disaster_recovery_type: Indicates the cross-region disaster recovery (DR) type + of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type + provides business critical DR with a faster recovery time objective (RTO) during failover or + switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Required. Known values are: "Adg" and "BackupBased". + :paramtype remote_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :keyword is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :paramtype is_replicate_automatic_backups: bool """ super().__init__( admin_password=admin_password, @@ -2516,123 +2467,39 @@ def __init__( # pylint: disable=too-many-locals whitelisted_ips=whitelisted_ips, **kwargs ) - self.data_base_type: str = "Regular" + self.data_base_type: str = "CrossRegionDisasterRecovery" + self.source_id = source_id + self.source_location = source_location + self.source_ocid = source_ocid + self.remote_disaster_recovery_type = remote_disaster_recovery_type + self.is_replicate_automatic_backups = is_replicate_automatic_backups -class AutonomousDatabaseStandbySummary(_serialization.Model): - """Autonomous Disaster Recovery standby database details. +class AutonomousDatabaseFromBackupTimestampProperties( + AutonomousDatabaseBaseProperties +): # pylint: disable=name-too-long + """Autonomous Database From Backup Timestamp resource model. - :ivar lag_time_in_seconds: The amount of time, in seconds, that the data of the standby - database lags the data of the primary database. Can be used to determine the potential data - loss in the event of a failover. - :vartype lag_time_in_seconds: int - :ivar lifecycle_state: The current state of the Autonomous Database. Known values are: - "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", - "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the standby Autonomous Database. - :vartype time_data_guard_role_changed: str - :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was - switched for the standby Autonomous Database. - :vartype time_disaster_recovery_role_changed: str - """ + Variables are only populated by the server, and will be ignored when sending a request. - _attribute_map = { - "lag_time_in_seconds": {"key": "lagTimeInSeconds", "type": "int"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, - "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "str"}, - } - - def __init__( - self, - *, - lag_time_in_seconds: Optional[int] = None, - lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = None, - lifecycle_details: Optional[str] = None, - time_data_guard_role_changed: Optional[str] = None, - time_disaster_recovery_role_changed: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword lag_time_in_seconds: The amount of time, in seconds, that the data of the standby - database lags the data of the primary database. Can be used to determine the potential data - loss in the event of a failover. - :paramtype lag_time_in_seconds: int - :keyword lifecycle_state: The current state of the Autonomous Database. Known values are: - "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", - "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", - "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", - "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". - :paramtype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState - :keyword lifecycle_details: Additional information about the current lifecycle state. - :paramtype lifecycle_details: str - :keyword time_data_guard_role_changed: The date and time the Autonomous Data Guard role was - switched for the standby Autonomous Database. - :paramtype time_data_guard_role_changed: str - :keyword time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was - switched for the standby Autonomous Database. - :paramtype time_disaster_recovery_role_changed: str - """ - super().__init__(**kwargs) - self.lag_time_in_seconds = lag_time_in_seconds - self.lifecycle_state = lifecycle_state - self.lifecycle_details = lifecycle_details - self.time_data_guard_role_changed = time_data_guard_role_changed - self.time_disaster_recovery_role_changed = time_disaster_recovery_role_changed - - -class AutonomousDatabaseUpdate(_serialization.Model): - """The type used for update operations of the AutonomousDatabase. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the AutonomousDatabase. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "AutonomousDatabaseUpdateProperties"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.AutonomousDatabaseUpdateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the AutonomousDatabase. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties - """ - super().__init__(**kwargs) - self.tags = tags - self.properties = properties - - -class AutonomousDatabaseUpdateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The updatable properties of the AutonomousDatabase. + All required parameters must be populated in order to send to server. :ivar admin_password: Admin password. :vartype admin_password: str + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous Database Serverless. Known values are: "Early" and "Regular". :vartype autonomous_maintenance_schedule_type: str or ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str :ivar compute_count: The compute amount (CPUs) available to the database. :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel :ivar cpu_core_count: The number of CPU cores to be made available to the database. :vartype cpu_core_count: int :ivar customer_contacts: Customer Contacts. @@ -2642,6 +2509,11 @@ class AutonomousDatabaseUpdateProperties(_serialization.Model): # pylint: disab :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created and attached to the database. :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType :ivar display_name: The user-friendly name for the Autonomous Database. :vartype display_name: str :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database @@ -2650,103 +2522,384 @@ class AutonomousDatabaseUpdateProperties(_serialization.Model): # pylint: disab :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :vartype is_auto_scaling_for_storage_enabled: bool - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :vartype peer_db_id: str :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS connections. :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState :ivar scheduled_operations: The list of scheduled operations. - :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. Known values are: "StandardEdition" and "EnterpriseEdition". :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime :ivar long_term_backup_schedule: Details for the long-term backup schedule. :vartype long_term_backup_schedule: ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and "ReadWrite". :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType :ivar permission_level: The Autonomous Database permission level. Known values are: "Restricted" and "Unrestricted". :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", "BackupCopy", and "SnapshotStandby". :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. :vartype backup_retention_period_in_days: int :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. :vartype whitelisted_ips: list[str] + :ivar source: The source of the database. Required. Default value is "BackupFromTimestamp". + :vartype source: str + :ivar source_id: The ID of the source Autonomous Database that you will clone to create a new + Autonomous Database. Required. + :vartype source_id: str + :ivar clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and + "Metadata". + :vartype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType + :ivar timestamp: The timestamp specified for the point-in-time clone of the source Autonomous + Database. The timestamp must be in the past. + :vartype timestamp: ~datetime.datetime + :ivar use_latest_available_backup_time_stamp: Clone from latest available backup timestamp. + :vartype use_latest_available_backup_time_stamp: bool """ _validation = { + "data_base_type": {"required": True}, + "character_set": {"max_length": 255, "min_length": 1}, "compute_count": {"maximum": 512, "minimum": 0.1}, "cpu_core_count": {"maximum": 128, "minimum": 1}, "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, + "db_version": {"max_length": 255, "min_length": 1}, "display_name": {"max_length": 255, "min_length": 1}, + "peer_db_ids": {"readonly": True}, "peer_db_id": {"max_length": 255, "min_length": 1}, + "is_remote_data_guard_enabled": {"readonly": True}, + "local_disaster_recovery_type": {"readonly": True}, + "time_disaster_recovery_role_changed": {"readonly": True}, + "remote_disaster_recovery_configuration": {"readonly": True}, + "local_standby_db": {"readonly": True}, + "failed_data_recovery_in_seconds": {"readonly": True}, + "ncharacter_set": {"max_length": 255, "min_length": 1}, + "lifecycle_details": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "oci_url": {"readonly": True}, + "time_created": {"readonly": True}, + "time_maintenance_begin": {"readonly": True}, + "time_maintenance_end": {"readonly": True}, + "actual_used_data_storage_size_in_tbs": {"readonly": True}, + "allocated_storage_size_in_tbs": {"readonly": True}, + "apex_details": {"readonly": True}, + "available_upgrade_versions": {"readonly": True}, + "connection_strings": {"readonly": True}, + "connection_urls": {"readonly": True}, + "data_safe_status": {"readonly": True}, + "in_memory_area_in_gbs": {"readonly": True}, + "next_long_term_backup_time_stamp": {"readonly": True}, + "is_preview": {"readonly": True}, "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, - } - - _attribute_map = { - "admin_password": {"key": "adminPassword", "type": "str"}, - "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "float"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, - "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, - "display_name": {"key": "displayName", "type": "str"}, + "memory_per_oracle_compute_unit_in_gbs": {"readonly": True}, + "operations_insights_status": {"readonly": True}, + "private_endpoint": {"readonly": True}, + "provisionable_cpus": {"readonly": True}, + "service_console_url": {"readonly": True, "max_length": 255, "min_length": 10}, + "sql_web_developer_url": {"readonly": True, "max_length": 2048, "min_length": 10}, + "supported_regions_to_clone_to": {"readonly": True, "max_items": 50, "min_items": 0}, + "time_data_guard_role_changed": {"readonly": True}, + "time_deletion_of_free_autonomous_database": {"readonly": True}, + "time_local_data_guard_enabled": {"readonly": True}, + "time_of_last_failover": {"readonly": True}, + "time_of_last_refresh": {"readonly": True}, + "time_of_last_refresh_point": {"readonly": True}, + "time_of_last_switchover": {"readonly": True}, + "time_reclamation_of_free_autonomous_database": {"readonly": True}, + "used_data_storage_size_in_gbs": {"readonly": True}, + "used_data_storage_size_in_tbs": {"readonly": True}, + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "source": {"required": True, "constant": True}, + "source_id": {"required": True}, + "clone_type": {"required": True}, + } + + _attribute_map = { + "admin_password": {"key": "adminPassword", "type": "str"}, + "data_base_type": {"key": "dataBaseType", "type": "str"}, + "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, + "character_set": {"key": "characterSet", "type": "str"}, + "compute_count": {"key": "computeCount", "type": "float"}, + "compute_model": {"key": "computeModel", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, + "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, + "db_version": {"key": "dbVersion", "type": "str"}, + "db_workload": {"key": "dbWorkload", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, + "peer_db_ids": {"key": "peerDbIds", "type": "[str]"}, "peer_db_id": {"key": "peerDbId", "type": "str"}, "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, + "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, + "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "iso-8601"}, + "remote_disaster_recovery_configuration": { + "key": "remoteDisasterRecoveryConfiguration", + "type": "DisasterRecoveryConfigurationDetails", + }, + "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, + "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, + "is_preview_version_with_service_terms_accepted": { + "key": "isPreviewVersionWithServiceTermsAccepted", + "type": "bool", + }, "license_model": {"key": "licenseModel", "type": "str"}, - "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsTypeUpdate"}, + "ncharacter_set": {"key": "ncharacterSet", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsType"}, + "private_endpoint_ip": {"key": "privateEndpointIp", "type": "str"}, + "private_endpoint_label": {"key": "privateEndpointLabel", "type": "str"}, + "oci_url": {"key": "ociUrl", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "vnet_id": {"key": "vnetId", "type": "str"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "time_maintenance_begin": {"key": "timeMaintenanceBegin", "type": "iso-8601"}, + "time_maintenance_end": {"key": "timeMaintenanceEnd", "type": "iso-8601"}, + "actual_used_data_storage_size_in_tbs": {"key": "actualUsedDataStorageSizeInTbs", "type": "float"}, + "allocated_storage_size_in_tbs": {"key": "allocatedStorageSizeInTbs", "type": "float"}, + "apex_details": {"key": "apexDetails", "type": "ApexDetailsType"}, + "available_upgrade_versions": {"key": "availableUpgradeVersions", "type": "[str]"}, + "connection_strings": {"key": "connectionStrings", "type": "ConnectionStringType"}, + "connection_urls": {"key": "connectionUrls", "type": "ConnectionUrlType"}, + "data_safe_status": {"key": "dataSafeStatus", "type": "str"}, "database_edition": {"key": "databaseEdition", "type": "str"}, + "autonomous_database_id": {"key": "autonomousDatabaseId", "type": "str"}, + "in_memory_area_in_gbs": {"key": "inMemoryAreaInGbs", "type": "int"}, + "next_long_term_backup_time_stamp": {"key": "nextLongTermBackupTimeStamp", "type": "iso-8601"}, "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, + "is_preview": {"key": "isPreview", "type": "bool"}, "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, + "memory_per_oracle_compute_unit_in_gbs": {"key": "memoryPerOracleComputeUnitInGbs", "type": "int"}, "open_mode": {"key": "openMode", "type": "str"}, + "operations_insights_status": {"key": "operationsInsightsStatus", "type": "str"}, "permission_level": {"key": "permissionLevel", "type": "str"}, + "private_endpoint": {"key": "privateEndpoint", "type": "str"}, + "provisionable_cpus": {"key": "provisionableCpus", "type": "[int]"}, "role": {"key": "role", "type": "str"}, + "service_console_url": {"key": "serviceConsoleUrl", "type": "str"}, + "sql_web_developer_url": {"key": "sqlWebDeveloperUrl", "type": "str"}, + "supported_regions_to_clone_to": {"key": "supportedRegionsToCloneTo", "type": "[str]"}, + "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, + "time_deletion_of_free_autonomous_database": {"key": "timeDeletionOfFreeAutonomousDatabase", "type": "str"}, + "time_local_data_guard_enabled": {"key": "timeLocalDataGuardEnabled", "type": "str"}, + "time_of_last_failover": {"key": "timeOfLastFailover", "type": "str"}, + "time_of_last_refresh": {"key": "timeOfLastRefresh", "type": "str"}, + "time_of_last_refresh_point": {"key": "timeOfLastRefreshPoint", "type": "str"}, + "time_of_last_switchover": {"key": "timeOfLastSwitchover", "type": "str"}, + "time_reclamation_of_free_autonomous_database": { + "key": "timeReclamationOfFreeAutonomousDatabase", + "type": "str", + }, + "used_data_storage_size_in_gbs": {"key": "usedDataStorageSizeInGbs", "type": "int"}, + "used_data_storage_size_in_tbs": {"key": "usedDataStorageSizeInTbs", "type": "int"}, + "ocid": {"key": "ocid", "type": "str"}, "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, + "source": {"key": "source", "type": "str"}, + "source_id": {"key": "sourceId", "type": "str"}, + "clone_type": {"key": "cloneType", "type": "str"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "use_latest_available_backup_time_stamp": {"key": "useLatestAvailableBackupTimeStamp", "type": "bool"}, } - def __init__( + source = "BackupFromTimestamp" + + def __init__( # pylint: disable=too-many-locals self, *, + source_id: str, + clone_type: Union[str, "_models.CloneType"], admin_password: Optional[str] = None, autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, cpu_core_count: Optional[int] = None, customer_contacts: Optional[List["_models.CustomerContact"]] = None, data_storage_size_in_tbs: Optional[int] = None, data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, display_name: Optional[str] = None, is_auto_scaling_enabled: Optional[bool] = None, is_auto_scaling_for_storage_enabled: Optional[bool] = None, peer_db_id: Optional[str] = None, is_local_data_guard_enabled: Optional[bool] = None, is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - scheduled_operations: Optional["_models.ScheduledOperationsTypeUpdate"] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, @@ -2754,6 +2907,8 @@ def __init__( role: Optional[Union[str, "_models.RoleType"]] = None, backup_retention_period_in_days: Optional[int] = None, whitelisted_ips: Optional[List[str]] = None, + timestamp: Optional[datetime.datetime] = None, + use_latest_available_backup_time_stamp: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -2763,8 +2918,13 @@ def __init__( Database Serverless. Known values are: "Early" and "Regular". :paramtype autonomous_maintenance_schedule_type: str or ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :keyword character_set: The character set for the autonomous database. + :paramtype character_set: str :keyword compute_count: The compute amount (CPUs) available to the database. :paramtype compute_count: float + :keyword compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" + and "OCPU". + :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel :keyword cpu_core_count: The number of CPU cores to be made available to the database. :paramtype cpu_core_count: int :keyword customer_contacts: Customer Contacts. @@ -2774,6 +2934,11 @@ def __init__( :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created and attached to the database. :paramtype data_storage_size_in_gbs: int + :keyword db_version: A valid Oracle Database version for Autonomous Database. + :paramtype db_version: str + :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType :keyword display_name: The user-friendly name for the Autonomous Database. :paramtype display_name: str :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous @@ -2782,8 +2947,8 @@ def __init__( :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the Autonomous Database storage. :paramtype is_auto_scaling_for_storage_enabled: bool - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :paramtype peer_db_id: str :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. @@ -2791,16 +2956,30 @@ def __init__( :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS connections. :paramtype is_mtls_connection_required: bool + :keyword is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :paramtype is_preview_version_with_service_terms_accepted: bool :keyword license_model: The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword ncharacter_set: The character set for the Autonomous Database. + :paramtype ncharacter_set: str :keyword scheduled_operations: The list of scheduled operations. - :paramtype scheduled_operations: - ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate + :paramtype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :keyword private_endpoint_ip: The private endpoint Ip address for the resource. + :paramtype private_endpoint_ip: str + :keyword private_endpoint_label: The resource's private endpoint label. + :paramtype private_endpoint_label: str + :keyword subnet_id: Client subnet. + :paramtype subnet_id: str + :keyword vnet_id: VNET for network connectivity. + :paramtype vnet_id: str :keyword database_edition: The Oracle Database Edition that applies to the Autonomous databases. Known values are: "StandardEdition" and "EnterpriseEdition". :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :keyword autonomous_database_id: Autonomous Database ID. + :paramtype autonomous_database_id: str :keyword long_term_backup_schedule: Details for the long-term backup schedule. :paramtype long_term_backup_schedule: ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails @@ -2824,66 +3003,103 @@ def __init__( notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. :paramtype whitelisted_ips: list[str] + :keyword source_id: The ID of the source Autonomous Database that you will clone to create a + new Autonomous Database. Required. + :paramtype source_id: str + :keyword clone_type: The Autonomous Database clone type. Required. Known values are: "Full" and + "Metadata". + :paramtype clone_type: str or ~azure.mgmt.oracledatabase.models.CloneType + :keyword timestamp: The timestamp specified for the point-in-time clone of the source + Autonomous Database. The timestamp must be in the past. + :paramtype timestamp: ~datetime.datetime + :keyword use_latest_available_backup_time_stamp: Clone from latest available backup timestamp. + :paramtype use_latest_available_backup_time_stamp: bool """ - super().__init__(**kwargs) - self.admin_password = admin_password - self.autonomous_maintenance_schedule_type = autonomous_maintenance_schedule_type - self.compute_count = compute_count - self.cpu_core_count = cpu_core_count - self.customer_contacts = customer_contacts - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.data_storage_size_in_gbs = data_storage_size_in_gbs - self.display_name = display_name - self.is_auto_scaling_enabled = is_auto_scaling_enabled - self.is_auto_scaling_for_storage_enabled = is_auto_scaling_for_storage_enabled - self.peer_db_id = peer_db_id - self.is_local_data_guard_enabled = is_local_data_guard_enabled - self.is_mtls_connection_required = is_mtls_connection_required - self.license_model = license_model - self.scheduled_operations = scheduled_operations - self.database_edition = database_edition - self.long_term_backup_schedule = long_term_backup_schedule - self.local_adg_auto_failover_max_data_loss_limit = local_adg_auto_failover_max_data_loss_limit - self.open_mode = open_mode - self.permission_level = permission_level - self.role = role - self.backup_retention_period_in_days = backup_retention_period_in_days - self.whitelisted_ips = whitelisted_ips + super().__init__( + admin_password=admin_password, + autonomous_maintenance_schedule_type=autonomous_maintenance_schedule_type, + character_set=character_set, + compute_count=compute_count, + compute_model=compute_model, + cpu_core_count=cpu_core_count, + customer_contacts=customer_contacts, + data_storage_size_in_tbs=data_storage_size_in_tbs, + data_storage_size_in_gbs=data_storage_size_in_gbs, + db_version=db_version, + db_workload=db_workload, + display_name=display_name, + is_auto_scaling_enabled=is_auto_scaling_enabled, + is_auto_scaling_for_storage_enabled=is_auto_scaling_for_storage_enabled, + peer_db_id=peer_db_id, + is_local_data_guard_enabled=is_local_data_guard_enabled, + is_mtls_connection_required=is_mtls_connection_required, + is_preview_version_with_service_terms_accepted=is_preview_version_with_service_terms_accepted, + license_model=license_model, + ncharacter_set=ncharacter_set, + scheduled_operations=scheduled_operations, + private_endpoint_ip=private_endpoint_ip, + private_endpoint_label=private_endpoint_label, + subnet_id=subnet_id, + vnet_id=vnet_id, + database_edition=database_edition, + autonomous_database_id=autonomous_database_id, + long_term_backup_schedule=long_term_backup_schedule, + local_adg_auto_failover_max_data_loss_limit=local_adg_auto_failover_max_data_loss_limit, + open_mode=open_mode, + permission_level=permission_level, + role=role, + backup_retention_period_in_days=backup_retention_period_in_days, + whitelisted_ips=whitelisted_ips, + **kwargs + ) + self.data_base_type: str = "CloneFromBackupTimestamp" + self.source_id = source_id + self.clone_type = clone_type + self.timestamp = timestamp + self.use_latest_available_backup_time_stamp = use_latest_available_backup_time_stamp -class AutonomousDatabaseWalletFile(_serialization.Model): - """Autonomous Database Wallet File resource model. +class AutonomousDatabaseListResult(_serialization.Model): + """The response of a AutonomousDatabase list operation. All required parameters must be populated in order to send to server. - :ivar wallet_files: The base64 encoded wallet files. Required. - :vartype wallet_files: str + :ivar value: The AutonomousDatabase items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :ivar next_link: The link to the next page of items. + :vartype next_link: str """ _validation = { - "wallet_files": {"required": True}, + "value": {"required": True}, } _attribute_map = { - "wallet_files": {"key": "walletFiles", "type": "str"}, + "value": {"key": "value", "type": "[AutonomousDatabase]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, wallet_files: str, **kwargs: Any) -> None: + def __init__( + self, *, value: List["_models.AutonomousDatabase"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword wallet_files: The base64 encoded wallet files. Required. - :paramtype wallet_files: str + :keyword value: The AutonomousDatabase items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.wallet_files = wallet_files + self.value = value + self.next_link = next_link -class AutonomousDbVersion(ProxyResource): - """AutonomousDbVersion resource definition. +class AutonomousDatabaseNationalCharacterSet(ProxyResource): + """AutonomousDatabaseNationalCharacterSets resource definition. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2894,7 +3110,8 @@ class AutonomousDbVersion(ProxyResource): information. :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties + :vartype properties: + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties """ _validation = { @@ -2909,25 +3126,28 @@ class AutonomousDbVersion(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "AutonomousDbVersionProperties"}, + "properties": {"key": "properties", "type": "AutonomousDatabaseNationalCharacterSetProperties"}, } - def __init__(self, *, properties: Optional["_models.AutonomousDbVersionProperties"] = None, **kwargs: Any) -> None: + def __init__( + self, *, properties: Optional["_models.AutonomousDatabaseNationalCharacterSetProperties"] = None, **kwargs: Any + ) -> None: """ :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties + :paramtype properties: + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSetProperties """ super().__init__(**kwargs) self.properties = properties -class AutonomousDbVersionListResult(_serialization.Model): - """The response of a AutonomousDbVersion list operation. +class AutonomousDatabaseNationalCharacterSetListResult(_serialization.Model): # pylint: disable=name-too-long + """The response of a AutonomousDatabaseNationalCharacterSet list operation. All required parameters must be populated in order to send to server. - :ivar value: The AutonomousDbVersion items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :ivar value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] :ivar next_link: The link to the next page of items. :vartype next_link: str """ @@ -2937,16 +3157,21 @@ class AutonomousDbVersionListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[AutonomousDbVersion]"}, + "value": {"key": "value", "type": "[AutonomousDatabaseNationalCharacterSet]"}, "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, *, value: List["_models.AutonomousDbVersion"], next_link: Optional[str] = None, **kwargs: Any + self, + *, + value: List["_models.AutonomousDatabaseNationalCharacterSet"], + next_link: Optional[str] = None, + **kwargs: Any ) -> None: """ - :keyword value: The AutonomousDbVersion items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :keyword value: The AutonomousDatabaseNationalCharacterSet items on this page. Required. + :paramtype value: + list[~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet] :keyword next_link: The link to the next page of items. :paramtype next_link: str """ @@ -2955,524 +3180,2951 @@ def __init__( self.next_link = next_link -class AutonomousDbVersionProperties(_serialization.Model): - """AutonomousDbVersion resource model. - - 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: Supported Autonomous Db versions. Required. - :vartype version: str - :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", - "AJD", and "APEX". - :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType - :ivar is_default_for_free: True if this version of the Oracle Database software's default is - free. - :vartype is_default_for_free: bool - :ivar is_default_for_paid: True if this version of the Oracle Database software's default is - paid. - :vartype is_default_for_paid: bool - :ivar is_free_tier_enabled: True if this version of the Oracle Database software can be used - for Always-Free Autonomous Databases. - :vartype is_free_tier_enabled: bool - :ivar is_paid_enabled: True if this version of the Oracle Database software has payments - enabled. - :vartype is_paid_enabled: bool - """ - - _validation = { - "version": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "db_workload": {"readonly": True}, - "is_default_for_free": {"readonly": True}, - "is_default_for_paid": {"readonly": True}, - "is_free_tier_enabled": {"readonly": True}, - "is_paid_enabled": {"readonly": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "db_workload": {"key": "dbWorkload", "type": "str"}, - "is_default_for_free": {"key": "isDefaultForFree", "type": "bool"}, - "is_default_for_paid": {"key": "isDefaultForPaid", "type": "bool"}, - "is_free_tier_enabled": {"key": "isFreeTierEnabled", "type": "bool"}, - "is_paid_enabled": {"key": "isPaidEnabled", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.version = None - self.db_workload = None - self.is_default_for_free = None - self.is_default_for_paid = None - self.is_free_tier_enabled = None - self.is_paid_enabled = None - - -class CloudAccountDetails(_serialization.Model): - """Cloud Account Details model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cloud_account_name: Cloud Account name. - :vartype cloud_account_name: str - :ivar cloud_account_home_region: Cloud Account Home region. - :vartype cloud_account_home_region: str - """ - - _validation = { - "cloud_account_name": {"readonly": True}, - "cloud_account_home_region": {"readonly": True}, - } - - _attribute_map = { - "cloud_account_name": {"key": "cloudAccountName", "type": "str"}, - "cloud_account_home_region": {"key": "cloudAccountHomeRegion", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.cloud_account_name = None - self.cloud_account_home_region = None - - -class CloudExadataInfrastructure(TrackedResource): - """CloudExadataInfrastructure resource 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 id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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.oracledatabase.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 resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties - :ivar zones: CloudExadataInfrastructure zones. Required. - :vartype zones: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "zones": {"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": "CloudExadataInfrastructureProperties"}, - "zones": {"key": "zones", "type": "[str]"}, - } - - def __init__( - self, - *, - location: str, - zones: List[str], - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudExadataInfrastructureProperties"] = 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: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties - :keyword zones: CloudExadataInfrastructure zones. Required. - :paramtype zones: list[str] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - self.zones = zones - - -class CloudExadataInfrastructureListResult(_serialization.Model): - """The response of a CloudExadataInfrastructure list operation. +class AutonomousDatabaseNationalCharacterSetProperties(_serialization.Model): # pylint: disable=name-too-long + """AutonomousDatabaseNationalCharacterSet resource model. All required parameters must be populated in order to send to server. - :ivar value: The CloudExadataInfrastructure items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :ivar next_link: The link to the next page of items. - :vartype next_link: str + :ivar character_set: The Oracle Autonomous Database supported national character sets. + Required. + :vartype character_set: str """ _validation = { - "value": {"required": True}, + "character_set": {"required": True, "max_length": 255, "min_length": 1}, } _attribute_map = { - "value": {"key": "value", "type": "[CloudExadataInfrastructure]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "character_set": {"key": "characterSet", "type": "str"}, } - def __init__( - self, *, value: List["_models.CloudExadataInfrastructure"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: + def __init__(self, *, character_set: str, **kwargs: Any) -> None: """ - :keyword value: The CloudExadataInfrastructure items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str + :keyword character_set: The Oracle Autonomous Database supported national character sets. + Required. + :paramtype character_set: str """ super().__init__(**kwargs) - self.value = value - self.next_link = next_link + self.character_set = character_set -class CloudExadataInfrastructureProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """CloudExadataInfrastructure resource model. +class AutonomousDatabaseProperties(AutonomousDatabaseBaseProperties): + """Autonomous Database resource model. 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 ocid: Exadata infra ocid. - :vartype ocid: str - :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. - :vartype compute_count: int - :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. - :vartype storage_count: int - :ivar total_storage_size_in_gbs: The total storage allocated to the cloud Exadata - infrastructure resource, in gigabytes (GB). - :vartype total_storage_size_in_gbs: int - :ivar available_storage_size_in_gbs: The available storage can be allocated to the cloud - Exadata infrastructure resource, in gigabytes (GB). - :vartype available_storage_size_in_gbs: int - :ivar time_created: The date and time the cloud Exadata infrastructure resource was created. - :vartype time_created: str - :ivar lifecycle_details: Additional information about the current lifecycle state. - :vartype lifecycle_details: str - :ivar maintenance_window: maintenanceWindow property. - :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :ivar estimated_patching_time: The estimated total time required in minutes for all patching - operations (database server, storage server, and network switch patching). - :vartype estimated_patching_time: ~azure.mgmt.oracledatabase.models.EstimatedPatchingTime - :ivar customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar data_base_type: Database type to be created. Required. Known values are: "Regular", + "Clone", "CloneFromBackupTimestamp", and "CrossRegionDisasterRecovery". + :vartype data_base_type: str or ~azure.mgmt.oracledatabase.models.DataBaseType + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar character_set: The character set for the autonomous database. + :vartype character_set: str + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" and + "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar provisioning_state: CloudExadataInfrastructure provisioning state. Known values are: - "Succeeded", "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: CloudExadataInfrastructure lifecycle state. Known values are: - "Provisioning", "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", - and "Failed". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureLifecycleState - :ivar shape: The model name of the cloud Exadata infrastructure resource. Required. - :vartype shape: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar cpu_count: The total number of CPU cores allocated. - :vartype cpu_count: int - :ivar max_cpu_count: The total number of CPU cores available. - :vartype max_cpu_count: int - :ivar memory_size_in_gbs: The memory allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar max_memory_in_gbs: The total memory available in GBs. - :vartype max_memory_in_gbs: int - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :vartype db_node_storage_size_in_gbs: int - :ivar max_db_node_storage_size_in_gbs: The total local node storage available in GBs. - :vartype max_db_node_storage_size_in_gbs: int :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. - :vartype data_storage_size_in_tbs: float - :ivar max_data_storage_in_tbs: The total available DATA disk group size. - :vartype max_data_storage_in_tbs: float - :ivar db_server_version: The software version of the database servers (dom0) in the Exadata - infrastructure. - :vartype db_server_version: str - :ivar storage_server_version: The software version of the storage servers (cells) in the - Exadata infrastructure. - :vartype storage_server_version: str - :ivar activated_storage_count: The requested number of additional storage servers activated for - the Exadata infrastructure. - :vartype activated_storage_count: int - :ivar additional_storage_count: The requested number of additional storage servers for the - Exadata infrastructure. - :vartype additional_storage_count: int - :ivar display_name: The name for the Exadata infrastructure. Required. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar db_version: A valid Oracle Database version for Autonomous Database. + :vartype db_version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar display_name: The user-friendly name for the Autonomous Database. :vartype display_name: str - :ivar last_maintenance_run_id: The OCID of the last maintenance run. - :vartype last_maintenance_run_id: str - :ivar next_maintenance_run_id: The OCID of the next maintenance run. - :vartype next_maintenance_run_id: str - :ivar monthly_db_server_version: Monthly Db Server version. - :vartype monthly_db_server_version: str - :ivar monthly_storage_server_version: Monthly Storage Server version. - :vartype monthly_storage_server_version: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_ids: The list of Azure resource IDs of standby databases located in Autonomous + Data Guard remote regions that are associated with the source database. Note that for + Autonomous Database Serverless instances, standby databases located in the same region as the + source primary database do not have Azure IDs. + :vartype peer_db_ids: list[str] + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_remote_data_guard_enabled: Indicates whether the Autonomous Database has Cross Region + Data Guard enabled. + :vartype is_remote_data_guard_enabled: bool + :ivar local_disaster_recovery_type: Indicates the local disaster recovery (DR) type of the + Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business + critical DR with a faster recovery time objective (RTO) during failover or + switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or + switchover. Known values are: "Adg" and "BackupBased". + :vartype local_disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: ~datetime.datetime + :ivar remote_disaster_recovery_configuration: Indicates remote disaster recovery configuration. + :vartype remote_disaster_recovery_configuration: + ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :ivar local_standby_db: Local Autonomous Disaster Recovery standby database details. + :vartype local_standby_db: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseStandbySummary + :ivar failed_data_recovery_in_seconds: Indicates the number of seconds of data loss for a Data + Guard failover. + :vartype failed_data_recovery_in_seconds: int + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :vartype is_preview_version_with_service_terms_accepted: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar ncharacter_set: The character set for the Autonomous Database. + :vartype ncharacter_set: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Views lifecycleState. Known values are: "Provisioning", "Available", + "Stopping", "Stopped", "Starting", "Terminating", "Terminated", "Unavailable", + "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :ivar private_endpoint_ip: The private endpoint Ip address for the resource. + :vartype private_endpoint_ip: str + :ivar private_endpoint_label: The resource's private endpoint label. + :vartype private_endpoint_label: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar subnet_id: Client subnet. + :vartype subnet_id: str + :ivar vnet_id: VNET for network connectivity. + :vartype vnet_id: str + :ivar time_created: The date and time that the database was created. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_begin: The date and time when maintenance will begin. + :vartype time_maintenance_begin: ~datetime.datetime + :ivar time_maintenance_end: The date and time when maintenance will end. + :vartype time_maintenance_end: ~datetime.datetime + :ivar actual_used_data_storage_size_in_tbs: The current amount of storage in use for user and + system data, in terabytes (TB). + :vartype actual_used_data_storage_size_in_tbs: float + :ivar allocated_storage_size_in_tbs: The amount of storage currently allocated for the database + tables and billed for, rounded up. + :vartype allocated_storage_size_in_tbs: float + :ivar apex_details: Information about Oracle APEX Application Development. + :vartype apex_details: ~azure.mgmt.oracledatabase.models.ApexDetailsType + :ivar available_upgrade_versions: List of Oracle Database versions available for a database + upgrade. If there are no version upgrades available, this list is empty. + :vartype available_upgrade_versions: list[str] + :ivar connection_strings: The connection string used to connect to the Autonomous Database. + :vartype connection_strings: ~azure.mgmt.oracledatabase.models.ConnectionStringType + :ivar connection_urls: The URLs for accessing Oracle Application Express (APEX) and SQL + Developer Web with a browser from a Compute instance within your VCN or that has a direct + connection to your VCN. + :vartype connection_urls: ~azure.mgmt.oracledatabase.models.ConnectionUrlType + :ivar data_safe_status: Status of the Data Safe registration for this Autonomous Database. + Known values are: "Registering", "Registered", "Deregistering", "NotRegistered", and "Failed". + :vartype data_safe_status: str or ~azure.mgmt.oracledatabase.models.DataSafeStatusType + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar autonomous_database_id: Autonomous Database ID. + :vartype autonomous_database_id: str + :ivar in_memory_area_in_gbs: The area assigned to In-Memory tables in Autonomous Database. + :vartype in_memory_area_in_gbs: int + :ivar next_long_term_backup_time_stamp: The date and time when the next long-term backup would + be created. + :vartype next_long_term_backup_time_stamp: ~datetime.datetime + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar is_preview: Indicates if the Autonomous Database version is a preview version. + :vartype is_preview: bool + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar memory_per_oracle_compute_unit_in_gbs: The amount of memory (in GBs) enabled per ECPU or + OCPU. + :vartype memory_per_oracle_compute_unit_in_gbs: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar operations_insights_status: Status of Operations Insights for this Autonomous Database. + Known values are: "Enabling", "Enabled", "Disabling", "NotEnabled", "FailedEnabling", and + "FailedDisabling". + :vartype operations_insights_status: str or + ~azure.mgmt.oracledatabase.models.OperationsInsightsStatusType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar private_endpoint: The private endpoint for the resource. + :vartype private_endpoint: str + :ivar provisionable_cpus: An array of CPU values that an Autonomous Database can be scaled to. + :vartype provisionable_cpus: list[int] + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar service_console_url: The URL of the Service Console for the Autonomous Database. + :vartype service_console_url: str + :ivar sql_web_developer_url: The SQL Web Developer URL for the Oracle Autonomous Database. + :vartype sql_web_developer_url: str + :ivar supported_regions_to_clone_to: The list of regions that support the creation of an + Autonomous Database clone or an Autonomous Data Guard standby database. + :vartype supported_regions_to_clone_to: list[str] + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_deletion_of_free_autonomous_database: The date and time the Always Free database + will be automatically deleted because of inactivity. + :vartype time_deletion_of_free_autonomous_database: str + :ivar time_local_data_guard_enabled: The date and time that Autonomous Data Guard was enabled + for an Autonomous Database where the standby was provisioned in the same region as the primary + database. + :vartype time_local_data_guard_enabled: str + :ivar time_of_last_failover: The timestamp of the last failover operation. + :vartype time_of_last_failover: str + :ivar time_of_last_refresh: The date and time when last refresh happened. + :vartype time_of_last_refresh: str + :ivar time_of_last_refresh_point: The refresh point timestamp (UTC). + :vartype time_of_last_refresh_point: str + :ivar time_of_last_switchover: The timestamp of the last switchover operation for the + Autonomous Database. + :vartype time_of_last_switchover: str + :ivar time_reclamation_of_free_autonomous_database: The date and time the Always Free database + will be stopped because of inactivity. + :vartype time_reclamation_of_free_autonomous_database: str + :ivar used_data_storage_size_in_gbs: The storage space consumed by Autonomous Database in GBs. + :vartype used_data_storage_size_in_gbs: int + :ivar used_data_storage_size_in_tbs: The amount of storage that has been used, in terabytes. + :vartype used_data_storage_size_in_tbs: int + :ivar ocid: Database ocid. + :vartype ocid: str + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + """ + + _validation = { + "data_base_type": {"required": True}, + "character_set": {"max_length": 255, "min_length": 1}, + "compute_count": {"maximum": 512, "minimum": 0.1}, + "cpu_core_count": {"maximum": 128, "minimum": 1}, + "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, + "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, + "db_version": {"max_length": 255, "min_length": 1}, + "display_name": {"max_length": 255, "min_length": 1}, + "peer_db_ids": {"readonly": True}, + "peer_db_id": {"max_length": 255, "min_length": 1}, + "is_remote_data_guard_enabled": {"readonly": True}, + "local_disaster_recovery_type": {"readonly": True}, + "time_disaster_recovery_role_changed": {"readonly": True}, + "remote_disaster_recovery_configuration": {"readonly": True}, + "local_standby_db": {"readonly": True}, + "failed_data_recovery_in_seconds": {"readonly": True}, + "ncharacter_set": {"max_length": 255, "min_length": 1}, + "lifecycle_details": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "oci_url": {"readonly": True}, + "time_created": {"readonly": True}, + "time_maintenance_begin": {"readonly": True}, + "time_maintenance_end": {"readonly": True}, + "actual_used_data_storage_size_in_tbs": {"readonly": True}, + "allocated_storage_size_in_tbs": {"readonly": True}, + "apex_details": {"readonly": True}, + "available_upgrade_versions": {"readonly": True}, + "connection_strings": {"readonly": True}, + "connection_urls": {"readonly": True}, + "data_safe_status": {"readonly": True}, + "in_memory_area_in_gbs": {"readonly": True}, + "next_long_term_backup_time_stamp": {"readonly": True}, + "is_preview": {"readonly": True}, + "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, + "memory_per_oracle_compute_unit_in_gbs": {"readonly": True}, + "operations_insights_status": {"readonly": True}, + "private_endpoint": {"readonly": True}, + "provisionable_cpus": {"readonly": True}, + "service_console_url": {"readonly": True, "max_length": 255, "min_length": 10}, + "sql_web_developer_url": {"readonly": True, "max_length": 2048, "min_length": 10}, + "supported_regions_to_clone_to": {"readonly": True, "max_items": 50, "min_items": 0}, + "time_data_guard_role_changed": {"readonly": True}, + "time_deletion_of_free_autonomous_database": {"readonly": True}, + "time_local_data_guard_enabled": {"readonly": True}, + "time_of_last_failover": {"readonly": True}, + "time_of_last_refresh": {"readonly": True}, + "time_of_last_refresh_point": {"readonly": True}, + "time_of_last_switchover": {"readonly": True}, + "time_reclamation_of_free_autonomous_database": {"readonly": True}, + "used_data_storage_size_in_gbs": {"readonly": True}, + "used_data_storage_size_in_tbs": {"readonly": True}, + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "admin_password": {"key": "adminPassword", "type": "str"}, + "data_base_type": {"key": "dataBaseType", "type": "str"}, + "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, + "character_set": {"key": "characterSet", "type": "str"}, + "compute_count": {"key": "computeCount", "type": "float"}, + "compute_model": {"key": "computeModel", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, + "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, + "db_version": {"key": "dbVersion", "type": "str"}, + "db_workload": {"key": "dbWorkload", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, + "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, + "peer_db_ids": {"key": "peerDbIds", "type": "[str]"}, + "peer_db_id": {"key": "peerDbId", "type": "str"}, + "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, + "is_remote_data_guard_enabled": {"key": "isRemoteDataGuardEnabled", "type": "bool"}, + "local_disaster_recovery_type": {"key": "localDisasterRecoveryType", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "iso-8601"}, + "remote_disaster_recovery_configuration": { + "key": "remoteDisasterRecoveryConfiguration", + "type": "DisasterRecoveryConfigurationDetails", + }, + "local_standby_db": {"key": "localStandbyDb", "type": "AutonomousDatabaseStandbySummary"}, + "failed_data_recovery_in_seconds": {"key": "failedDataRecoveryInSeconds", "type": "int"}, + "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, + "is_preview_version_with_service_terms_accepted": { + "key": "isPreviewVersionWithServiceTermsAccepted", + "type": "bool", + }, + "license_model": {"key": "licenseModel", "type": "str"}, + "ncharacter_set": {"key": "ncharacterSet", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsType"}, + "private_endpoint_ip": {"key": "privateEndpointIp", "type": "str"}, + "private_endpoint_label": {"key": "privateEndpointLabel", "type": "str"}, + "oci_url": {"key": "ociUrl", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "vnet_id": {"key": "vnetId", "type": "str"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "time_maintenance_begin": {"key": "timeMaintenanceBegin", "type": "iso-8601"}, + "time_maintenance_end": {"key": "timeMaintenanceEnd", "type": "iso-8601"}, + "actual_used_data_storage_size_in_tbs": {"key": "actualUsedDataStorageSizeInTbs", "type": "float"}, + "allocated_storage_size_in_tbs": {"key": "allocatedStorageSizeInTbs", "type": "float"}, + "apex_details": {"key": "apexDetails", "type": "ApexDetailsType"}, + "available_upgrade_versions": {"key": "availableUpgradeVersions", "type": "[str]"}, + "connection_strings": {"key": "connectionStrings", "type": "ConnectionStringType"}, + "connection_urls": {"key": "connectionUrls", "type": "ConnectionUrlType"}, + "data_safe_status": {"key": "dataSafeStatus", "type": "str"}, + "database_edition": {"key": "databaseEdition", "type": "str"}, + "autonomous_database_id": {"key": "autonomousDatabaseId", "type": "str"}, + "in_memory_area_in_gbs": {"key": "inMemoryAreaInGbs", "type": "int"}, + "next_long_term_backup_time_stamp": {"key": "nextLongTermBackupTimeStamp", "type": "iso-8601"}, + "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, + "memory_per_oracle_compute_unit_in_gbs": {"key": "memoryPerOracleComputeUnitInGbs", "type": "int"}, + "open_mode": {"key": "openMode", "type": "str"}, + "operations_insights_status": {"key": "operationsInsightsStatus", "type": "str"}, + "permission_level": {"key": "permissionLevel", "type": "str"}, + "private_endpoint": {"key": "privateEndpoint", "type": "str"}, + "provisionable_cpus": {"key": "provisionableCpus", "type": "[int]"}, + "role": {"key": "role", "type": "str"}, + "service_console_url": {"key": "serviceConsoleUrl", "type": "str"}, + "sql_web_developer_url": {"key": "sqlWebDeveloperUrl", "type": "str"}, + "supported_regions_to_clone_to": {"key": "supportedRegionsToCloneTo", "type": "[str]"}, + "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, + "time_deletion_of_free_autonomous_database": {"key": "timeDeletionOfFreeAutonomousDatabase", "type": "str"}, + "time_local_data_guard_enabled": {"key": "timeLocalDataGuardEnabled", "type": "str"}, + "time_of_last_failover": {"key": "timeOfLastFailover", "type": "str"}, + "time_of_last_refresh": {"key": "timeOfLastRefresh", "type": "str"}, + "time_of_last_refresh_point": {"key": "timeOfLastRefreshPoint", "type": "str"}, + "time_of_last_switchover": {"key": "timeOfLastSwitchover", "type": "str"}, + "time_reclamation_of_free_autonomous_database": { + "key": "timeReclamationOfFreeAutonomousDatabase", + "type": "str", + }, + "used_data_storage_size_in_gbs": {"key": "usedDataStorageSizeInGbs", "type": "int"}, + "used_data_storage_size_in_tbs": {"key": "usedDataStorageSizeInTbs", "type": "int"}, + "ocid": {"key": "ocid", "type": "str"}, + "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, + "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + character_set: Optional[str] = None, + compute_count: Optional[float] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + db_version: Optional[str] = None, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + is_preview_version_with_service_terms_accepted: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + ncharacter_set: Optional[str] = None, + scheduled_operations: Optional["_models.ScheduledOperationsType"] = None, + private_endpoint_ip: Optional[str] = None, + private_endpoint_label: Optional[str] = None, + subnet_id: Optional[str] = None, + vnet_id: Optional[str] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + autonomous_database_id: Optional[str] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword admin_password: Admin password. + :paramtype admin_password: str + :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :paramtype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :keyword character_set: The character set for the autonomous database. + :paramtype character_set: str + :keyword compute_count: The compute amount (CPUs) available to the database. + :paramtype compute_count: float + :keyword compute_model: The compute model of the Autonomous Database. Known values are: "ECPU" + and "OCPU". + :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :keyword cpu_core_count: The number of CPU cores to be made available to the database. + :paramtype cpu_core_count: int + :keyword customer_contacts: Customer Contacts. + :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :paramtype data_storage_size_in_tbs: int + :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be + created and attached to the database. + :paramtype data_storage_size_in_gbs: int + :keyword db_version: A valid Oracle Database version for Autonomous Database. + :paramtype db_version: str + :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :keyword display_name: The user-friendly name for the Autonomous Database. + :paramtype display_name: str + :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous + Database CPU core count. + :paramtype is_auto_scaling_enabled: bool + :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :paramtype is_auto_scaling_for_storage_enabled: bool + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :paramtype peer_db_id: str + :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :paramtype is_local_data_guard_enabled: bool + :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :paramtype is_mtls_connection_required: bool + :keyword is_preview_version_with_service_terms_accepted: Specifies if the Autonomous Database + preview version is being provisioned. + :paramtype is_preview_version_with_service_terms_accepted: bool + :keyword license_model: The Oracle license model that applies to the Oracle Autonomous + Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and + "BringYourOwnLicense". + :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword ncharacter_set: The character set for the Autonomous Database. + :paramtype ncharacter_set: str + :keyword scheduled_operations: The list of scheduled operations. + :paramtype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsType + :keyword private_endpoint_ip: The private endpoint Ip address for the resource. + :paramtype private_endpoint_ip: str + :keyword private_endpoint_label: The resource's private endpoint label. + :paramtype private_endpoint_label: str + :keyword subnet_id: Client subnet. + :paramtype subnet_id: str + :keyword vnet_id: VNET for network connectivity. + :paramtype vnet_id: str + :keyword database_edition: The Oracle Database Edition that applies to the Autonomous + databases. Known values are: "StandardEdition" and "EnterpriseEdition". + :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :keyword autonomous_database_id: Autonomous Database ID. + :paramtype autonomous_database_id: str + :keyword long_term_backup_schedule: Details for the long-term backup schedule. + :paramtype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :paramtype local_adg_auto_failover_max_data_loss_limit: int + :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :keyword permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, + if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. + :paramtype backup_retention_period_in_days: int + :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :paramtype whitelisted_ips: list[str] + """ + super().__init__( + admin_password=admin_password, + autonomous_maintenance_schedule_type=autonomous_maintenance_schedule_type, + character_set=character_set, + compute_count=compute_count, + compute_model=compute_model, + cpu_core_count=cpu_core_count, + customer_contacts=customer_contacts, + data_storage_size_in_tbs=data_storage_size_in_tbs, + data_storage_size_in_gbs=data_storage_size_in_gbs, + db_version=db_version, + db_workload=db_workload, + display_name=display_name, + is_auto_scaling_enabled=is_auto_scaling_enabled, + is_auto_scaling_for_storage_enabled=is_auto_scaling_for_storage_enabled, + peer_db_id=peer_db_id, + is_local_data_guard_enabled=is_local_data_guard_enabled, + is_mtls_connection_required=is_mtls_connection_required, + is_preview_version_with_service_terms_accepted=is_preview_version_with_service_terms_accepted, + license_model=license_model, + ncharacter_set=ncharacter_set, + scheduled_operations=scheduled_operations, + private_endpoint_ip=private_endpoint_ip, + private_endpoint_label=private_endpoint_label, + subnet_id=subnet_id, + vnet_id=vnet_id, + database_edition=database_edition, + autonomous_database_id=autonomous_database_id, + long_term_backup_schedule=long_term_backup_schedule, + local_adg_auto_failover_max_data_loss_limit=local_adg_auto_failover_max_data_loss_limit, + open_mode=open_mode, + permission_level=permission_level, + role=role, + backup_retention_period_in_days=backup_retention_period_in_days, + whitelisted_ips=whitelisted_ips, + **kwargs + ) + self.data_base_type: str = "Regular" + + +class AutonomousDatabaseStandbySummary(_serialization.Model): + """Autonomous Disaster Recovery standby database details. + + :ivar lag_time_in_seconds: The amount of time, in seconds, that the data of the standby + database lags the data of the primary database. Can be used to determine the potential data + loss in the event of a failover. + :vartype lag_time_in_seconds: int + :ivar lifecycle_state: The current state of the Autonomous Database. Known values are: + "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", + "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the standby Autonomous Database. + :vartype time_data_guard_role_changed: str + :ivar time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :vartype time_disaster_recovery_role_changed: str + """ + + _attribute_map = { + "lag_time_in_seconds": {"key": "lagTimeInSeconds", "type": "int"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "time_data_guard_role_changed": {"key": "timeDataGuardRoleChanged", "type": "str"}, + "time_disaster_recovery_role_changed": {"key": "timeDisasterRecoveryRoleChanged", "type": "str"}, + } + + def __init__( + self, + *, + lag_time_in_seconds: Optional[int] = None, + lifecycle_state: Optional[Union[str, "_models.AutonomousDatabaseLifecycleState"]] = None, + lifecycle_details: Optional[str] = None, + time_data_guard_role_changed: Optional[str] = None, + time_disaster_recovery_role_changed: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword lag_time_in_seconds: The amount of time, in seconds, that the data of the standby + database lags the data of the primary database. Can be used to determine the potential data + loss in the event of a failover. + :paramtype lag_time_in_seconds: int + :keyword lifecycle_state: The current state of the Autonomous Database. Known values are: + "Provisioning", "Available", "Stopping", "Stopped", "Starting", "Terminating", "Terminated", + "Unavailable", "RestoreInProgress", "RestoreFailed", "BackupInProgress", "ScaleInProgress", + "AvailableNeedsAttention", "Updating", "MaintenanceInProgress", "Restarting", "Recreating", + "RoleChangeInProgress", "Upgrading", "Inaccessible", and "Standby". + :paramtype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.AutonomousDatabaseLifecycleState + :keyword lifecycle_details: Additional information about the current lifecycle state. + :paramtype lifecycle_details: str + :keyword time_data_guard_role_changed: The date and time the Autonomous Data Guard role was + switched for the standby Autonomous Database. + :paramtype time_data_guard_role_changed: str + :keyword time_disaster_recovery_role_changed: The date and time the Disaster Recovery role was + switched for the standby Autonomous Database. + :paramtype time_disaster_recovery_role_changed: str + """ + super().__init__(**kwargs) + self.lag_time_in_seconds = lag_time_in_seconds + self.lifecycle_state = lifecycle_state + self.lifecycle_details = lifecycle_details + self.time_data_guard_role_changed = time_data_guard_role_changed + self.time_disaster_recovery_role_changed = time_disaster_recovery_role_changed + + +class AutonomousDatabaseUpdate(_serialization.Model): + """The type used for update operations of the AutonomousDatabase. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "AutonomousDatabaseUpdateProperties"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.AutonomousDatabaseUpdateProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseUpdateProperties + """ + super().__init__(**kwargs) + self.tags = tags + self.properties = properties + + +class AutonomousDatabaseUpdateProperties(_serialization.Model): + """The updatable properties of the AutonomousDatabase. + + :ivar admin_password: Admin password. + :vartype admin_password: str + :ivar autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :vartype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :ivar compute_count: The compute amount (CPUs) available to the database. + :vartype compute_count: float + :ivar cpu_core_count: The number of CPU cores to be made available to the database. + :vartype cpu_core_count: int + :ivar customer_contacts: Customer Contacts. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: int + :ivar data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be created + and attached to the database. + :vartype data_storage_size_in_gbs: int + :ivar display_name: The user-friendly name for the Autonomous Database. + :vartype display_name: str + :ivar is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous Database + CPU core count. + :vartype is_auto_scaling_enabled: bool + :ivar is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :vartype is_auto_scaling_for_storage_enabled: bool + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :vartype peer_db_id: str + :ivar is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :vartype is_local_data_guard_enabled: bool + :ivar is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :vartype is_mtls_connection_required: bool + :ivar license_model: The Oracle license model that applies to the Oracle Autonomous Database. + The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar scheduled_operations: The list of scheduled operations. + :vartype scheduled_operations: ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate + :ivar database_edition: The Oracle Database Edition that applies to the Autonomous databases. + Known values are: "StandardEdition" and "EnterpriseEdition". + :vartype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :ivar long_term_backup_schedule: Details for the long-term backup schedule. + :vartype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :ivar local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :vartype local_adg_auto_failover_max_data_loss_limit: int + :ivar open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :vartype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :ivar permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :vartype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :ivar role: The Data Guard role of the Autonomous Container Database or Autonomous Database, if + Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :vartype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :ivar backup_retention_period_in_days: Retention period, in days, for long-term backups. + :vartype backup_retention_period_in_days: int + :ivar whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :vartype whitelisted_ips: list[str] + """ + + _validation = { + "compute_count": {"maximum": 512, "minimum": 0.1}, + "cpu_core_count": {"maximum": 128, "minimum": 1}, + "data_storage_size_in_tbs": {"maximum": 384, "minimum": 1}, + "data_storage_size_in_gbs": {"maximum": 393216, "minimum": 20}, + "display_name": {"max_length": 255, "min_length": 1}, + "peer_db_id": {"max_length": 255, "min_length": 1}, + "local_adg_auto_failover_max_data_loss_limit": {"maximum": 3600, "minimum": 0}, + } + + _attribute_map = { + "admin_password": {"key": "adminPassword", "type": "str"}, + "autonomous_maintenance_schedule_type": {"key": "autonomousMaintenanceScheduleType", "type": "str"}, + "compute_count": {"key": "computeCount", "type": "float"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "int"}, + "data_storage_size_in_gbs": {"key": "dataStorageSizeInGbs", "type": "int"}, + "display_name": {"key": "displayName", "type": "str"}, + "is_auto_scaling_enabled": {"key": "isAutoScalingEnabled", "type": "bool"}, + "is_auto_scaling_for_storage_enabled": {"key": "isAutoScalingForStorageEnabled", "type": "bool"}, + "peer_db_id": {"key": "peerDbId", "type": "str"}, + "is_local_data_guard_enabled": {"key": "isLocalDataGuardEnabled", "type": "bool"}, + "is_mtls_connection_required": {"key": "isMtlsConnectionRequired", "type": "bool"}, + "license_model": {"key": "licenseModel", "type": "str"}, + "scheduled_operations": {"key": "scheduledOperations", "type": "ScheduledOperationsTypeUpdate"}, + "database_edition": {"key": "databaseEdition", "type": "str"}, + "long_term_backup_schedule": {"key": "longTermBackupSchedule", "type": "LongTermBackUpScheduleDetails"}, + "local_adg_auto_failover_max_data_loss_limit": {"key": "localAdgAutoFailoverMaxDataLossLimit", "type": "int"}, + "open_mode": {"key": "openMode", "type": "str"}, + "permission_level": {"key": "permissionLevel", "type": "str"}, + "role": {"key": "role", "type": "str"}, + "backup_retention_period_in_days": {"key": "backupRetentionPeriodInDays", "type": "int"}, + "whitelisted_ips": {"key": "whitelistedIps", "type": "[str]"}, + } + + def __init__( + self, + *, + admin_password: Optional[str] = None, + autonomous_maintenance_schedule_type: Optional[Union[str, "_models.AutonomousMaintenanceScheduleType"]] = None, + compute_count: Optional[float] = None, + cpu_core_count: Optional[int] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + data_storage_size_in_tbs: Optional[int] = None, + data_storage_size_in_gbs: Optional[int] = None, + display_name: Optional[str] = None, + is_auto_scaling_enabled: Optional[bool] = None, + is_auto_scaling_for_storage_enabled: Optional[bool] = None, + peer_db_id: Optional[str] = None, + is_local_data_guard_enabled: Optional[bool] = None, + is_mtls_connection_required: Optional[bool] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + scheduled_operations: Optional["_models.ScheduledOperationsTypeUpdate"] = None, + database_edition: Optional[Union[str, "_models.DatabaseEditionType"]] = None, + long_term_backup_schedule: Optional["_models.LongTermBackUpScheduleDetails"] = None, + local_adg_auto_failover_max_data_loss_limit: Optional[int] = None, + open_mode: Optional[Union[str, "_models.OpenModeType"]] = None, + permission_level: Optional[Union[str, "_models.PermissionLevelType"]] = None, + role: Optional[Union[str, "_models.RoleType"]] = None, + backup_retention_period_in_days: Optional[int] = None, + whitelisted_ips: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword admin_password: Admin password. + :paramtype admin_password: str + :keyword autonomous_maintenance_schedule_type: The maintenance schedule type of the Autonomous + Database Serverless. Known values are: "Early" and "Regular". + :paramtype autonomous_maintenance_schedule_type: str or + ~azure.mgmt.oracledatabase.models.AutonomousMaintenanceScheduleType + :keyword compute_count: The compute amount (CPUs) available to the database. + :paramtype compute_count: float + :keyword cpu_core_count: The number of CPU cores to be made available to the database. + :paramtype cpu_core_count: int + :keyword customer_contacts: Customer Contacts. + :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :keyword data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :paramtype data_storage_size_in_tbs: int + :keyword data_storage_size_in_gbs: The size, in gigabytes, of the data volume that will be + created and attached to the database. + :paramtype data_storage_size_in_gbs: int + :keyword display_name: The user-friendly name for the Autonomous Database. + :paramtype display_name: str + :keyword is_auto_scaling_enabled: Indicates if auto scaling is enabled for the Autonomous + Database CPU core count. + :paramtype is_auto_scaling_enabled: bool + :keyword is_auto_scaling_for_storage_enabled: Indicates if auto scaling is enabled for the + Autonomous Database storage. + :paramtype is_auto_scaling_for_storage_enabled: bool + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. + :paramtype peer_db_id: str + :keyword is_local_data_guard_enabled: Indicates whether the Autonomous Database has local or + called in-region Data Guard enabled. + :paramtype is_local_data_guard_enabled: bool + :keyword is_mtls_connection_required: Specifies if the Autonomous Database requires mTLS + connections. + :paramtype is_mtls_connection_required: bool + :keyword license_model: The Oracle license model that applies to the Oracle Autonomous + Database. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and + "BringYourOwnLicense". + :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword scheduled_operations: The list of scheduled operations. + :paramtype scheduled_operations: + ~azure.mgmt.oracledatabase.models.ScheduledOperationsTypeUpdate + :keyword database_edition: The Oracle Database Edition that applies to the Autonomous + databases. Known values are: "StandardEdition" and "EnterpriseEdition". + :paramtype database_edition: str or ~azure.mgmt.oracledatabase.models.DatabaseEditionType + :keyword long_term_backup_schedule: Details for the long-term backup schedule. + :paramtype long_term_backup_schedule: + ~azure.mgmt.oracledatabase.models.LongTermBackUpScheduleDetails + :keyword local_adg_auto_failover_max_data_loss_limit: Parameter that allows users to select an + acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered + when necessary for a Local Autonomous Data Guard. + :paramtype local_adg_auto_failover_max_data_loss_limit: int + :keyword open_mode: Indicates the Autonomous Database mode. Known values are: "ReadOnly" and + "ReadWrite". + :paramtype open_mode: str or ~azure.mgmt.oracledatabase.models.OpenModeType + :keyword permission_level: The Autonomous Database permission level. Known values are: + "Restricted" and "Unrestricted". + :paramtype permission_level: str or ~azure.mgmt.oracledatabase.models.PermissionLevelType + :keyword role: The Data Guard role of the Autonomous Container Database or Autonomous Database, + if Autonomous Data Guard is enabled. Known values are: "Primary", "Standby", "DisabledStandby", + "BackupCopy", and "SnapshotStandby". + :paramtype role: str or ~azure.mgmt.oracledatabase.models.RoleType + :keyword backup_retention_period_in_days: Retention period, in days, for long-term backups. + :paramtype backup_retention_period_in_days: int + :keyword whitelisted_ips: The client IP access control list (ACL). This is an array of CIDR + notations and/or IP addresses. Values should be separate strings, separated by commas. Example: + ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + :paramtype whitelisted_ips: list[str] + """ + super().__init__(**kwargs) + self.admin_password = admin_password + self.autonomous_maintenance_schedule_type = autonomous_maintenance_schedule_type + self.compute_count = compute_count + self.cpu_core_count = cpu_core_count + self.customer_contacts = customer_contacts + self.data_storage_size_in_tbs = data_storage_size_in_tbs + self.data_storage_size_in_gbs = data_storage_size_in_gbs + self.display_name = display_name + self.is_auto_scaling_enabled = is_auto_scaling_enabled + self.is_auto_scaling_for_storage_enabled = is_auto_scaling_for_storage_enabled + self.peer_db_id = peer_db_id + self.is_local_data_guard_enabled = is_local_data_guard_enabled + self.is_mtls_connection_required = is_mtls_connection_required + self.license_model = license_model + self.scheduled_operations = scheduled_operations + self.database_edition = database_edition + self.long_term_backup_schedule = long_term_backup_schedule + self.local_adg_auto_failover_max_data_loss_limit = local_adg_auto_failover_max_data_loss_limit + self.open_mode = open_mode + self.permission_level = permission_level + self.role = role + self.backup_retention_period_in_days = backup_retention_period_in_days + self.whitelisted_ips = whitelisted_ips + + +class AutonomousDatabaseWalletFile(_serialization.Model): + """Autonomous Database Wallet File resource model. + + All required parameters must be populated in order to send to server. + + :ivar wallet_files: The base64 encoded wallet files. Required. + :vartype wallet_files: str + """ + + _validation = { + "wallet_files": {"required": True}, + } + + _attribute_map = { + "wallet_files": {"key": "walletFiles", "type": "str"}, + } + + def __init__(self, *, wallet_files: str, **kwargs: Any) -> None: + """ + :keyword wallet_files: The base64 encoded wallet files. Required. + :paramtype wallet_files: str + """ + super().__init__(**kwargs) + self.wallet_files = wallet_files + + +class AutonomousDbVersion(ProxyResource): + """AutonomousDbVersion resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "AutonomousDbVersionProperties"}, + } + + def __init__(self, *, properties: Optional["_models.AutonomousDbVersionProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.AutonomousDbVersionProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class AutonomousDbVersionListResult(_serialization.Model): + """The response of a AutonomousDbVersion list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The AutonomousDbVersion items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AutonomousDbVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.AutonomousDbVersion"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The AutonomousDbVersion items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.AutonomousDbVersion] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AutonomousDbVersionProperties(_serialization.Model): + """AutonomousDbVersion resource model. + + All required parameters must be populated in order to send to server. + + :ivar version: Supported Autonomous Db versions. Required. + :vartype version: str + :ivar db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :vartype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :ivar is_default_for_free: True if this version of the Oracle Database software's default is + free. + :vartype is_default_for_free: bool + :ivar is_default_for_paid: True if this version of the Oracle Database software's default is + paid. + :vartype is_default_for_paid: bool + :ivar is_free_tier_enabled: True if this version of the Oracle Database software can be used + for Always-Free Autonomous Databases. + :vartype is_free_tier_enabled: bool + :ivar is_paid_enabled: True if this version of the Oracle Database software has payments + enabled. + :vartype is_paid_enabled: bool + """ + + _validation = { + "version": {"required": True, "max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "db_workload": {"key": "dbWorkload", "type": "str"}, + "is_default_for_free": {"key": "isDefaultForFree", "type": "bool"}, + "is_default_for_paid": {"key": "isDefaultForPaid", "type": "bool"}, + "is_free_tier_enabled": {"key": "isFreeTierEnabled", "type": "bool"}, + "is_paid_enabled": {"key": "isPaidEnabled", "type": "bool"}, + } + + def __init__( + self, + *, + version: str, + db_workload: Optional[Union[str, "_models.WorkloadType"]] = None, + is_default_for_free: Optional[bool] = None, + is_default_for_paid: Optional[bool] = None, + is_free_tier_enabled: Optional[bool] = None, + is_paid_enabled: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: Supported Autonomous Db versions. Required. + :paramtype version: str + :keyword db_workload: The Autonomous Database workload type. Known values are: "OLTP", "DW", + "AJD", and "APEX". + :paramtype db_workload: str or ~azure.mgmt.oracledatabase.models.WorkloadType + :keyword is_default_for_free: True if this version of the Oracle Database software's default is + free. + :paramtype is_default_for_free: bool + :keyword is_default_for_paid: True if this version of the Oracle Database software's default is + paid. + :paramtype is_default_for_paid: bool + :keyword is_free_tier_enabled: True if this version of the Oracle Database software can be used + for Always-Free Autonomous Databases. + :paramtype is_free_tier_enabled: bool + :keyword is_paid_enabled: True if this version of the Oracle Database software has payments + enabled. + :paramtype is_paid_enabled: bool + """ + super().__init__(**kwargs) + self.version = version + self.db_workload = db_workload + self.is_default_for_free = is_default_for_free + self.is_default_for_paid = is_default_for_paid + self.is_free_tier_enabled = is_free_tier_enabled + self.is_paid_enabled = is_paid_enabled + + +class AzureSubscriptions(_serialization.Model): + """Azure Subscriptions model. + + All required parameters must be populated in order to send to server. + + :ivar azure_subscription_ids: Azure Subscription Ids to be updated. Required. + :vartype azure_subscription_ids: list[str] + """ + + _validation = { + "azure_subscription_ids": {"required": True}, + } + + _attribute_map = { + "azure_subscription_ids": {"key": "azureSubscriptionIds", "type": "[str]"}, + } + + def __init__(self, *, azure_subscription_ids: List[str], **kwargs: Any) -> None: + """ + :keyword azure_subscription_ids: Azure Subscription Ids to be updated. Required. + :paramtype azure_subscription_ids: list[str] + """ + super().__init__(**kwargs) + self.azure_subscription_ids = azure_subscription_ids + + +class CloudAccountDetails(_serialization.Model): + """Cloud Account Details model. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cloud_account_name: Cloud Account name. + :vartype cloud_account_name: str + :ivar cloud_account_home_region: Cloud Account Home region. + :vartype cloud_account_home_region: str + """ + + _validation = { + "cloud_account_name": {"readonly": True}, + "cloud_account_home_region": {"readonly": True}, + } + + _attribute_map = { + "cloud_account_name": {"key": "cloudAccountName", "type": "str"}, + "cloud_account_home_region": {"key": "cloudAccountHomeRegion", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.cloud_account_name: Optional[str] = None + self.cloud_account_home_region: Optional[str] = None + + +class CloudExadataInfrastructure(TrackedResource): + """CloudExadataInfrastructure resource 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 id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.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 resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties + :ivar zones: CloudExadataInfrastructure zones. Required. + :vartype zones: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "zones": {"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": "CloudExadataInfrastructureProperties"}, + "zones": {"key": "zones", "type": "[str]"}, + } + + def __init__( + self, + *, + location: str, + zones: List[str], + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudExadataInfrastructureProperties"] = 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: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureProperties + :keyword zones: CloudExadataInfrastructure zones. Required. + :paramtype zones: list[str] + """ + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + self.zones = zones + + +class CloudExadataInfrastructureListResult(_serialization.Model): + """The response of a CloudExadataInfrastructure list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The CloudExadataInfrastructure items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[CloudExadataInfrastructure]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.CloudExadataInfrastructure"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The CloudExadataInfrastructure items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CloudExadataInfrastructureProperties(_serialization.Model): + """CloudExadataInfrastructure resource model. + + 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 defined_file_system_configuration: Defined file system configurations. + :vartype defined_file_system_configuration: + list[~azure.mgmt.oracledatabase.models.DefinedFileSystemConfiguration] + :ivar ocid: Exadata infra ocid. + :vartype ocid: str + :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. + :vartype compute_count: int + :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. + :vartype storage_count: int + :ivar total_storage_size_in_gbs: The total storage allocated to the cloud Exadata + infrastructure resource, in gigabytes (GB). + :vartype total_storage_size_in_gbs: int + :ivar available_storage_size_in_gbs: The available storage can be allocated to the cloud + Exadata infrastructure resource, in gigabytes (GB). + :vartype available_storage_size_in_gbs: int + :ivar time_created: The date and time the cloud Exadata infrastructure resource was created. + :vartype time_created: str + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar maintenance_window: maintenanceWindow property. + :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :ivar estimated_patching_time: The estimated total time required in minutes for all patching + operations (database server, storage server, and network switch patching). + :vartype estimated_patching_time: ~azure.mgmt.oracledatabase.models.EstimatedPatchingTime + :ivar customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar provisioning_state: CloudExadataInfrastructure provisioning state. Known values are: + "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudExadataInfrastructure lifecycle state. Known values are: + "Provisioning", "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", + and "Failed". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureLifecycleState + :ivar shape: The model name of the cloud Exadata infrastructure resource. Required. + :vartype shape: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar cpu_count: The total number of CPU cores allocated. + :vartype cpu_count: int + :ivar max_cpu_count: The total number of CPU cores available. + :vartype max_cpu_count: int + :ivar memory_size_in_gbs: The memory allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar max_memory_in_gbs: The total memory available in GBs. + :vartype max_memory_in_gbs: int + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar max_db_node_storage_size_in_gbs: The total local node storage available in GBs. + :vartype max_db_node_storage_size_in_gbs: int + :ivar data_storage_size_in_tbs: The quantity of data in the database, in terabytes. + :vartype data_storage_size_in_tbs: float + :ivar max_data_storage_in_tbs: The total available DATA disk group size. + :vartype max_data_storage_in_tbs: float + :ivar db_server_version: The software version of the database servers (dom0) in the Exadata + infrastructure. + :vartype db_server_version: str + :ivar storage_server_version: The software version of the storage servers (cells) in the + Exadata infrastructure. + :vartype storage_server_version: str + :ivar activated_storage_count: The requested number of additional storage servers activated for + the Exadata infrastructure. + :vartype activated_storage_count: int + :ivar additional_storage_count: The requested number of additional storage servers for the + Exadata infrastructure. + :vartype additional_storage_count: int + :ivar display_name: The name for the Exadata infrastructure. Required. + :vartype display_name: str + :ivar last_maintenance_run_id: The OCID of the last maintenance run. + :vartype last_maintenance_run_id: str + :ivar next_maintenance_run_id: The OCID of the next maintenance run. + :vartype next_maintenance_run_id: str + :ivar monthly_db_server_version: Monthly Db Server version. + :vartype monthly_db_server_version: str + :ivar monthly_storage_server_version: Monthly Storage Server version. + :vartype monthly_storage_server_version: str + :ivar database_server_type: The database server model type of the cloud Exadata infrastructure + resource. + :vartype database_server_type: str + :ivar storage_server_type: The storage server model type of the cloud Exadata infrastructure + resource. + :vartype storage_server_type: str + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + """ + + _validation = { + "defined_file_system_configuration": {"readonly": True}, + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "total_storage_size_in_gbs": {"readonly": True}, + "available_storage_size_in_gbs": {"readonly": True}, + "time_created": {"readonly": True}, + "lifecycle_details": {"readonly": True}, + "estimated_patching_time": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "shape": {"required": True}, + "oci_url": {"readonly": True}, + "cpu_count": {"readonly": True}, + "max_cpu_count": {"readonly": True}, + "memory_size_in_gbs": {"readonly": True}, + "max_memory_in_gbs": {"readonly": True}, + "db_node_storage_size_in_gbs": {"readonly": True}, + "max_db_node_storage_size_in_gbs": {"readonly": True}, + "data_storage_size_in_tbs": {"readonly": True}, + "max_data_storage_in_tbs": {"readonly": True}, + "db_server_version": {"readonly": True}, + "storage_server_version": {"readonly": True}, + "activated_storage_count": {"readonly": True}, + "additional_storage_count": {"readonly": True}, + "display_name": {"required": True, "max_length": 255, "min_length": 1}, + "last_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "next_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "monthly_db_server_version": {"readonly": True}, + "monthly_storage_server_version": {"readonly": True}, + "database_server_type": {"max_length": 255, "min_length": 1}, + "storage_server_type": {"max_length": 255, "min_length": 1}, + "compute_model": {"readonly": True}, + } + + _attribute_map = { + "defined_file_system_configuration": { + "key": "definedFileSystemConfiguration", + "type": "[DefinedFileSystemConfiguration]", + }, + "ocid": {"key": "ocid", "type": "str"}, + "compute_count": {"key": "computeCount", "type": "int"}, + "storage_count": {"key": "storageCount", "type": "int"}, + "total_storage_size_in_gbs": {"key": "totalStorageSizeInGbs", "type": "int"}, + "available_storage_size_in_gbs": {"key": "availableStorageSizeInGbs", "type": "int"}, + "time_created": {"key": "timeCreated", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, + "estimated_patching_time": {"key": "estimatedPatchingTime", "type": "EstimatedPatchingTime"}, + "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "shape": {"key": "shape", "type": "str"}, + "oci_url": {"key": "ociUrl", "type": "str"}, + "cpu_count": {"key": "cpuCount", "type": "int"}, + "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, + "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, + "max_db_node_storage_size_in_gbs": {"key": "maxDbNodeStorageSizeInGbs", "type": "int"}, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, + "max_data_storage_in_tbs": {"key": "maxDataStorageInTbs", "type": "float"}, + "db_server_version": {"key": "dbServerVersion", "type": "str"}, + "storage_server_version": {"key": "storageServerVersion", "type": "str"}, + "activated_storage_count": {"key": "activatedStorageCount", "type": "int"}, + "additional_storage_count": {"key": "additionalStorageCount", "type": "int"}, + "display_name": {"key": "displayName", "type": "str"}, + "last_maintenance_run_id": {"key": "lastMaintenanceRunId", "type": "str"}, + "next_maintenance_run_id": {"key": "nextMaintenanceRunId", "type": "str"}, + "monthly_db_server_version": {"key": "monthlyDbServerVersion", "type": "str"}, + "monthly_storage_server_version": {"key": "monthlyStorageServerVersion", "type": "str"}, + "database_server_type": {"key": "databaseServerType", "type": "str"}, + "storage_server_type": {"key": "storageServerType", "type": "str"}, + "compute_model": {"key": "computeModel", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + shape: str, + display_name: str, + compute_count: Optional[int] = None, + storage_count: Optional[int] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + database_server_type: Optional[str] = None, + storage_server_type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. + :paramtype compute_count: int + :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. + :paramtype storage_count: int + :keyword maintenance_window: maintenanceWindow property. + :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :keyword customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :keyword shape: The model name of the cloud Exadata infrastructure resource. Required. + :paramtype shape: str + :keyword display_name: The name for the Exadata infrastructure. Required. + :paramtype display_name: str + :keyword database_server_type: The database server model type of the cloud Exadata + infrastructure resource. + :paramtype database_server_type: str + :keyword storage_server_type: The storage server model type of the cloud Exadata infrastructure + resource. + :paramtype storage_server_type: str + """ + super().__init__(**kwargs) + self.defined_file_system_configuration: Optional[List["_models.DefinedFileSystemConfiguration"]] = None + self.ocid: Optional[str] = None + self.compute_count = compute_count + self.storage_count = storage_count + self.total_storage_size_in_gbs: Optional[int] = None + self.available_storage_size_in_gbs: Optional[int] = None + self.time_created: Optional[str] = None + self.lifecycle_details: Optional[str] = None + self.maintenance_window = maintenance_window + self.estimated_patching_time: Optional["_models.EstimatedPatchingTime"] = None + self.customer_contacts = customer_contacts + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.CloudExadataInfrastructureLifecycleState"]] = None + self.shape = shape + self.oci_url: Optional[str] = None + self.cpu_count: Optional[int] = None + self.max_cpu_count: Optional[int] = None + self.memory_size_in_gbs: Optional[int] = None + self.max_memory_in_gbs: Optional[int] = None + self.db_node_storage_size_in_gbs: Optional[int] = None + self.max_db_node_storage_size_in_gbs: Optional[int] = None + self.data_storage_size_in_tbs: Optional[float] = None + self.max_data_storage_in_tbs: Optional[float] = None + self.db_server_version: Optional[str] = None + self.storage_server_version: Optional[str] = None + self.activated_storage_count: Optional[int] = None + self.additional_storage_count: Optional[int] = None + self.display_name = display_name + self.last_maintenance_run_id: Optional[str] = None + self.next_maintenance_run_id: Optional[str] = None + self.monthly_db_server_version: Optional[str] = None + self.monthly_storage_server_version: Optional[str] = None + self.database_server_type = database_server_type + self.storage_server_type = storage_server_type + self.compute_model: Optional[Union[str, "_models.ComputeModel"]] = None + + +class CloudExadataInfrastructureUpdate(_serialization.Model): + """The type used for update operations of the CloudExadataInfrastructure. + + :ivar zones: CloudExadataInfrastructure zones. + :vartype zones: list[str] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties + """ + + _attribute_map = { + "zones": {"key": "zones", "type": "[str]"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "CloudExadataInfrastructureUpdateProperties"}, + } + + def __init__( + self, + *, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudExadataInfrastructureUpdateProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword zones: CloudExadataInfrastructure zones. + :paramtype zones: list[str] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: + ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties + """ + super().__init__(**kwargs) + self.zones = zones + self.tags = tags + self.properties = properties + + +class CloudExadataInfrastructureUpdateProperties(_serialization.Model): # pylint: disable=name-too-long + """The updatable properties of the CloudExadataInfrastructure. + + :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. + :vartype compute_count: int + :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. + :vartype storage_count: int + :ivar maintenance_window: maintenanceWindow property. + :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :ivar customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :ivar display_name: The name for the Exadata infrastructure. + :vartype display_name: str + """ + + _validation = { + "display_name": {"max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "compute_count": {"key": "computeCount", "type": "int"}, + "storage_count": {"key": "storageCount", "type": "int"}, + "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, + "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( + self, + *, + compute_count: Optional[int] = None, + storage_count: Optional[int] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + customer_contacts: Optional[List["_models.CustomerContact"]] = None, + display_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. + :paramtype compute_count: int + :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. + :paramtype storage_count: int + :keyword maintenance_window: maintenanceWindow property. + :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow + :keyword customer_contacts: The list of customer email addresses that receive information from + Oracle about the specified OCI Database service resource. Oracle uses these email addresses to + send notifications about planned and unplanned software maintenance updates, information about + system hardware, and other information needed by administrators. Up to 10 email addresses can + be added to the customer contacts for a cloud Exadata infrastructure instance. + :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] + :keyword display_name: The name for the Exadata infrastructure. + :paramtype display_name: str + """ + super().__init__(**kwargs) + self.compute_count = compute_count + self.storage_count = storage_count + self.maintenance_window = maintenance_window + self.customer_contacts = customer_contacts + self.display_name = display_name + + +class CloudVmCluster(TrackedResource): + """CloudVmCluster resource 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 id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.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 resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties + """ + + _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": "CloudVmClusterProperties"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudVmClusterProperties"] = 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: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties + """ + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + + +class CloudVmClusterListResult(_serialization.Model): + """The response of a CloudVmCluster list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The CloudVmCluster items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[CloudVmCluster]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.CloudVmCluster"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The CloudVmCluster items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class CloudVmClusterProperties(_serialization.Model): + """CloudVmCluster resource model. + + 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 ocid: Cloud VM Cluster ocid. + :vartype ocid: str + :ivar listener_port: The port number configured for the listener on the cloud VM cluster. + :vartype listener_port: int + :ivar node_count: The number of nodes in the cloud VM cluster. + :vartype node_count: int + :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :vartype storage_size_in_gbs: int + :ivar file_system_configuration_details: Array of mount path and size. + :vartype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :vartype data_storage_size_in_tbs: float + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar memory_size_in_gbs: The memory to be allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar time_created: The date and time that the cloud VM cluster was created. + :vartype time_created: ~datetime.datetime + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar time_zone: The time zone of the cloud VM cluster. For details, see `Exadata + Infrastructure Time Zones `_. + :vartype time_zone: str + :ivar zone_id: The OCID of the zone the cloud VM cluster is associated with. + :vartype zone_id: str + :ivar hostname: The hostname for the cloud VM cluster. Required. + :vartype hostname: str + :ivar domain: The domain name for the cloud VM cluster. + :vartype domain: str + :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. + :vartype cpu_core_count: int + :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :vartype ocpu_count: float + :ivar cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with an + alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The + cluster name can be no longer than 11 characters and is not case sensitive. + :vartype cluster_name: str + :ivar data_storage_percentage: The percentage assigned to DATA storage (user data and database + files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, + and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent + assigned to DATA storage. See `Storage Configuration + `_ in the Exadata documentation for details + on the impact of the configuration settings on storage. + :vartype data_storage_percentage: int + :ivar is_local_backup_enabled: If true, database backup on local Exadata storage is configured + for the cloud VM cluster. If false, database backup on local Exadata storage is not available + in the cloud VM cluster. + :vartype is_local_backup_enabled: bool + :ivar cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. + :vartype cloud_exadata_infrastructure_id: str + :ivar is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM + cluster. If false, sparse disk group is not created. + :vartype is_sparse_diskgroup_enabled: bool + :ivar system_version: Operating system version of the image. + :vartype system_version: str + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the cloud VM cluster. Required. + :vartype ssh_public_keys: list[str] + :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default + is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar disk_redundancy: The type of redundancy configured for the cloud Vm cluster. NORMAL is + 2-way redundancy. HIGH is 3-way redundancy. Known values are: "High" and "Normal". + :vartype disk_redundancy: str or ~azure.mgmt.oracledatabase.models.DiskRedundancy + :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the cloud + VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any + interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. + **Note:** For a single-node DB system, this list is empty. + :vartype scan_ip_ids: list[str] + :ivar vip_ids: The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster + Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud + Service instance to enable failover. If one node fails, the VIP is reassigned to another active + node in the cluster. **Note:** For a single-node DB system, this list is empty. + :vartype vip_ids: list[str] + :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated + with the cloud VM cluster. + :vartype scan_dns_name: str + :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port + is 1521. + :vartype scan_listener_port_tcp: int + :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default + port is 2484. + :vartype scan_listener_port_tcp_ssl: int + :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are + associated with the cloud VM cluster. + :vartype scan_dns_record_id: str + :ivar shape: The model name of the Exadata hardware running the cloud VM cluster. + :vartype shape: str + :ivar provisioning_state: CloudVmCluster provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", + "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.CloudVmClusterLifecycleState + :ivar vnet_id: VNET for network connectivity. Required. + :vartype vnet_id: str + :ivar gi_version: Oracle Grid Infrastructure (GI) software version. Required. + :vartype gi_version: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure + Interface. + :vartype nsg_url: str + :ivar subnet_id: Client subnet. Required. + :vartype subnet_id: str + :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :vartype backup_subnet_cidr: str + :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision + the VM Cluster will be added by default. + :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. Required. + :vartype display_name: str + :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :vartype compute_nodes: list[str] + :ivar iorm_config_cache: iormConfigCache details for cloud VM cluster. + :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig + :ivar last_update_history_entry_id: The OCID of the last maintenance update history entry. + :vartype last_update_history_entry_id: str + :ivar db_servers: The list of DB servers. + :vartype db_servers: list[str] + :ivar compartment_id: Cluster compartmentId. + :vartype compartment_id: str + :ivar subnet_ocid: Cluster subnet ocid. + :vartype subnet_ocid: str + :ivar compute_model: The compute model of the VM Cluster. Known values are: "ECPU" and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + """ + + _validation = { + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "listener_port": {"readonly": True}, + "node_count": {"readonly": True}, + "time_created": {"readonly": True}, + "lifecycle_details": {"readonly": True}, + "time_zone": {"max_length": 255, "min_length": 1}, + "zone_id": {"max_length": 255, "min_length": 1}, + "hostname": {"required": True, "max_length": 23, "min_length": 1}, + "cpu_core_count": {"required": True}, + "cluster_name": {"max_length": 11, "min_length": 1}, + "cloud_exadata_infrastructure_id": {"required": True}, + "system_version": {"max_length": 255, "min_length": 1}, + "ssh_public_keys": {"required": True}, + "disk_redundancy": {"readonly": True}, + "scan_ip_ids": {"readonly": True}, + "vip_ids": {"readonly": True}, + "scan_dns_name": {"readonly": True, "max_length": 72, "min_length": 1}, + "scan_dns_record_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "shape": {"readonly": True, "max_length": 255, "min_length": 1}, + "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "vnet_id": {"required": True}, + "gi_version": {"required": True}, + "oci_url": {"readonly": True}, + "nsg_url": {"readonly": True}, + "subnet_id": {"required": True}, + "backup_subnet_cidr": {"max_length": 32, "min_length": 1}, + "display_name": {"required": True, "max_length": 255, "min_length": 1}, + "iorm_config_cache": {"readonly": True}, + "last_update_history_entry_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "subnet_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "compute_model": {"readonly": True}, + } + + _attribute_map = { + "ocid": {"key": "ocid", "type": "str"}, + "listener_port": {"key": "listenerPort", "type": "int"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, + "file_system_configuration_details": { + "key": "fileSystemConfigurationDetails", + "type": "[FileSystemConfigurationDetails]", + }, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, + "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "zone_id": {"key": "zoneId", "type": "str"}, + "hostname": {"key": "hostname", "type": "str"}, + "domain": {"key": "domain", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "ocpu_count": {"key": "ocpuCount", "type": "float"}, + "cluster_name": {"key": "clusterName", "type": "str"}, + "data_storage_percentage": {"key": "dataStoragePercentage", "type": "int"}, + "is_local_backup_enabled": {"key": "isLocalBackupEnabled", "type": "bool"}, + "cloud_exadata_infrastructure_id": {"key": "cloudExadataInfrastructureId", "type": "str"}, + "is_sparse_diskgroup_enabled": {"key": "isSparseDiskgroupEnabled", "type": "bool"}, + "system_version": {"key": "systemVersion", "type": "str"}, + "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, + "license_model": {"key": "licenseModel", "type": "str"}, + "disk_redundancy": {"key": "diskRedundancy", "type": "str"}, + "scan_ip_ids": {"key": "scanIpIds", "type": "[str]"}, + "vip_ids": {"key": "vipIds", "type": "[str]"}, + "scan_dns_name": {"key": "scanDnsName", "type": "str"}, + "scan_listener_port_tcp": {"key": "scanListenerPortTcp", "type": "int"}, + "scan_listener_port_tcp_ssl": {"key": "scanListenerPortTcpSsl", "type": "int"}, + "scan_dns_record_id": {"key": "scanDnsRecordId", "type": "str"}, + "shape": {"key": "shape", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "vnet_id": {"key": "vnetId", "type": "str"}, + "gi_version": {"key": "giVersion", "type": "str"}, + "oci_url": {"key": "ociUrl", "type": "str"}, + "nsg_url": {"key": "nsgUrl", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "backup_subnet_cidr": {"key": "backupSubnetCidr", "type": "str"}, + "nsg_cidrs": {"key": "nsgCidrs", "type": "[NsgCidr]"}, + "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, + "display_name": {"key": "displayName", "type": "str"}, + "compute_nodes": {"key": "computeNodes", "type": "[str]"}, + "iorm_config_cache": {"key": "iormConfigCache", "type": "ExadataIormConfig"}, + "last_update_history_entry_id": {"key": "lastUpdateHistoryEntryId", "type": "str"}, + "db_servers": {"key": "dbServers", "type": "[str]"}, + "compartment_id": {"key": "compartmentId", "type": "str"}, + "subnet_ocid": {"key": "subnetOcid", "type": "str"}, + "compute_model": {"key": "computeModel", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + hostname: str, + cpu_core_count: int, + cloud_exadata_infrastructure_id: str, + ssh_public_keys: List[str], + vnet_id: str, + gi_version: str, + subnet_id: str, + display_name: str, + storage_size_in_gbs: Optional[int] = None, + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = None, + data_storage_size_in_tbs: Optional[float] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + memory_size_in_gbs: Optional[int] = None, + time_zone: Optional[str] = None, + zone_id: Optional[str] = None, + domain: Optional[str] = None, + ocpu_count: Optional[float] = None, + cluster_name: Optional[str] = None, + data_storage_percentage: Optional[int] = None, + is_local_backup_enabled: bool = False, + is_sparse_diskgroup_enabled: bool = False, + system_version: Optional[str] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + scan_listener_port_tcp: Optional[int] = None, + scan_listener_port_tcp_ssl: Optional[int] = None, + backup_subnet_cidr: Optional[str] = None, + nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + compute_nodes: Optional[List[str]] = None, + db_servers: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :paramtype storage_size_in_gbs: int + :keyword file_system_configuration_details: Array of mount path and size. + :paramtype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :paramtype data_storage_size_in_tbs: float + :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :paramtype db_node_storage_size_in_gbs: int + :keyword memory_size_in_gbs: The memory to be allocated in GBs. + :paramtype memory_size_in_gbs: int + :keyword time_zone: The time zone of the cloud VM cluster. For details, see `Exadata + Infrastructure Time Zones `_. + :paramtype time_zone: str + :keyword zone_id: The OCID of the zone the cloud VM cluster is associated with. + :paramtype zone_id: str + :keyword hostname: The hostname for the cloud VM cluster. Required. + :paramtype hostname: str + :keyword domain: The domain name for the cloud VM cluster. + :paramtype domain: str + :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. + :paramtype cpu_core_count: int + :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :paramtype ocpu_count: float + :keyword cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with + an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The + cluster name can be no longer than 11 characters and is not case sensitive. + :paramtype cluster_name: str + :keyword data_storage_percentage: The percentage assigned to DATA storage (user data and + database files). The remaining percentage is assigned to RECO storage (database redo logs, + archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default + is 80 percent assigned to DATA storage. See `Storage Configuration + `_ in the Exadata documentation for details + on the impact of the configuration settings on storage. + :paramtype data_storage_percentage: int + :keyword is_local_backup_enabled: If true, database backup on local Exadata storage is + configured for the cloud VM cluster. If false, database backup on local Exadata storage is not + available in the cloud VM cluster. + :paramtype is_local_backup_enabled: bool + :keyword cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. + :paramtype cloud_exadata_infrastructure_id: str + :keyword is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM + cluster. If false, sparse disk group is not created. + :paramtype is_sparse_diskgroup_enabled: bool + :keyword system_version: Operating system version of the image. + :paramtype system_version: str + :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access + to the cloud VM cluster. Required. + :paramtype ssh_public_keys: list[str] + :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The + default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default + port is 1521. + :paramtype scan_listener_port_tcp: int + :keyword scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The + default port is 2484. + :paramtype scan_listener_port_tcp_ssl: int + :keyword vnet_id: VNET for network connectivity. Required. + :paramtype vnet_id: str + :keyword gi_version: Oracle Grid Infrastructure (GI) software version. Required. + :paramtype gi_version: str + :keyword subnet_id: Client subnet. Required. + :paramtype subnet_id: str + :keyword backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :paramtype backup_subnet_cidr: str + :keyword nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to + provision the VM Cluster will be added by default. + :paramtype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :keyword data_collection_options: Indicates user preferences for the various diagnostic + collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :keyword display_name: Display Name. Required. + :paramtype display_name: str + :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :paramtype compute_nodes: list[str] + :keyword db_servers: The list of DB servers. + :paramtype db_servers: list[str] + """ + super().__init__(**kwargs) + self.ocid: Optional[str] = None + self.listener_port: Optional[int] = None + self.node_count: Optional[int] = None + self.storage_size_in_gbs = storage_size_in_gbs + self.file_system_configuration_details = file_system_configuration_details + self.data_storage_size_in_tbs = data_storage_size_in_tbs + self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs + self.memory_size_in_gbs = memory_size_in_gbs + self.time_created: Optional[datetime.datetime] = None + self.lifecycle_details: Optional[str] = None + self.time_zone = time_zone + self.zone_id = zone_id + self.hostname = hostname + self.domain = domain + self.cpu_core_count = cpu_core_count + self.ocpu_count = ocpu_count + self.cluster_name = cluster_name + self.data_storage_percentage = data_storage_percentage + self.is_local_backup_enabled = is_local_backup_enabled + self.cloud_exadata_infrastructure_id = cloud_exadata_infrastructure_id + self.is_sparse_diskgroup_enabled = is_sparse_diskgroup_enabled + self.system_version = system_version + self.ssh_public_keys = ssh_public_keys + self.license_model = license_model + self.disk_redundancy: Optional[Union[str, "_models.DiskRedundancy"]] = None + self.scan_ip_ids: Optional[List[str]] = None + self.vip_ids: Optional[List[str]] = None + self.scan_dns_name: Optional[str] = None + self.scan_listener_port_tcp = scan_listener_port_tcp + self.scan_listener_port_tcp_ssl = scan_listener_port_tcp_ssl + self.scan_dns_record_id: Optional[str] = None + self.shape: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.CloudVmClusterLifecycleState"]] = None + self.vnet_id = vnet_id + self.gi_version = gi_version + self.oci_url: Optional[str] = None + self.nsg_url: Optional[str] = None + self.subnet_id = subnet_id + self.backup_subnet_cidr = backup_subnet_cidr + self.nsg_cidrs = nsg_cidrs + self.data_collection_options = data_collection_options + self.display_name = display_name + self.compute_nodes = compute_nodes + self.iorm_config_cache: Optional["_models.ExadataIormConfig"] = None + self.last_update_history_entry_id: Optional[str] = None + self.db_servers = db_servers + self.compartment_id: Optional[str] = None + self.subnet_ocid: Optional[str] = None + self.compute_model: Optional[Union[str, "_models.ComputeModel"]] = None + + +class CloudVmClusterUpdate(_serialization.Model): + """The type used for update operations of the CloudVmCluster. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "CloudVmClusterUpdateProperties"}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.CloudVmClusterUpdateProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties + """ + super().__init__(**kwargs) + self.tags = tags + self.properties = properties + + +class CloudVmClusterUpdateProperties(_serialization.Model): + """The updatable properties of the CloudVmCluster. + + :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :vartype storage_size_in_gbs: int + :ivar file_system_configuration_details: Array of mount path and size. + :vartype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :vartype data_storage_size_in_tbs: float + :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :vartype db_node_storage_size_in_gbs: int + :ivar memory_size_in_gbs: The memory to be allocated in GBs. + :vartype memory_size_in_gbs: int + :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. + :vartype cpu_core_count: int + :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :vartype ocpu_count: float + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the cloud VM cluster. + :vartype ssh_public_keys: list[str] + :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default + is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. + :vartype display_name: str + :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :vartype compute_nodes: list[str] + """ + + _validation = { + "display_name": {"max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, + "file_system_configuration_details": { + "key": "fileSystemConfigurationDetails", + "type": "[FileSystemConfigurationDetails]", + }, + "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, + "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "ocpu_count": {"key": "ocpuCount", "type": "float"}, + "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, + "license_model": {"key": "licenseModel", "type": "str"}, + "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, + "display_name": {"key": "displayName", "type": "str"}, + "compute_nodes": {"key": "computeNodes", "type": "[str]"}, + } + + def __init__( + self, + *, + storage_size_in_gbs: Optional[int] = None, + file_system_configuration_details: Optional[List["_models.FileSystemConfigurationDetails"]] = None, + data_storage_size_in_tbs: Optional[float] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + memory_size_in_gbs: Optional[int] = None, + cpu_core_count: Optional[int] = None, + ocpu_count: Optional[float] = None, + ssh_public_keys: Optional[List[str]] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + display_name: Optional[str] = None, + compute_nodes: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. + :paramtype storage_size_in_gbs: int + :keyword file_system_configuration_details: Array of mount path and size. + :paramtype file_system_configuration_details: + list[~azure.mgmt.oracledatabase.models.FileSystemConfigurationDetails] + :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. + :paramtype data_storage_size_in_tbs: float + :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :paramtype db_node_storage_size_in_gbs: int + :keyword memory_size_in_gbs: The memory to be allocated in GBs. + :paramtype memory_size_in_gbs: int + :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. + :paramtype cpu_core_count: int + :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal + place is allowed for the fractional part. + :paramtype ocpu_count: float + :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access + to the cloud VM cluster. + :paramtype ssh_public_keys: list[str] + :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The + default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". + :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword data_collection_options: Indicates user preferences for the various diagnostic + collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :keyword display_name: Display Name. + :paramtype display_name: str + :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. + :paramtype compute_nodes: list[str] + """ + super().__init__(**kwargs) + self.storage_size_in_gbs = storage_size_in_gbs + self.file_system_configuration_details = file_system_configuration_details + self.data_storage_size_in_tbs = data_storage_size_in_tbs + self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs + self.memory_size_in_gbs = memory_size_in_gbs + self.cpu_core_count = cpu_core_count + self.ocpu_count = ocpu_count + self.ssh_public_keys = ssh_public_keys + self.license_model = license_model + self.data_collection_options = data_collection_options + self.display_name = display_name + self.compute_nodes = compute_nodes + + +class ConnectionStringType(_serialization.Model): + """Connection strings to connect to an Oracle Autonomous Database. + + :ivar all_connection_strings: Returns all connection strings that can be used to connect to the + Autonomous Database. + :vartype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType + :ivar dedicated: The database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :vartype dedicated: str + :ivar high: The High database service provides the highest level of resources to each SQL + statement resulting in the highest performance, but supports the fewest number of concurrent + SQL statements. + :vartype high: str + :ivar low: The Low database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :vartype low: str + :ivar medium: The Medium database service provides a lower level of resources to each SQL + statement potentially resulting a lower level of performance, but supports more concurrent SQL + statements. + :vartype medium: str + :ivar profiles: A list of connection string profiles to allow clients to group, filter and + select connection string values based on structured metadata. + :vartype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] + """ + + _validation = { + "dedicated": {"max_length": 255, "min_length": 10}, + "high": {"max_length": 255, "min_length": 10}, + "low": {"max_length": 255, "min_length": 10}, + "medium": {"max_length": 255, "min_length": 10}, + } + + _attribute_map = { + "all_connection_strings": {"key": "allConnectionStrings", "type": "AllConnectionStringType"}, + "dedicated": {"key": "dedicated", "type": "str"}, + "high": {"key": "high", "type": "str"}, + "low": {"key": "low", "type": "str"}, + "medium": {"key": "medium", "type": "str"}, + "profiles": {"key": "profiles", "type": "[ProfileType]"}, + } + + def __init__( + self, + *, + all_connection_strings: Optional["_models.AllConnectionStringType"] = None, + dedicated: Optional[str] = None, + high: Optional[str] = None, + low: Optional[str] = None, + medium: Optional[str] = None, + profiles: Optional[List["_models.ProfileType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword all_connection_strings: Returns all connection strings that can be used to connect to + the Autonomous Database. + :paramtype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType + :keyword dedicated: The database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :paramtype dedicated: str + :keyword high: The High database service provides the highest level of resources to each SQL + statement resulting in the highest performance, but supports the fewest number of concurrent + SQL statements. + :paramtype high: str + :keyword low: The Low database service provides the least level of resources to each SQL + statement, but supports the most number of concurrent SQL statements. + :paramtype low: str + :keyword medium: The Medium database service provides a lower level of resources to each SQL + statement potentially resulting a lower level of performance, but supports more concurrent SQL + statements. + :paramtype medium: str + :keyword profiles: A list of connection string profiles to allow clients to group, filter and + select connection string values based on structured metadata. + :paramtype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] + """ + super().__init__(**kwargs) + self.all_connection_strings = all_connection_strings + self.dedicated = dedicated + self.high = high + self.low = low + self.medium = medium + self.profiles = profiles + + +class ConnectionUrlType(_serialization.Model): + """The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser + from a Compute instance within your VCN or that has a direct connection to your VCN. + + :ivar apex_url: Oracle Application Express (APEX) URL. + :vartype apex_url: str + :ivar database_transforms_url: The URL of the Database Transforms for the Autonomous Database. + :vartype database_transforms_url: str + :ivar graph_studio_url: The URL of the Graph Studio for the Autonomous Database. + :vartype graph_studio_url: str + :ivar machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook for + the Autonomous Database. + :vartype machine_learning_notebook_url: str + :ivar mongo_db_url: The URL of the MongoDB API for the Autonomous Database. + :vartype mongo_db_url: str + :ivar ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous + Database. + :vartype ords_url: str + :ivar sql_dev_web_url: Oracle SQL Developer Web URL. + :vartype sql_dev_web_url: str + """ + + _validation = { + "apex_url": {"max_length": 512, "min_length": 10}, + "database_transforms_url": {"max_length": 512, "min_length": 10}, + "graph_studio_url": {"max_length": 512, "min_length": 10}, + "machine_learning_notebook_url": {"max_length": 512, "min_length": 10}, + "mongo_db_url": {"max_length": 512, "min_length": 10}, + "ords_url": {"max_length": 512, "min_length": 10}, + "sql_dev_web_url": {"max_length": 512, "min_length": 10}, + } + + _attribute_map = { + "apex_url": {"key": "apexUrl", "type": "str"}, + "database_transforms_url": {"key": "databaseTransformsUrl", "type": "str"}, + "graph_studio_url": {"key": "graphStudioUrl", "type": "str"}, + "machine_learning_notebook_url": {"key": "machineLearningNotebookUrl", "type": "str"}, + "mongo_db_url": {"key": "mongoDbUrl", "type": "str"}, + "ords_url": {"key": "ordsUrl", "type": "str"}, + "sql_dev_web_url": {"key": "sqlDevWebUrl", "type": "str"}, + } + + def __init__( + self, + *, + apex_url: Optional[str] = None, + database_transforms_url: Optional[str] = None, + graph_studio_url: Optional[str] = None, + machine_learning_notebook_url: Optional[str] = None, + mongo_db_url: Optional[str] = None, + ords_url: Optional[str] = None, + sql_dev_web_url: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword apex_url: Oracle Application Express (APEX) URL. + :paramtype apex_url: str + :keyword database_transforms_url: The URL of the Database Transforms for the Autonomous + Database. + :paramtype database_transforms_url: str + :keyword graph_studio_url: The URL of the Graph Studio for the Autonomous Database. + :paramtype graph_studio_url: str + :keyword machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook + for the Autonomous Database. + :paramtype machine_learning_notebook_url: str + :keyword mongo_db_url: The URL of the MongoDB API for the Autonomous Database. + :paramtype mongo_db_url: str + :keyword ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the + Autonomous Database. + :paramtype ords_url: str + :keyword sql_dev_web_url: Oracle SQL Developer Web URL. + :paramtype sql_dev_web_url: str + """ + super().__init__(**kwargs) + self.apex_url = apex_url + self.database_transforms_url = database_transforms_url + self.graph_studio_url = graph_studio_url + self.machine_learning_notebook_url = machine_learning_notebook_url + self.mongo_db_url = mongo_db_url + self.ords_url = ords_url + self.sql_dev_web_url = sql_dev_web_url + + +class CustomerContact(_serialization.Model): + """CustomerContact resource properties. + + All required parameters must be populated in order to send to server. + + :ivar email: The email address used by Oracle to send notifications regarding databases and + infrastructure. Required. + :vartype email: str + """ + + _validation = { + "email": {"required": True, "max_length": 320, "min_length": 1}, + } + + _attribute_map = { + "email": {"key": "email", "type": "str"}, + } + + def __init__(self, *, email: str, **kwargs: Any) -> None: + """ + :keyword email: The email address used by Oracle to send notifications regarding databases and + infrastructure. Required. + :paramtype email: str + """ + super().__init__(**kwargs) + self.email = email + + +class DataCollectionOptions(_serialization.Model): + """DataCollectionOptions resource properties. + + :ivar is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for the + VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype is_diagnostics_events_enabled: bool + :ivar is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the VM + cluster / Cloud VM cluster / VMBM DBCS. + :vartype is_health_monitoring_enabled: bool + :ivar is_incident_logs_enabled: Indicates whether incident logs and trace collection are + enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + :vartype is_incident_logs_enabled: bool + """ + + _attribute_map = { + "is_diagnostics_events_enabled": {"key": "isDiagnosticsEventsEnabled", "type": "bool"}, + "is_health_monitoring_enabled": {"key": "isHealthMonitoringEnabled", "type": "bool"}, + "is_incident_logs_enabled": {"key": "isIncidentLogsEnabled", "type": "bool"}, + } + + def __init__( + self, + *, + is_diagnostics_events_enabled: bool = False, + is_health_monitoring_enabled: bool = False, + is_incident_logs_enabled: bool = False, + **kwargs: Any + ) -> None: + """ + :keyword is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for + the VM cluster/Cloud VM cluster/VMBM DBCS. + :paramtype is_diagnostics_events_enabled: bool + :keyword is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the + VM cluster / Cloud VM cluster / VMBM DBCS. + :paramtype is_health_monitoring_enabled: bool + :keyword is_incident_logs_enabled: Indicates whether incident logs and trace collection are + enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + :paramtype is_incident_logs_enabled: bool + """ + super().__init__(**kwargs) + self.is_diagnostics_events_enabled = is_diagnostics_events_enabled + self.is_health_monitoring_enabled = is_health_monitoring_enabled + self.is_incident_logs_enabled = is_incident_logs_enabled + + +class DayOfWeek(_serialization.Model): + """DayOfWeek resource properties. + + All required parameters must be populated in order to send to server. + + :ivar name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + + _validation = { + "name": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Union[str, "_models.DayOfWeekName"], **kwargs: Any) -> None: + """ + :keyword name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". + :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + super().__init__(**kwargs) + self.name = name + + +class DayOfWeekUpdate(_serialization.Model): + """DayOfWeek resource properties. + + :ivar name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday", and "Sunday". + :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, name: Optional[Union[str, "_models.DayOfWeekName"]] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday", and "Sunday". + :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + """ + super().__init__(**kwargs) + self.name = name + + +class DbActionResponse(_serialization.Model): + """ExascaleDbNode action response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: ExascaleDbNode provisioning state. Known values are: "Succeeded", + "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState """ _validation = { - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "total_storage_size_in_gbs": {"readonly": True}, - "available_storage_size_in_gbs": {"readonly": True}, - "time_created": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "estimated_patching_time": {"readonly": True}, "provisioning_state": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "shape": {"required": True}, - "oci_url": {"readonly": True}, - "cpu_count": {"readonly": True}, - "max_cpu_count": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "max_memory_in_gbs": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "max_db_node_storage_size_in_gbs": {"readonly": True}, - "data_storage_size_in_tbs": {"readonly": True}, - "max_data_storage_in_tbs": {"readonly": True}, - "db_server_version": {"readonly": True}, - "storage_server_version": {"readonly": True}, - "activated_storage_count": {"readonly": True}, - "additional_storage_count": {"readonly": True}, - "display_name": {"required": True, "max_length": 255, "min_length": 1}, - "last_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "next_maintenance_run_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "monthly_db_server_version": {"readonly": True}, - "monthly_storage_server_version": {"readonly": True}, } _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "compute_count": {"key": "computeCount", "type": "int"}, - "storage_count": {"key": "storageCount", "type": "int"}, - "total_storage_size_in_gbs": {"key": "totalStorageSizeInGbs", "type": "int"}, - "available_storage_size_in_gbs": {"key": "availableStorageSizeInGbs", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, - "estimated_patching_time": {"key": "estimatedPatchingTime", "type": "EstimatedPatchingTime"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "shape": {"key": "shape", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "cpu_count": {"key": "cpuCount", "type": "int"}, - "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "max_db_node_storage_size_in_gbs": {"key": "maxDbNodeStorageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, - "max_data_storage_in_tbs": {"key": "maxDataStorageInTbs", "type": "float"}, - "db_server_version": {"key": "dbServerVersion", "type": "str"}, - "storage_server_version": {"key": "storageServerVersion", "type": "str"}, - "activated_storage_count": {"key": "activatedStorageCount", "type": "int"}, - "additional_storage_count": {"key": "additionalStorageCount", "type": "int"}, - "display_name": {"key": "displayName", "type": "str"}, - "last_maintenance_run_id": {"key": "lastMaintenanceRunId", "type": "str"}, - "next_maintenance_run_id": {"key": "nextMaintenanceRunId", "type": "str"}, - "monthly_db_server_version": {"key": "monthlyDbServerVersion", "type": "str"}, - "monthly_storage_server_version": {"key": "monthlyStorageServerVersion", "type": "str"}, } - def __init__( # pylint: disable=too-many-locals + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + + +class DbIormConfig(_serialization.Model): + """DbIormConfig for cloud vm cluster. + + :ivar db_name: The database name. For the default DbPlan, the dbName is default. + :vartype db_name: str + :ivar flash_cache_limit: The flash cache limit for this database. This value is internally + configured based on the share value assigned to the database. + :vartype flash_cache_limit: str + :ivar share: The relative priority of this database. + :vartype share: int + """ + + _validation = { + "share": {"maximum": 32, "minimum": 1}, + } + + _attribute_map = { + "db_name": {"key": "dbName", "type": "str"}, + "flash_cache_limit": {"key": "flashCacheLimit", "type": "str"}, + "share": {"key": "share", "type": "int"}, + } + + def __init__( self, *, - shape: str, - display_name: str, - compute_count: Optional[int] = None, - storage_count: Optional[int] = None, - maintenance_window: Optional["_models.MaintenanceWindow"] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, + db_name: Optional[str] = None, + flash_cache_limit: Optional[str] = None, + share: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. - :paramtype compute_count: int - :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. - :paramtype storage_count: int - :keyword maintenance_window: maintenanceWindow property. - :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :keyword customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword shape: The model name of the cloud Exadata infrastructure resource. Required. - :paramtype shape: str - :keyword display_name: The name for the Exadata infrastructure. Required. - :paramtype display_name: str + :keyword db_name: The database name. For the default DbPlan, the dbName is default. + :paramtype db_name: str + :keyword flash_cache_limit: The flash cache limit for this database. This value is internally + configured based on the share value assigned to the database. + :paramtype flash_cache_limit: str + :keyword share: The relative priority of this database. + :paramtype share: int + """ + super().__init__(**kwargs) + self.db_name = db_name + self.flash_cache_limit = flash_cache_limit + self.share = share + + +class DbNode(ProxyResource): + """The DbNode resource belonging to vmCluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "DbNodeProperties"}, + } + + def __init__(self, *, properties: Optional["_models.DbNodeProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class DbNodeAction(_serialization.Model): + """DbNode action object. + + All required parameters must be populated in order to send to server. + + :ivar action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and "Reset". + :vartype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum + """ + + _validation = { + "action": {"required": True}, + } + + _attribute_map = { + "action": {"key": "action", "type": "str"}, + } + + def __init__(self, *, action: Union[str, "_models.DbNodeActionEnum"], **kwargs: Any) -> None: + """ + :keyword action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and + "Reset". + :paramtype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum + """ + super().__init__(**kwargs) + self.action = action + + +class DbNodeDetails(_serialization.Model): + """Details of the ExaCS Db node. Applies to Exadata Database Service on Exascale Infrastructure + only. + + All required parameters must be populated in order to send to server. + + :ivar db_node_id: Exascale DbNode Azure Resource ID. Required. + :vartype db_node_id: str + """ + + _validation = { + "db_node_id": {"required": True}, + } + + _attribute_map = { + "db_node_id": {"key": "dbNodeId", "type": "str"}, + } + + def __init__(self, *, db_node_id: str, **kwargs: Any) -> None: + """ + :keyword db_node_id: Exascale DbNode Azure Resource ID. Required. + :paramtype db_node_id: str """ super().__init__(**kwargs) - self.ocid = None - self.compute_count = compute_count - self.storage_count = storage_count - self.total_storage_size_in_gbs = None - self.available_storage_size_in_gbs = None - self.time_created = None - self.lifecycle_details = None - self.maintenance_window = maintenance_window - self.estimated_patching_time = None - self.customer_contacts = customer_contacts - self.provisioning_state = None - self.lifecycle_state = None - self.shape = shape - self.oci_url = None - self.cpu_count = None - self.max_cpu_count = None - self.memory_size_in_gbs = None - self.max_memory_in_gbs = None - self.db_node_storage_size_in_gbs = None - self.max_db_node_storage_size_in_gbs = None - self.data_storage_size_in_tbs = None - self.max_data_storage_in_tbs = None - self.db_server_version = None - self.storage_server_version = None - self.activated_storage_count = None - self.additional_storage_count = None - self.display_name = display_name - self.last_maintenance_run_id = None - self.next_maintenance_run_id = None - self.monthly_db_server_version = None - self.monthly_storage_server_version = None + self.db_node_id = db_node_id -class CloudExadataInfrastructureUpdate(_serialization.Model): - """The type used for update operations of the CloudExadataInfrastructure. +class DbNodeListResult(_serialization.Model): + """The response of a DbNode list operation. - :ivar zones: CloudExadataInfrastructure zones. - :vartype zones: list[str] - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the CloudExadataInfrastructure. - :vartype properties: - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties + All required parameters must be populated in order to send to server. + + :ivar value: The DbNode items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.DbNode] + :ivar next_link: The link to the next page of items. + :vartype next_link: str """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "zones": {"key": "zones", "type": "[str]"}, - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "CloudExadataInfrastructureUpdateProperties"}, + "value": {"key": "value", "type": "[DbNode]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - zones: Optional[List[str]] = None, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudExadataInfrastructureUpdateProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.DbNode"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword zones: CloudExadataInfrastructure zones. - :paramtype zones: list[str] - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the CloudExadataInfrastructure. - :paramtype properties: - ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructureUpdateProperties + :keyword value: The DbNode items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.DbNode] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.zones = zones - self.tags = tags - self.properties = properties + self.value = value + self.next_link = next_link -class CloudExadataInfrastructureUpdateProperties(_serialization.Model): # pylint: disable=name-too-long - """The updatable properties of the CloudExadataInfrastructure. +class DbNodeProperties(_serialization.Model): + """The properties of DbNodeResource. - :ivar compute_count: The number of compute servers for the cloud Exadata infrastructure. - :vartype compute_count: int - :ivar storage_count: The number of storage servers for the cloud Exadata infrastructure. - :vartype storage_count: int - :ivar maintenance_window: maintenanceWindow property. - :vartype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :ivar customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :vartype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :ivar display_name: The name for the Exadata infrastructure. - :vartype display_name: str + 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 ocid: DbNode OCID. Required. + :vartype ocid: str + :ivar additional_details: Additional information about the planned maintenance. + :vartype additional_details: str + :ivar backup_ip_id: The OCID of the backup IP address associated with the database node. + :vartype backup_ip_id: str + :ivar backup_vnic2_id: The OCID of the second backup VNIC. + :vartype backup_vnic2_id: str + :ivar backup_vnic_id: The OCID of the backup VNIC. + :vartype backup_vnic_id: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db node. + :vartype cpu_core_count: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :vartype db_node_storage_size_in_gbs: int + :ivar db_server_id: The OCID of the Exacc Db server associated with the database node. + :vartype db_server_id: str + :ivar db_system_id: The OCID of the DB system. Required. + :vartype db_system_id: str + :ivar fault_domain: The name of the Fault Domain the instance is contained in. + :vartype fault_domain: str + :ivar host_ip_id: The OCID of the host IP address associated with the database node. + :vartype host_ip_id: str + :ivar hostname: The host name for the database node. + :vartype hostname: str + :ivar lifecycle_state: The current state of the database node. Required. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :ivar lifecycle_details: Lifecycle details of Db Node. + :vartype lifecycle_details: str + :ivar maintenance_type: The type of database node maintenance. "VmdbRebootMigration" + :vartype maintenance_type: str or ~azure.mgmt.oracledatabase.models.DbNodeMaintenanceType + :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. + :vartype memory_size_in_gbs: int + :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for + the DB system. This attribute applies only for virtual machine DB systems. + :vartype software_storage_size_in_gb: int + :ivar time_created: The date and time that the database node was created. Required. + :vartype time_created: ~datetime.datetime + :ivar time_maintenance_window_end: End date and time of maintenance window. + :vartype time_maintenance_window_end: ~datetime.datetime + :ivar time_maintenance_window_start: Start date and time of maintenance window. + :vartype time_maintenance_window_start: ~datetime.datetime + :ivar vnic2_id: The OCID of the second VNIC. + :vartype vnic2_id: str + :ivar vnic_id: The OCID of the VNIC. Required. + :vartype vnic_id: str + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState """ _validation = { - "display_name": {"max_length": 255, "min_length": 1}, + "ocid": {"required": True, "max_length": 255, "min_length": 1}, + "backup_ip_id": {"max_length": 255, "min_length": 1}, + "backup_vnic2_id": {"max_length": 255, "min_length": 1}, + "backup_vnic_id": {"max_length": 255, "min_length": 1}, + "db_server_id": {"max_length": 255, "min_length": 1}, + "db_system_id": {"required": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"max_length": 255, "min_length": 1}, + "host_ip_id": {"max_length": 255, "min_length": 1}, + "lifecycle_state": {"required": True}, + "time_created": {"required": True}, + "vnic2_id": {"max_length": 255, "min_length": 1}, + "vnic_id": {"required": True, "max_length": 255, "min_length": 1}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - "compute_count": {"key": "computeCount", "type": "int"}, - "storage_count": {"key": "storageCount", "type": "int"}, - "maintenance_window": {"key": "maintenanceWindow", "type": "MaintenanceWindow"}, - "customer_contacts": {"key": "customerContacts", "type": "[CustomerContact]"}, - "display_name": {"key": "displayName", "type": "str"}, + "ocid": {"key": "ocid", "type": "str"}, + "additional_details": {"key": "additionalDetails", "type": "str"}, + "backup_ip_id": {"key": "backupIpId", "type": "str"}, + "backup_vnic2_id": {"key": "backupVnic2Id", "type": "str"}, + "backup_vnic_id": {"key": "backupVnicId", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, + "db_server_id": {"key": "dbServerId", "type": "str"}, + "db_system_id": {"key": "dbSystemId", "type": "str"}, + "fault_domain": {"key": "faultDomain", "type": "str"}, + "host_ip_id": {"key": "hostIpId", "type": "str"}, + "hostname": {"key": "hostname", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "maintenance_type": {"key": "maintenanceType", "type": "str"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "software_storage_size_in_gb": {"key": "softwareStorageSizeInGb", "type": "int"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "time_maintenance_window_end": {"key": "timeMaintenanceWindowEnd", "type": "iso-8601"}, + "time_maintenance_window_start": {"key": "timeMaintenanceWindowStart", "type": "iso-8601"}, + "vnic2_id": {"key": "vnic2Id", "type": "str"}, + "vnic_id": {"key": "vnicId", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( self, *, - compute_count: Optional[int] = None, - storage_count: Optional[int] = None, - maintenance_window: Optional["_models.MaintenanceWindow"] = None, - customer_contacts: Optional[List["_models.CustomerContact"]] = None, - display_name: Optional[str] = None, + ocid: str, + db_system_id: str, + lifecycle_state: Union[str, "_models.DbNodeProvisioningState"], + time_created: datetime.datetime, + vnic_id: str, + additional_details: Optional[str] = None, + backup_ip_id: Optional[str] = None, + backup_vnic2_id: Optional[str] = None, + backup_vnic_id: Optional[str] = None, + cpu_core_count: Optional[int] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + db_server_id: Optional[str] = None, + fault_domain: Optional[str] = None, + host_ip_id: Optional[str] = None, + hostname: Optional[str] = None, + lifecycle_details: Optional[str] = None, + maintenance_type: Optional[Union[str, "_models.DbNodeMaintenanceType"]] = None, + memory_size_in_gbs: Optional[int] = None, + software_storage_size_in_gb: Optional[int] = None, + time_maintenance_window_end: Optional[datetime.datetime] = None, + time_maintenance_window_start: Optional[datetime.datetime] = None, + vnic2_id: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword compute_count: The number of compute servers for the cloud Exadata infrastructure. - :paramtype compute_count: int - :keyword storage_count: The number of storage servers for the cloud Exadata infrastructure. - :paramtype storage_count: int - :keyword maintenance_window: maintenanceWindow property. - :paramtype maintenance_window: ~azure.mgmt.oracledatabase.models.MaintenanceWindow - :keyword customer_contacts: The list of customer email addresses that receive information from - Oracle about the specified OCI Database service resource. Oracle uses these email addresses to - send notifications about planned and unplanned software maintenance updates, information about - system hardware, and other information needed by administrators. Up to 10 email addresses can - be added to the customer contacts for a cloud Exadata infrastructure instance. - :paramtype customer_contacts: list[~azure.mgmt.oracledatabase.models.CustomerContact] - :keyword display_name: The name for the Exadata infrastructure. - :paramtype display_name: str + :keyword ocid: DbNode OCID. Required. + :paramtype ocid: str + :keyword additional_details: Additional information about the planned maintenance. + :paramtype additional_details: str + :keyword backup_ip_id: The OCID of the backup IP address associated with the database node. + :paramtype backup_ip_id: str + :keyword backup_vnic2_id: The OCID of the second backup VNIC. + :paramtype backup_vnic2_id: str + :keyword backup_vnic_id: The OCID of the backup VNIC. + :paramtype backup_vnic_id: str + :keyword cpu_core_count: The number of CPU cores enabled on the Db node. + :paramtype cpu_core_count: int + :keyword db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :paramtype db_node_storage_size_in_gbs: int + :keyword db_server_id: The OCID of the Exacc Db server associated with the database node. + :paramtype db_server_id: str + :keyword db_system_id: The OCID of the DB system. Required. + :paramtype db_system_id: str + :keyword fault_domain: The name of the Fault Domain the instance is contained in. + :paramtype fault_domain: str + :keyword host_ip_id: The OCID of the host IP address associated with the database node. + :paramtype host_ip_id: str + :keyword hostname: The host name for the database node. + :paramtype hostname: str + :keyword lifecycle_state: The current state of the database node. Required. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :paramtype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :keyword lifecycle_details: Lifecycle details of Db Node. + :paramtype lifecycle_details: str + :keyword maintenance_type: The type of database node maintenance. "VmdbRebootMigration" + :paramtype maintenance_type: str or ~azure.mgmt.oracledatabase.models.DbNodeMaintenanceType + :keyword memory_size_in_gbs: The allocated memory in GBs on the Db node. + :paramtype memory_size_in_gbs: int + :keyword software_storage_size_in_gb: The size (in GB) of the block storage volume allocation + for the DB system. This attribute applies only for virtual machine DB systems. + :paramtype software_storage_size_in_gb: int + :keyword time_created: The date and time that the database node was created. Required. + :paramtype time_created: ~datetime.datetime + :keyword time_maintenance_window_end: End date and time of maintenance window. + :paramtype time_maintenance_window_end: ~datetime.datetime + :keyword time_maintenance_window_start: Start date and time of maintenance window. + :paramtype time_maintenance_window_start: ~datetime.datetime + :keyword vnic2_id: The OCID of the second VNIC. + :paramtype vnic2_id: str + :keyword vnic_id: The OCID of the VNIC. Required. + :paramtype vnic_id: str """ super().__init__(**kwargs) - self.compute_count = compute_count - self.storage_count = storage_count - self.maintenance_window = maintenance_window - self.customer_contacts = customer_contacts - self.display_name = display_name + self.ocid = ocid + self.additional_details = additional_details + self.backup_ip_id = backup_ip_id + self.backup_vnic2_id = backup_vnic2_id + self.backup_vnic_id = backup_vnic_id + self.cpu_core_count = cpu_core_count + self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs + self.db_server_id = db_server_id + self.db_system_id = db_system_id + self.fault_domain = fault_domain + self.host_ip_id = host_ip_id + self.hostname = hostname + self.lifecycle_state = lifecycle_state + self.lifecycle_details = lifecycle_details + self.maintenance_type = maintenance_type + self.memory_size_in_gbs = memory_size_in_gbs + self.software_storage_size_in_gb = software_storage_size_in_gb + self.time_created = time_created + self.time_maintenance_window_end = time_maintenance_window_end + self.time_maintenance_window_start = time_maintenance_window_start + self.vnic2_id = vnic2_id + self.vnic_id = vnic_id + self.provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = None -class CloudVmCluster(TrackedResource): - """CloudVmCluster resource definition. +class DbServer(ProxyResource): + """DbServer resource model. 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. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3482,12 +6134,8 @@ class CloudVmCluster(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.oracledatabase.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 resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties + :vartype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties """ _validation = { @@ -3495,7 +6143,6 @@ class CloudVmCluster(TrackedResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "location": {"required": True}, } _attribute_map = { @@ -3503,38 +6150,25 @@ class CloudVmCluster(TrackedResource): "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": "CloudVmClusterProperties"}, + "properties": {"key": "properties", "type": "DbServerProperties"}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudVmClusterProperties"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, properties: Optional["_models.DbServerProperties"] = 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: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterProperties + :paramtype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties """ - super().__init__(tags=tags, location=location, **kwargs) + super().__init__(**kwargs) self.properties = properties -class CloudVmClusterListResult(_serialization.Model): - """The response of a CloudVmCluster list operation. +class DbServerListResult(_serialization.Model): + """The response of a DbServer list operation. All required parameters must be populated in order to send to server. - :ivar value: The CloudVmCluster items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :ivar value: The DbServer items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.DbServer] :ivar next_link: The link to the next page of items. :vartype next_link: str """ @@ -3544,16 +6178,14 @@ class CloudVmClusterListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[CloudVmCluster]"}, + "value": {"key": "value", "type": "[DbServer]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, *, value: List["_models.CloudVmCluster"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.DbServer"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword value: The CloudVmCluster items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.CloudVmCluster] + :keyword value: The DbServer items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.DbServer] :keyword next_link: The link to the next page of items. :paramtype next_link: str """ @@ -3562,871 +6194,1152 @@ def __init__( self.next_link = next_link -class CloudVmClusterProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """CloudVmCluster resource model. +class DbServerPatchingDetails(_serialization.Model): + """DbServer Patching Properties. 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 estimated_patch_duration: Estimated Patch Duration. + :vartype estimated_patch_duration: int + :ivar patching_status: Patching Status. Known values are: "Scheduled", "MaintenanceInProgress", + "Failed", and "Complete". + :vartype patching_status: str or ~azure.mgmt.oracledatabase.models.DbServerPatchingStatus + :ivar time_patching_ended: Time Patching Ended. + :vartype time_patching_ended: ~datetime.datetime + :ivar time_patching_started: Time Patching Started. + :vartype time_patching_started: ~datetime.datetime + """ - :ivar ocid: Cloud VM Cluster ocid. + _validation = { + "estimated_patch_duration": {"readonly": True, "maximum": 3000, "minimum": 1}, + "patching_status": {"readonly": True}, + "time_patching_ended": {"readonly": True}, + "time_patching_started": {"readonly": True}, + } + + _attribute_map = { + "estimated_patch_duration": {"key": "estimatedPatchDuration", "type": "int"}, + "patching_status": {"key": "patchingStatus", "type": "str"}, + "time_patching_ended": {"key": "timePatchingEnded", "type": "iso-8601"}, + "time_patching_started": {"key": "timePatchingStarted", "type": "iso-8601"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.estimated_patch_duration: Optional[int] = None + self.patching_status: Optional[Union[str, "_models.DbServerPatchingStatus"]] = None + self.time_patching_ended: Optional[datetime.datetime] = None + self.time_patching_started: Optional[datetime.datetime] = None + + +class DbServerProperties(_serialization.Model): + """DbServer resource properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ocid: Db server name. :vartype ocid: str - :ivar listener_port: The port number configured for the listener on the cloud VM cluster. - :vartype listener_port: int - :ivar node_count: The number of nodes in the cloud VM cluster. - :vartype node_count: int - :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :vartype storage_size_in_gbs: int - :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :vartype data_storage_size_in_tbs: float - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. + :ivar display_name: The name for the Db Server. + :vartype display_name: str + :ivar compartment_id: The OCID of the compartment. + :vartype compartment_id: str + :ivar exadata_infrastructure_id: The OCID of the Exadata infrastructure. + :vartype exadata_infrastructure_id: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db server. + :vartype cpu_core_count: int + :ivar db_server_patching_details: dbServerPatching details of the Db server. + :vartype db_server_patching_details: ~azure.mgmt.oracledatabase.models.DbServerPatchingDetails + :ivar max_memory_in_gbs: The total memory available in GBs. + :vartype max_memory_in_gbs: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db server. :vartype db_node_storage_size_in_gbs: int - :ivar memory_size_in_gbs: The memory to be allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar time_created: The date and time that the cloud VM cluster was created. - :vartype time_created: ~datetime.datetime - :ivar lifecycle_details: Additional information about the current lifecycle state. + :ivar vm_cluster_ids: The OCID of the VM Clusters associated with the Db server. + :vartype vm_cluster_ids: list[str] + :ivar db_node_ids: The OCID of the Db nodes associated with the Db server. + :vartype db_node_ids: list[str] + :ivar lifecycle_details: Lifecycle details of dbServer. :vartype lifecycle_details: str - :ivar time_zone: The time zone of the cloud VM cluster. For details, see `Exadata - Infrastructure Time Zones `_. - :vartype time_zone: str - :ivar zone_id: The OCID of the zone the cloud VM cluster is associated with. - :vartype zone_id: str - :ivar hostname: The hostname for the cloud VM cluster. Required. - :vartype hostname: str - :ivar domain: The domain name for the cloud VM cluster. - :vartype domain: str - :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. - :vartype cpu_core_count: int - :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :vartype ocpu_count: float - :ivar cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with an - alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The - cluster name can be no longer than 11 characters and is not case sensitive. - :vartype cluster_name: str - :ivar data_storage_percentage: The percentage assigned to DATA storage (user data and database - files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, - and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent - assigned to DATA storage. See `Storage Configuration - `_ in the Exadata documentation for details - on the impact of the configuration settings on storage. - :vartype data_storage_percentage: int - :ivar is_local_backup_enabled: If true, database backup on local Exadata storage is configured - for the cloud VM cluster. If false, database backup on local Exadata storage is not available - in the cloud VM cluster. - :vartype is_local_backup_enabled: bool - :ivar cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. - :vartype cloud_exadata_infrastructure_id: str - :ivar is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM - cluster. If false, sparse disk group is not created. - :vartype is_sparse_diskgroup_enabled: bool - :ivar system_version: Operating system version of the image. - :vartype system_version: str - :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to - the cloud VM cluster. Required. - :vartype ssh_public_keys: list[str] - :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default - is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar disk_redundancy: The type of redundancy configured for the cloud Vm cluster. NORMAL is - 2-way redundancy. HIGH is 3-way redundancy. Known values are: "High" and "Normal". - :vartype disk_redundancy: str or ~azure.mgmt.oracledatabase.models.DiskRedundancy - :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the cloud - VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any - interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. - **Note:** For a single-node DB system, this list is empty. - :vartype scan_ip_ids: list[str] - :ivar vip_ids: The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster - Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud - Service instance to enable failover. If one node fails, the VIP is reassigned to another active - node in the cluster. **Note:** For a single-node DB system, this list is empty. - :vartype vip_ids: list[str] - :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated - with the cloud VM cluster. - :vartype scan_dns_name: str - :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port - is 1521. - :vartype scan_listener_port_tcp: int - :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default - port is 2484. - :vartype scan_listener_port_tcp_ssl: int - :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are - associated with the cloud VM cluster. - :vartype scan_dns_record_id: str - :ivar shape: The model name of the Exadata hardware running the cloud VM cluster. + :ivar lifecycle_state: DbServer provisioning state. Known values are: "Creating", "Available", + "Unavailable", "Deleting", "Deleted", and "MaintenanceInProgress". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbServerProvisioningState + :ivar max_cpu_count: The total number of CPU cores available. + :vartype max_cpu_count: int + :ivar autonomous_vm_cluster_ids: The list of OCIDs of the Autonomous VM Clusters associated + with the Db server. + :vartype autonomous_vm_cluster_ids: list[str] + :ivar autonomous_virtual_machine_ids: The list of OCIDs of the Autonomous Virtual Machines + associated with the Db server. + :vartype autonomous_virtual_machine_ids: list[str] + :ivar max_db_node_storage_in_gbs: The total max dbNode storage in GBs. + :vartype max_db_node_storage_in_gbs: int + :ivar memory_size_in_gbs: The total memory size in GBs. + :vartype memory_size_in_gbs: int + :ivar shape: The shape of the Db server. The shape determines the amount of CPU, storage, and + memory resources available. :vartype shape: str - :ivar provisioning_state: CloudVmCluster provisioning state. Known values are: "Succeeded", - "Failed", "Canceled", and "Provisioning". - :vartype provisioning_state: str or - ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState - :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", - "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.CloudVmClusterLifecycleState - :ivar vnet_id: VNET for network connectivity. Required. - :vartype vnet_id: str - :ivar gi_version: Oracle Grid Infrastructure (GI) software version. Required. - :vartype gi_version: str - :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. - :vartype oci_url: str - :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure - Interface. - :vartype nsg_url: str - :ivar subnet_id: Client subnet. Required. - :vartype subnet_id: str - :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. - :vartype backup_subnet_cidr: str - :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision - the VM Cluster will be added by default. - :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] - :ivar data_collection_options: Indicates user preferences for the various diagnostic collection - options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :ivar display_name: Display Name. Required. - :vartype display_name: str - :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :vartype compute_nodes: list[str] - :ivar iorm_config_cache: iormConfigCache details for cloud VM cluster. - :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig - :ivar last_update_history_entry_id: The OCID of the last maintenance update history entry. - :vartype last_update_history_entry_id: str - :ivar db_servers: The list of DB servers. - :vartype db_servers: list[str] - :ivar compartment_id: Cluster compartmentId. - :vartype compartment_id: str - :ivar subnet_ocid: Cluster subnet ocid. - :vartype subnet_ocid: str + :ivar time_created: The date and time that the Db Server was created. + :vartype time_created: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel """ _validation = { "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "listener_port": {"readonly": True}, - "node_count": {"readonly": True}, - "time_created": {"readonly": True}, + "display_name": {"readonly": True, "max_length": 255, "min_length": 1}, + "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "exadata_infrastructure_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "cpu_core_count": {"readonly": True}, + "db_server_patching_details": {"readonly": True}, + "max_memory_in_gbs": {"readonly": True}, + "db_node_storage_size_in_gbs": {"readonly": True}, + "vm_cluster_ids": {"readonly": True}, + "db_node_ids": {"readonly": True}, "lifecycle_details": {"readonly": True}, - "time_zone": {"max_length": 255, "min_length": 1}, - "zone_id": {"max_length": 255, "min_length": 1}, - "hostname": {"required": True, "max_length": 23, "min_length": 1}, - "cpu_core_count": {"required": True}, - "cluster_name": {"max_length": 11, "min_length": 1}, - "cloud_exadata_infrastructure_id": {"required": True}, - "system_version": {"max_length": 255, "min_length": 1}, - "ssh_public_keys": {"required": True}, - "disk_redundancy": {"readonly": True}, - "scan_ip_ids": {"readonly": True}, - "vip_ids": {"readonly": True}, - "scan_dns_name": {"readonly": True, "max_length": 72, "min_length": 1}, - "scan_dns_record_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "shape": {"readonly": True, "max_length": 255, "min_length": 1}, - "provisioning_state": {"readonly": True}, "lifecycle_state": {"readonly": True}, - "vnet_id": {"required": True}, - "gi_version": {"required": True}, - "oci_url": {"readonly": True}, - "nsg_url": {"readonly": True}, - "subnet_id": {"required": True}, - "backup_subnet_cidr": {"max_length": 32, "min_length": 1}, - "display_name": {"required": True, "max_length": 255, "min_length": 1}, - "iorm_config_cache": {"readonly": True}, - "last_update_history_entry_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "subnet_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "max_cpu_count": {"readonly": True}, + "autonomous_vm_cluster_ids": {"readonly": True}, + "autonomous_virtual_machine_ids": {"readonly": True}, + "max_db_node_storage_in_gbs": {"readonly": True}, + "memory_size_in_gbs": {"readonly": True}, + "shape": {"readonly": True, "max_length": 255, "min_length": 1}, + "time_created": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "compute_model": {"readonly": True}, } _attribute_map = { "ocid": {"key": "ocid", "type": "str"}, - "listener_port": {"key": "listenerPort", "type": "int"}, - "node_count": {"key": "nodeCount", "type": "int"}, - "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, + "display_name": {"key": "displayName", "type": "str"}, + "compartment_id": {"key": "compartmentId", "type": "str"}, + "exadata_infrastructure_id": {"key": "exadataInfrastructureId", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "db_server_patching_details": {"key": "dbServerPatchingDetails", "type": "DbServerPatchingDetails"}, + "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "vm_cluster_ids": {"key": "vmClusterIds", "type": "[str]"}, + "db_node_ids": {"key": "dbNodeIds", "type": "[str]"}, "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "time_zone": {"key": "timeZone", "type": "str"}, - "zone_id": {"key": "zoneId", "type": "str"}, - "hostname": {"key": "hostname", "type": "str"}, - "domain": {"key": "domain", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "ocpu_count": {"key": "ocpuCount", "type": "float"}, - "cluster_name": {"key": "clusterName", "type": "str"}, - "data_storage_percentage": {"key": "dataStoragePercentage", "type": "int"}, - "is_local_backup_enabled": {"key": "isLocalBackupEnabled", "type": "bool"}, - "cloud_exadata_infrastructure_id": {"key": "cloudExadataInfrastructureId", "type": "str"}, - "is_sparse_diskgroup_enabled": {"key": "isSparseDiskgroupEnabled", "type": "bool"}, - "system_version": {"key": "systemVersion", "type": "str"}, - "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, - "license_model": {"key": "licenseModel", "type": "str"}, - "disk_redundancy": {"key": "diskRedundancy", "type": "str"}, - "scan_ip_ids": {"key": "scanIpIds", "type": "[str]"}, - "vip_ids": {"key": "vipIds", "type": "[str]"}, - "scan_dns_name": {"key": "scanDnsName", "type": "str"}, - "scan_listener_port_tcp": {"key": "scanListenerPortTcp", "type": "int"}, - "scan_listener_port_tcp_ssl": {"key": "scanListenerPortTcpSsl", "type": "int"}, - "scan_dns_record_id": {"key": "scanDnsRecordId", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, + "autonomous_vm_cluster_ids": {"key": "autonomousVmClusterIds", "type": "[str]"}, + "autonomous_virtual_machine_ids": {"key": "autonomousVirtualMachineIds", "type": "[str]"}, + "max_db_node_storage_in_gbs": {"key": "maxDbNodeStorageInGbs", "type": "int"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, "shape": {"key": "shape", "type": "str"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "vnet_id": {"key": "vnetId", "type": "str"}, - "gi_version": {"key": "giVersion", "type": "str"}, - "oci_url": {"key": "ociUrl", "type": "str"}, - "nsg_url": {"key": "nsgUrl", "type": "str"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - "backup_subnet_cidr": {"key": "backupSubnetCidr", "type": "str"}, - "nsg_cidrs": {"key": "nsgCidrs", "type": "[NsgCidr]"}, - "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, - "display_name": {"key": "displayName", "type": "str"}, - "compute_nodes": {"key": "computeNodes", "type": "[str]"}, - "iorm_config_cache": {"key": "iormConfigCache", "type": "ExadataIormConfig"}, - "last_update_history_entry_id": {"key": "lastUpdateHistoryEntryId", "type": "str"}, - "db_servers": {"key": "dbServers", "type": "[str]"}, - "compartment_id": {"key": "compartmentId", "type": "str"}, - "subnet_ocid": {"key": "subnetOcid", "type": "str"}, + "compute_model": {"key": "computeModel", "type": "str"}, } - def __init__( # pylint: disable=too-many-locals - self, - *, - hostname: str, - cpu_core_count: int, - cloud_exadata_infrastructure_id: str, - ssh_public_keys: List[str], - vnet_id: str, - gi_version: str, - subnet_id: str, - display_name: str, - storage_size_in_gbs: Optional[int] = None, - data_storage_size_in_tbs: Optional[float] = None, - db_node_storage_size_in_gbs: Optional[int] = None, - memory_size_in_gbs: Optional[int] = None, - time_zone: Optional[str] = None, - zone_id: Optional[str] = None, - domain: Optional[str] = None, - ocpu_count: Optional[float] = None, - cluster_name: Optional[str] = None, - data_storage_percentage: Optional[int] = None, - is_local_backup_enabled: bool = False, - is_sparse_diskgroup_enabled: bool = False, - system_version: Optional[str] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - scan_listener_port_tcp: Optional[int] = None, - scan_listener_port_tcp_ssl: Optional[int] = None, - backup_subnet_cidr: Optional[str] = None, - nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, - data_collection_options: Optional["_models.DataCollectionOptions"] = None, - compute_nodes: Optional[List[str]] = None, - db_servers: Optional[List[str]] = None, + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ocid: Optional[str] = None + self.display_name: Optional[str] = None + self.compartment_id: Optional[str] = None + self.exadata_infrastructure_id: Optional[str] = None + self.cpu_core_count: Optional[int] = None + self.db_server_patching_details: Optional["_models.DbServerPatchingDetails"] = None + self.max_memory_in_gbs: Optional[int] = None + self.db_node_storage_size_in_gbs: Optional[int] = None + self.vm_cluster_ids: Optional[List[str]] = None + self.db_node_ids: Optional[List[str]] = None + self.lifecycle_details: Optional[str] = None + self.lifecycle_state: Optional[Union[str, "_models.DbServerProvisioningState"]] = None + self.max_cpu_count: Optional[int] = None + self.autonomous_vm_cluster_ids: Optional[List[str]] = None + self.autonomous_virtual_machine_ids: Optional[List[str]] = None + self.max_db_node_storage_in_gbs: Optional[int] = None + self.memory_size_in_gbs: Optional[int] = None + self.shape: Optional[str] = None + self.time_created: Optional[datetime.datetime] = None + self.provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = None + self.compute_model: Optional[Union[str, "_models.ComputeModel"]] = None + + +class DbSystemShape(ProxyResource): + """DbSystemShape resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "DbSystemShapeProperties"}, + } + + def __init__(self, *, properties: Optional["_models.DbSystemShapeProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class DbSystemShapeListResult(_serialization.Model): + """The response of a DbSystemShape list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The DbSystemShape items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DbSystemShape]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.DbSystemShape"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: The DbSystemShape items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DbSystemShapeProperties(_serialization.Model): + """DbSystemShape resource model. + + All required parameters must be populated in order to send to server. + + :ivar shape_family: The family of the shape used for the DB system. + :vartype shape_family: str + :ivar shape_name: The shape used for the DB system. Required. + :vartype shape_name: str + :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB + system for this shape. Required. + :vartype available_core_count: int + :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB system + for this shape. + :vartype minimum_core_count: int + :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled + on the DB system for this shape. + :vartype runtime_minimum_core_count: int + :ivar core_count_increment: The discrete number by which the CPU core count for this shape can + be increased or decreased. + :vartype core_count_increment: int + :ivar min_storage_count: The minimum number of Exadata storage servers available for the + Exadata infrastructure. + :vartype min_storage_count: int + :ivar max_storage_count: The maximum number of Exadata storage servers available for the + Exadata infrastructure. + :vartype max_storage_count: int + :ivar available_data_storage_per_server_in_tbs: The maximum data storage available per storage + server for this shape. Only applicable to ExaCC Elastic shapes. + :vartype available_data_storage_per_server_in_tbs: float + :ivar available_memory_per_node_in_gbs: The maximum memory available per database node for this + shape. Only applicable to ExaCC Elastic shapes. + :vartype available_memory_per_node_in_gbs: int + :ivar available_db_node_per_node_in_gbs: The maximum Db Node storage available per database + node for this shape. Only applicable to ExaCC Elastic shapes. + :vartype available_db_node_per_node_in_gbs: int + :ivar min_core_count_per_node: The minimum number of CPU cores that can be enabled per node for + this shape. + :vartype min_core_count_per_node: int + :ivar available_memory_in_gbs: The maximum memory that can be enabled for this shape. + :vartype available_memory_in_gbs: int + :ivar min_memory_per_node_in_gbs: The minimum memory that need be allocated per node for this + shape. + :vartype min_memory_per_node_in_gbs: int + :ivar available_db_node_storage_in_gbs: The maximum Db Node storage that can be enabled for + this shape. + :vartype available_db_node_storage_in_gbs: int + :ivar min_db_node_storage_per_node_in_gbs: The minimum Db Node storage that need be allocated + per node for this shape. + :vartype min_db_node_storage_per_node_in_gbs: int + :ivar available_data_storage_in_tbs: The maximum DATA storage that can be enabled for this + shape. + :vartype available_data_storage_in_tbs: int + :ivar min_data_storage_in_tbs: The minimum data storage that need be allocated for this shape. + :vartype min_data_storage_in_tbs: int + :ivar minimum_node_count: The minimum number of database nodes available for this shape. + :vartype minimum_node_count: int + :ivar maximum_node_count: The maximum number of database nodes available for this shape. + :vartype maximum_node_count: int + :ivar available_core_count_per_node: The maximum number of CPU cores per database node that can + be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + :vartype available_core_count_per_node: int + :ivar compute_model: The compute model of the Exadata Infrastructure. Known values are: "ECPU" + and "OCPU". + :vartype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :ivar are_server_types_supported: Indicates if the shape supports database and storage server + types. + :vartype are_server_types_supported: bool + :ivar display_name: The display name of the shape used for the DB system. + :vartype display_name: str + """ + + _validation = { + "shape_family": {"max_length": 255, "min_length": 1}, + "shape_name": {"required": True, "max_length": 255, "min_length": 1}, + "available_core_count": {"required": True}, + "display_name": {"max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "shape_family": {"key": "shapeFamily", "type": "str"}, + "shape_name": {"key": "shapeName", "type": "str"}, + "available_core_count": {"key": "availableCoreCount", "type": "int"}, + "minimum_core_count": {"key": "minimumCoreCount", "type": "int"}, + "runtime_minimum_core_count": {"key": "runtimeMinimumCoreCount", "type": "int"}, + "core_count_increment": {"key": "coreCountIncrement", "type": "int"}, + "min_storage_count": {"key": "minStorageCount", "type": "int"}, + "max_storage_count": {"key": "maxStorageCount", "type": "int"}, + "available_data_storage_per_server_in_tbs": {"key": "availableDataStoragePerServerInTbs", "type": "float"}, + "available_memory_per_node_in_gbs": {"key": "availableMemoryPerNodeInGbs", "type": "int"}, + "available_db_node_per_node_in_gbs": {"key": "availableDbNodePerNodeInGbs", "type": "int"}, + "min_core_count_per_node": {"key": "minCoreCountPerNode", "type": "int"}, + "available_memory_in_gbs": {"key": "availableMemoryInGbs", "type": "int"}, + "min_memory_per_node_in_gbs": {"key": "minMemoryPerNodeInGbs", "type": "int"}, + "available_db_node_storage_in_gbs": {"key": "availableDbNodeStorageInGbs", "type": "int"}, + "min_db_node_storage_per_node_in_gbs": {"key": "minDbNodeStoragePerNodeInGbs", "type": "int"}, + "available_data_storage_in_tbs": {"key": "availableDataStorageInTbs", "type": "int"}, + "min_data_storage_in_tbs": {"key": "minDataStorageInTbs", "type": "int"}, + "minimum_node_count": {"key": "minimumNodeCount", "type": "int"}, + "maximum_node_count": {"key": "maximumNodeCount", "type": "int"}, + "available_core_count_per_node": {"key": "availableCoreCountPerNode", "type": "int"}, + "compute_model": {"key": "computeModel", "type": "str"}, + "are_server_types_supported": {"key": "areServerTypesSupported", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + shape_name: str, + available_core_count: int, + shape_family: Optional[str] = None, + minimum_core_count: Optional[int] = None, + runtime_minimum_core_count: Optional[int] = None, + core_count_increment: Optional[int] = None, + min_storage_count: Optional[int] = None, + max_storage_count: Optional[int] = None, + available_data_storage_per_server_in_tbs: Optional[float] = None, + available_memory_per_node_in_gbs: Optional[int] = None, + available_db_node_per_node_in_gbs: Optional[int] = None, + min_core_count_per_node: Optional[int] = None, + available_memory_in_gbs: Optional[int] = None, + min_memory_per_node_in_gbs: Optional[int] = None, + available_db_node_storage_in_gbs: Optional[int] = None, + min_db_node_storage_per_node_in_gbs: Optional[int] = None, + available_data_storage_in_tbs: Optional[int] = None, + min_data_storage_in_tbs: Optional[int] = None, + minimum_node_count: Optional[int] = None, + maximum_node_count: Optional[int] = None, + available_core_count_per_node: Optional[int] = None, + compute_model: Optional[Union[str, "_models.ComputeModel"]] = None, + are_server_types_supported: Optional[bool] = None, + display_name: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :paramtype storage_size_in_gbs: int - :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :paramtype data_storage_size_in_tbs: float - :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :paramtype db_node_storage_size_in_gbs: int - :keyword memory_size_in_gbs: The memory to be allocated in GBs. - :paramtype memory_size_in_gbs: int - :keyword time_zone: The time zone of the cloud VM cluster. For details, see `Exadata - Infrastructure Time Zones `_. - :paramtype time_zone: str - :keyword zone_id: The OCID of the zone the cloud VM cluster is associated with. - :paramtype zone_id: str - :keyword hostname: The hostname for the cloud VM cluster. Required. - :paramtype hostname: str - :keyword domain: The domain name for the cloud VM cluster. - :paramtype domain: str - :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. Required. - :paramtype cpu_core_count: int - :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :paramtype ocpu_count: float - :keyword cluster_name: The cluster name for cloud VM cluster. The cluster name must begin with - an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The - cluster name can be no longer than 11 characters and is not case sensitive. - :paramtype cluster_name: str - :keyword data_storage_percentage: The percentage assigned to DATA storage (user data and - database files). The remaining percentage is assigned to RECO storage (database redo logs, - archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default - is 80 percent assigned to DATA storage. See `Storage Configuration - `_ in the Exadata documentation for details - on the impact of the configuration settings on storage. - :paramtype data_storage_percentage: int - :keyword is_local_backup_enabled: If true, database backup on local Exadata storage is - configured for the cloud VM cluster. If false, database backup on local Exadata storage is not - available in the cloud VM cluster. - :paramtype is_local_backup_enabled: bool - :keyword cloud_exadata_infrastructure_id: Cloud Exadata Infrastructure ID. Required. - :paramtype cloud_exadata_infrastructure_id: str - :keyword is_sparse_diskgroup_enabled: If true, sparse disk group is configured for the cloud VM - cluster. If false, sparse disk group is not created. - :paramtype is_sparse_diskgroup_enabled: bool - :keyword system_version: Operating system version of the image. - :paramtype system_version: str - :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access - to the cloud VM cluster. Required. - :paramtype ssh_public_keys: list[str] - :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The - default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default - port is 1521. - :paramtype scan_listener_port_tcp: int - :keyword scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The - default port is 2484. - :paramtype scan_listener_port_tcp_ssl: int - :keyword vnet_id: VNET for network connectivity. Required. - :paramtype vnet_id: str - :keyword gi_version: Oracle Grid Infrastructure (GI) software version. Required. - :paramtype gi_version: str - :keyword subnet_id: Client subnet. Required. - :paramtype subnet_id: str - :keyword backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. - :paramtype backup_subnet_cidr: str - :keyword nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to - provision the VM Cluster will be added by default. - :paramtype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] - :keyword data_collection_options: Indicates user preferences for the various diagnostic - collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :keyword display_name: Display Name. Required. + :keyword shape_family: The family of the shape used for the DB system. + :paramtype shape_family: str + :keyword shape_name: The shape used for the DB system. Required. + :paramtype shape_name: str + :keyword available_core_count: The maximum number of CPU cores that can be enabled on the DB + system for this shape. Required. + :paramtype available_core_count: int + :keyword minimum_core_count: The minimum number of CPU cores that can be enabled on the DB + system for this shape. + :paramtype minimum_core_count: int + :keyword runtime_minimum_core_count: The runtime minimum number of CPU cores that can be + enabled on the DB system for this shape. + :paramtype runtime_minimum_core_count: int + :keyword core_count_increment: The discrete number by which the CPU core count for this shape + can be increased or decreased. + :paramtype core_count_increment: int + :keyword min_storage_count: The minimum number of Exadata storage servers available for the + Exadata infrastructure. + :paramtype min_storage_count: int + :keyword max_storage_count: The maximum number of Exadata storage servers available for the + Exadata infrastructure. + :paramtype max_storage_count: int + :keyword available_data_storage_per_server_in_tbs: The maximum data storage available per + storage server for this shape. Only applicable to ExaCC Elastic shapes. + :paramtype available_data_storage_per_server_in_tbs: float + :keyword available_memory_per_node_in_gbs: The maximum memory available per database node for + this shape. Only applicable to ExaCC Elastic shapes. + :paramtype available_memory_per_node_in_gbs: int + :keyword available_db_node_per_node_in_gbs: The maximum Db Node storage available per database + node for this shape. Only applicable to ExaCC Elastic shapes. + :paramtype available_db_node_per_node_in_gbs: int + :keyword min_core_count_per_node: The minimum number of CPU cores that can be enabled per node + for this shape. + :paramtype min_core_count_per_node: int + :keyword available_memory_in_gbs: The maximum memory that can be enabled for this shape. + :paramtype available_memory_in_gbs: int + :keyword min_memory_per_node_in_gbs: The minimum memory that need be allocated per node for + this shape. + :paramtype min_memory_per_node_in_gbs: int + :keyword available_db_node_storage_in_gbs: The maximum Db Node storage that can be enabled for + this shape. + :paramtype available_db_node_storage_in_gbs: int + :keyword min_db_node_storage_per_node_in_gbs: The minimum Db Node storage that need be + allocated per node for this shape. + :paramtype min_db_node_storage_per_node_in_gbs: int + :keyword available_data_storage_in_tbs: The maximum DATA storage that can be enabled for this + shape. + :paramtype available_data_storage_in_tbs: int + :keyword min_data_storage_in_tbs: The minimum data storage that need be allocated for this + shape. + :paramtype min_data_storage_in_tbs: int + :keyword minimum_node_count: The minimum number of database nodes available for this shape. + :paramtype minimum_node_count: int + :keyword maximum_node_count: The maximum number of database nodes available for this shape. + :paramtype maximum_node_count: int + :keyword available_core_count_per_node: The maximum number of CPU cores per database node that + can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic + shapes. + :paramtype available_core_count_per_node: int + :keyword compute_model: The compute model of the Exadata Infrastructure. Known values are: + "ECPU" and "OCPU". + :paramtype compute_model: str or ~azure.mgmt.oracledatabase.models.ComputeModel + :keyword are_server_types_supported: Indicates if the shape supports database and storage + server types. + :paramtype are_server_types_supported: bool + :keyword display_name: The display name of the shape used for the DB system. :paramtype display_name: str - :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :paramtype compute_nodes: list[str] - :keyword db_servers: The list of DB servers. - :paramtype db_servers: list[str] """ super().__init__(**kwargs) - self.ocid = None - self.listener_port = None - self.node_count = None - self.storage_size_in_gbs = storage_size_in_gbs - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs - self.memory_size_in_gbs = memory_size_in_gbs - self.time_created = None - self.lifecycle_details = None - self.time_zone = time_zone - self.zone_id = zone_id - self.hostname = hostname - self.domain = domain - self.cpu_core_count = cpu_core_count - self.ocpu_count = ocpu_count - self.cluster_name = cluster_name - self.data_storage_percentage = data_storage_percentage - self.is_local_backup_enabled = is_local_backup_enabled - self.cloud_exadata_infrastructure_id = cloud_exadata_infrastructure_id - self.is_sparse_diskgroup_enabled = is_sparse_diskgroup_enabled - self.system_version = system_version - self.ssh_public_keys = ssh_public_keys - self.license_model = license_model - self.disk_redundancy = None - self.scan_ip_ids = None - self.vip_ids = None - self.scan_dns_name = None - self.scan_listener_port_tcp = scan_listener_port_tcp - self.scan_listener_port_tcp_ssl = scan_listener_port_tcp_ssl - self.scan_dns_record_id = None - self.shape = None - self.provisioning_state = None - self.lifecycle_state = None - self.vnet_id = vnet_id - self.gi_version = gi_version - self.oci_url = None - self.nsg_url = None - self.subnet_id = subnet_id - self.backup_subnet_cidr = backup_subnet_cidr - self.nsg_cidrs = nsg_cidrs - self.data_collection_options = data_collection_options + self.shape_family = shape_family + self.shape_name = shape_name + self.available_core_count = available_core_count + self.minimum_core_count = minimum_core_count + self.runtime_minimum_core_count = runtime_minimum_core_count + self.core_count_increment = core_count_increment + self.min_storage_count = min_storage_count + self.max_storage_count = max_storage_count + self.available_data_storage_per_server_in_tbs = available_data_storage_per_server_in_tbs + self.available_memory_per_node_in_gbs = available_memory_per_node_in_gbs + self.available_db_node_per_node_in_gbs = available_db_node_per_node_in_gbs + self.min_core_count_per_node = min_core_count_per_node + self.available_memory_in_gbs = available_memory_in_gbs + self.min_memory_per_node_in_gbs = min_memory_per_node_in_gbs + self.available_db_node_storage_in_gbs = available_db_node_storage_in_gbs + self.min_db_node_storage_per_node_in_gbs = min_db_node_storage_per_node_in_gbs + self.available_data_storage_in_tbs = available_data_storage_in_tbs + self.min_data_storage_in_tbs = min_data_storage_in_tbs + self.minimum_node_count = minimum_node_count + self.maximum_node_count = maximum_node_count + self.available_core_count_per_node = available_core_count_per_node + self.compute_model = compute_model + self.are_server_types_supported = are_server_types_supported self.display_name = display_name - self.compute_nodes = compute_nodes - self.iorm_config_cache = None - self.last_update_history_entry_id = None - self.db_servers = db_servers - self.compartment_id = None - self.subnet_ocid = None -class CloudVmClusterUpdate(_serialization.Model): - """The type used for update operations of the CloudVmCluster. +class DefinedFileSystemConfiguration(_serialization.Model): + """Predefined configurations for the file system. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: The updatable properties of the CloudVmCluster. - :vartype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties + :ivar is_backup_partition: Checks if the data can be backed up. + :vartype is_backup_partition: bool + :ivar is_resizable: Checks if the mount path is resizable. + :vartype is_resizable: bool + :ivar min_size_gb: Minimum size of mount path in Gb. + :vartype min_size_gb: int + :ivar mount_point: Mount path for the file system. + :vartype mount_point: str """ _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "CloudVmClusterUpdateProperties"}, + "is_backup_partition": {"key": "isBackupPartition", "type": "bool"}, + "is_resizable": {"key": "isResizable", "type": "bool"}, + "min_size_gb": {"key": "minSizeGb", "type": "int"}, + "mount_point": {"key": "mountPoint", "type": "str"}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CloudVmClusterUpdateProperties"] = None, + is_backup_partition: Optional[bool] = None, + is_resizable: Optional[bool] = None, + min_size_gb: Optional[int] = None, + mount_point: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: The updatable properties of the CloudVmCluster. - :paramtype properties: ~azure.mgmt.oracledatabase.models.CloudVmClusterUpdateProperties + :keyword is_backup_partition: Checks if the data can be backed up. + :paramtype is_backup_partition: bool + :keyword is_resizable: Checks if the mount path is resizable. + :paramtype is_resizable: bool + :keyword min_size_gb: Minimum size of mount path in Gb. + :paramtype min_size_gb: int + :keyword mount_point: Mount path for the file system. + :paramtype mount_point: str + """ + super().__init__(**kwargs) + self.is_backup_partition = is_backup_partition + self.is_resizable = is_resizable + self.min_size_gb = min_size_gb + self.mount_point = mount_point + + +class DisasterRecoveryConfigurationDetails(_serialization.Model): + """Configurations of a Disaster Recovery Details. + + :ivar disaster_recovery_type: Indicates the disaster recovery (DR) type of the Autonomous + Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR + with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type + provides lower cost DR with a slower RTO during failover or switchover. Known values are: "Adg" + and "BackupBased". + :vartype disaster_recovery_type: str or ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :ivar time_snapshot_standby_enabled_till: Time and date stored as an RFC 3339 formatted + timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot + standby to be converted back to a cross-region standby database. + :vartype time_snapshot_standby_enabled_till: ~datetime.datetime + :ivar is_snapshot_standby: Indicates if user wants to convert to a snapshot standby. For + example, true would set a standby database to snapshot standby database. False would set a + snapshot standby database back to regular standby database. + :vartype is_snapshot_standby: bool + :ivar is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :vartype is_replicate_automatic_backups: bool + """ + + _attribute_map = { + "disaster_recovery_type": {"key": "disasterRecoveryType", "type": "str"}, + "time_snapshot_standby_enabled_till": {"key": "timeSnapshotStandbyEnabledTill", "type": "iso-8601"}, + "is_snapshot_standby": {"key": "isSnapshotStandby", "type": "bool"}, + "is_replicate_automatic_backups": {"key": "isReplicateAutomaticBackups", "type": "bool"}, + } + + def __init__( + self, + *, + disaster_recovery_type: Optional[Union[str, "_models.DisasterRecoveryType"]] = None, + time_snapshot_standby_enabled_till: Optional[datetime.datetime] = None, + is_snapshot_standby: Optional[bool] = None, + is_replicate_automatic_backups: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword disaster_recovery_type: Indicates the disaster recovery (DR) type of the Autonomous + Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR + with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type + provides lower cost DR with a slower RTO during failover or switchover. Known values are: "Adg" + and "BackupBased". + :paramtype disaster_recovery_type: str or + ~azure.mgmt.oracledatabase.models.DisasterRecoveryType + :keyword time_snapshot_standby_enabled_till: Time and date stored as an RFC 3339 formatted + timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot + standby to be converted back to a cross-region standby database. + :paramtype time_snapshot_standby_enabled_till: ~datetime.datetime + :keyword is_snapshot_standby: Indicates if user wants to convert to a snapshot standby. For + example, true would set a standby database to snapshot standby database. False would set a + snapshot standby database back to regular standby database. + :paramtype is_snapshot_standby: bool + :keyword is_replicate_automatic_backups: If true, 7 days worth of backups are replicated across + regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the + backups taken on the Primary are not replicated to the Standby database. + :paramtype is_replicate_automatic_backups: bool + """ + super().__init__(**kwargs) + self.disaster_recovery_type = disaster_recovery_type + self.time_snapshot_standby_enabled_till = time_snapshot_standby_enabled_till + self.is_snapshot_standby = is_snapshot_standby + self.is_replicate_automatic_backups = is_replicate_automatic_backups + + +class DnsPrivateView(ProxyResource): + """DnsPrivateView resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "DnsPrivateViewProperties"}, + } + + def __init__(self, *, properties: Optional["_models.DnsPrivateViewProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties """ super().__init__(**kwargs) - self.tags = tags self.properties = properties -class CloudVmClusterUpdateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The updatable properties of the CloudVmCluster. +class DnsPrivateViewListResult(_serialization.Model): + """The response of a DnsPrivateView list operation. - :ivar storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :vartype storage_size_in_gbs: int - :ivar data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :vartype data_storage_size_in_tbs: float - :ivar db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :vartype db_node_storage_size_in_gbs: int - :ivar memory_size_in_gbs: The memory to be allocated in GBs. - :vartype memory_size_in_gbs: int - :ivar cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. - :vartype cpu_core_count: int - :ivar ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :vartype ocpu_count: float - :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to - the cloud VM cluster. - :vartype ssh_public_keys: list[str] - :ivar license_model: The Oracle license model that applies to the cloud VM cluster. The default - is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :ivar data_collection_options: Indicates user preferences for the various diagnostic collection - options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :ivar display_name: Display Name. - :vartype display_name: str - :ivar compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :vartype compute_nodes: list[str] + All required parameters must be populated in order to send to server. + + :ivar value: The DnsPrivateView items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DnsPrivateView]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.DnsPrivateView"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The DnsPrivateView items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DnsPrivateViewProperties(_serialization.Model): + """Views resource model. + + 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 ocid: The OCID of the view. Required. + :vartype ocid: str + :ivar display_name: The display name of the view resource. Required. + :vartype display_name: str + :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable + to be explicitly managed. Required. + :vartype is_protected: bool + :ivar lifecycle_state: Views lifecycleState. Required. Known values are: "Active", "Deleted", + "Deleting", and "Updating". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState + :ivar self_property: The canonical absolute URL of the resource. Required. + :vartype self_property: str + :ivar time_created: views timeCreated. Required. + :vartype time_created: ~datetime.datetime + :ivar time_updated: views timeCreated. Required. + :vartype time_updated: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState """ _validation = { - "display_name": {"max_length": 255, "min_length": 1}, + "ocid": {"required": True, "max_length": 255, "min_length": 1}, + "display_name": {"required": True}, + "is_protected": {"required": True}, + "lifecycle_state": {"required": True}, + "self_property": {"required": True}, + "time_created": {"required": True}, + "time_updated": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - "storage_size_in_gbs": {"key": "storageSizeInGbs", "type": "int"}, - "data_storage_size_in_tbs": {"key": "dataStorageSizeInTbs", "type": "float"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "ocpu_count": {"key": "ocpuCount", "type": "float"}, - "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, - "license_model": {"key": "licenseModel", "type": "str"}, - "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, + "ocid": {"key": "ocid", "type": "str"}, "display_name": {"key": "displayName", "type": "str"}, - "compute_nodes": {"key": "computeNodes", "type": "[str]"}, + "is_protected": {"key": "isProtected", "type": "bool"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "self_property": {"key": "self", "type": "str"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "time_updated": {"key": "timeUpdated", "type": "iso-8601"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( self, *, - storage_size_in_gbs: Optional[int] = None, - data_storage_size_in_tbs: Optional[float] = None, - db_node_storage_size_in_gbs: Optional[int] = None, - memory_size_in_gbs: Optional[int] = None, - cpu_core_count: Optional[int] = None, - ocpu_count: Optional[float] = None, - ssh_public_keys: Optional[List[str]] = None, - license_model: Optional[Union[str, "_models.LicenseModel"]] = None, - data_collection_options: Optional["_models.DataCollectionOptions"] = None, - display_name: Optional[str] = None, - compute_nodes: Optional[List[str]] = None, + ocid: str, + display_name: str, + is_protected: bool, + lifecycle_state: Union[str, "_models.DnsPrivateViewsLifecycleState"], + self_property: str, + time_created: datetime.datetime, + time_updated: datetime.datetime, **kwargs: Any ) -> None: """ - :keyword storage_size_in_gbs: The data disk group size to be allocated in GBs per VM. - :paramtype storage_size_in_gbs: int - :keyword data_storage_size_in_tbs: The data disk group size to be allocated in TBs. - :paramtype data_storage_size_in_tbs: float - :keyword db_node_storage_size_in_gbs: The local node storage to be allocated in GBs. - :paramtype db_node_storage_size_in_gbs: int - :keyword memory_size_in_gbs: The memory to be allocated in GBs. - :paramtype memory_size_in_gbs: int - :keyword cpu_core_count: The number of CPU cores enabled on the cloud VM cluster. - :paramtype cpu_core_count: int - :keyword ocpu_count: The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal - place is allowed for the fractional part. - :paramtype ocpu_count: float - :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access - to the cloud VM cluster. - :paramtype ssh_public_keys: list[str] - :keyword license_model: The Oracle license model that applies to the cloud VM cluster. The - default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" and "BringYourOwnLicense". - :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel - :keyword data_collection_options: Indicates user preferences for the various diagnostic - collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions - :keyword display_name: Display Name. + :keyword ocid: The OCID of the view. Required. + :paramtype ocid: str + :keyword display_name: The display name of the view resource. Required. :paramtype display_name: str - :keyword compute_nodes: The list of compute servers to be added to the cloud VM cluster. - :paramtype compute_nodes: list[str] + :keyword is_protected: A Boolean flag indicating whether or not parts of the resource are + unable to be explicitly managed. Required. + :paramtype is_protected: bool + :keyword lifecycle_state: Views lifecycleState. Required. Known values are: "Active", + "Deleted", "Deleting", and "Updating". + :paramtype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState + :keyword self_property: The canonical absolute URL of the resource. Required. + :paramtype self_property: str + :keyword time_created: views timeCreated. Required. + :paramtype time_created: ~datetime.datetime + :keyword time_updated: views timeCreated. Required. + :paramtype time_updated: ~datetime.datetime """ super().__init__(**kwargs) - self.storage_size_in_gbs = storage_size_in_gbs - self.data_storage_size_in_tbs = data_storage_size_in_tbs - self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs - self.memory_size_in_gbs = memory_size_in_gbs - self.cpu_core_count = cpu_core_count - self.ocpu_count = ocpu_count - self.ssh_public_keys = ssh_public_keys - self.license_model = license_model - self.data_collection_options = data_collection_options + self.ocid = ocid self.display_name = display_name - self.compute_nodes = compute_nodes + self.is_protected = is_protected + self.lifecycle_state = lifecycle_state + self.self_property = self_property + self.time_created = time_created + self.time_updated = time_updated + self.provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = None -class ConnectionStringType(_serialization.Model): - """Connection strings to connect to an Oracle Autonomous Database. +class DnsPrivateZone(ProxyResource): + """DnsPrivateZone resource definition. - :ivar all_connection_strings: Returns all connection strings that can be used to connect to the - Autonomous Database. - :vartype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType - :ivar dedicated: The database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :vartype dedicated: str - :ivar high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :vartype high: str - :ivar low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :vartype low: str - :ivar medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :vartype medium: str - :ivar profiles: A list of connection string profiles to allow clients to group, filter and - select connection string values based on structured metadata. - :vartype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties """ _validation = { - "dedicated": {"max_length": 255, "min_length": 10}, - "high": {"max_length": 255, "min_length": 10}, - "low": {"max_length": 255, "min_length": 10}, - "medium": {"max_length": 255, "min_length": 10}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - "all_connection_strings": {"key": "allConnectionStrings", "type": "AllConnectionStringType"}, - "dedicated": {"key": "dedicated", "type": "str"}, - "high": {"key": "high", "type": "str"}, - "low": {"key": "low", "type": "str"}, - "medium": {"key": "medium", "type": "str"}, - "profiles": {"key": "profiles", "type": "[ProfileType]"}, + "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": "DnsPrivateZoneProperties"}, + } + + def __init__(self, *, properties: Optional["_models.DnsPrivateZoneProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class DnsPrivateZoneListResult(_serialization.Model): + """The response of a DnsPrivateZone list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The DnsPrivateZone items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[DnsPrivateZone]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - all_connection_strings: Optional["_models.AllConnectionStringType"] = None, - dedicated: Optional[str] = None, - high: Optional[str] = None, - low: Optional[str] = None, - medium: Optional[str] = None, - profiles: Optional[List["_models.ProfileType"]] = None, - **kwargs: Any + self, *, value: List["_models.DnsPrivateZone"], next_link: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword all_connection_strings: Returns all connection strings that can be used to connect to - the Autonomous Database. - :paramtype all_connection_strings: ~azure.mgmt.oracledatabase.models.AllConnectionStringType - :keyword dedicated: The database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :paramtype dedicated: str - :keyword high: The High database service provides the highest level of resources to each SQL - statement resulting in the highest performance, but supports the fewest number of concurrent - SQL statements. - :paramtype high: str - :keyword low: The Low database service provides the least level of resources to each SQL - statement, but supports the most number of concurrent SQL statements. - :paramtype low: str - :keyword medium: The Medium database service provides a lower level of resources to each SQL - statement potentially resulting a lower level of performance, but supports more concurrent SQL - statements. - :paramtype medium: str - :keyword profiles: A list of connection string profiles to allow clients to group, filter and - select connection string values based on structured metadata. - :paramtype profiles: list[~azure.mgmt.oracledatabase.models.ProfileType] + :keyword value: The DnsPrivateZone items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.all_connection_strings = all_connection_strings - self.dedicated = dedicated - self.high = high - self.low = low - self.medium = medium - self.profiles = profiles + self.value = value + self.next_link = next_link -class ConnectionUrlType(_serialization.Model): - """The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser - from a Compute instance within your VCN or that has a direct connection to your VCN. +class DnsPrivateZoneProperties(_serialization.Model): + """Zones resource model. - :ivar apex_url: Oracle Application Express (APEX) URL. - :vartype apex_url: str - :ivar database_transforms_url: The URL of the Database Transforms for the Autonomous Database. - :vartype database_transforms_url: str - :ivar graph_studio_url: The URL of the Graph Studio for the Autonomous Database. - :vartype graph_studio_url: str - :ivar machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook for - the Autonomous Database. - :vartype machine_learning_notebook_url: str - :ivar mongo_db_url: The URL of the MongoDB API for the Autonomous Database. - :vartype mongo_db_url: str - :ivar ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous - Database. - :vartype ords_url: str - :ivar sql_dev_web_url: Oracle SQL Developer Web URL. - :vartype sql_dev_web_url: str + 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 ocid: The OCID of the Zone. Required. + :vartype ocid: str + :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable + to be explicitly managed. Required. + :vartype is_protected: bool + :ivar lifecycle_state: Zones lifecycleState. Required. Known values are: "Active", "Creating", + "Deleted", "Deleting", and "Updating". + :vartype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState + :ivar self_property: The canonical absolute URL of the resource. Required. + :vartype self_property: str + :ivar serial: The current serial of the zone. As seen in the zone's SOA record. Required. + :vartype serial: int + :ivar version: Version is the never-repeating, totally-orderable, version of the zone, from + which the serial field of the zone's SOA record is derived. Required. + :vartype version: str + :ivar view_id: The OCID of the private view containing the zone. This value will be null for + zones in the global DNS, which are publicly resolvable and not part of a private view. + :vartype view_id: str + :ivar zone_type: The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only + supported for GLOBAL zones. Required. Known values are: "Primary" and "Secondary". + :vartype zone_type: str or ~azure.mgmt.oracledatabase.models.ZoneType + :ivar time_created: Zones timeCreated. Required. + :vartype time_created: ~datetime.datetime + :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState """ _validation = { - "apex_url": {"max_length": 512, "min_length": 10}, - "database_transforms_url": {"max_length": 512, "min_length": 10}, - "graph_studio_url": {"max_length": 512, "min_length": 10}, - "machine_learning_notebook_url": {"max_length": 512, "min_length": 10}, - "mongo_db_url": {"max_length": 512, "min_length": 10}, - "ords_url": {"max_length": 512, "min_length": 10}, - "sql_dev_web_url": {"max_length": 512, "min_length": 10}, + "ocid": {"required": True, "max_length": 255, "min_length": 1}, + "is_protected": {"required": True}, + "lifecycle_state": {"required": True}, + "self_property": {"required": True}, + "serial": {"required": True}, + "version": {"required": True}, + "view_id": {"max_length": 255, "min_length": 1}, + "zone_type": {"required": True}, + "time_created": {"required": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - "apex_url": {"key": "apexUrl", "type": "str"}, - "database_transforms_url": {"key": "databaseTransformsUrl", "type": "str"}, - "graph_studio_url": {"key": "graphStudioUrl", "type": "str"}, - "machine_learning_notebook_url": {"key": "machineLearningNotebookUrl", "type": "str"}, - "mongo_db_url": {"key": "mongoDbUrl", "type": "str"}, - "ords_url": {"key": "ordsUrl", "type": "str"}, - "sql_dev_web_url": {"key": "sqlDevWebUrl", "type": "str"}, + "ocid": {"key": "ocid", "type": "str"}, + "is_protected": {"key": "isProtected", "type": "bool"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "self_property": {"key": "self", "type": "str"}, + "serial": {"key": "serial", "type": "int"}, + "version": {"key": "version", "type": "str"}, + "view_id": {"key": "viewId", "type": "str"}, + "zone_type": {"key": "zoneType", "type": "str"}, + "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, } def __init__( self, *, - apex_url: Optional[str] = None, - database_transforms_url: Optional[str] = None, - graph_studio_url: Optional[str] = None, - machine_learning_notebook_url: Optional[str] = None, - mongo_db_url: Optional[str] = None, - ords_url: Optional[str] = None, - sql_dev_web_url: Optional[str] = None, + ocid: str, + is_protected: bool, + lifecycle_state: Union[str, "_models.DnsPrivateZonesLifecycleState"], + self_property: str, + serial: int, + version: str, + zone_type: Union[str, "_models.ZoneType"], + time_created: datetime.datetime, + view_id: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword apex_url: Oracle Application Express (APEX) URL. - :paramtype apex_url: str - :keyword database_transforms_url: The URL of the Database Transforms for the Autonomous - Database. - :paramtype database_transforms_url: str - :keyword graph_studio_url: The URL of the Graph Studio for the Autonomous Database. - :paramtype graph_studio_url: str - :keyword machine_learning_notebook_url: The URL of the Oracle Machine Learning (OML) Notebook - for the Autonomous Database. - :paramtype machine_learning_notebook_url: str - :keyword mongo_db_url: The URL of the MongoDB API for the Autonomous Database. - :paramtype mongo_db_url: str - :keyword ords_url: The Oracle REST Data Services (ORDS) URL of the Web Access for the - Autonomous Database. - :paramtype ords_url: str - :keyword sql_dev_web_url: Oracle SQL Developer Web URL. - :paramtype sql_dev_web_url: str + :keyword ocid: The OCID of the Zone. Required. + :paramtype ocid: str + :keyword is_protected: A Boolean flag indicating whether or not parts of the resource are + unable to be explicitly managed. Required. + :paramtype is_protected: bool + :keyword lifecycle_state: Zones lifecycleState. Required. Known values are: "Active", + "Creating", "Deleted", "Deleting", and "Updating". + :paramtype lifecycle_state: str or + ~azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState + :keyword self_property: The canonical absolute URL of the resource. Required. + :paramtype self_property: str + :keyword serial: The current serial of the zone. As seen in the zone's SOA record. Required. + :paramtype serial: int + :keyword version: Version is the never-repeating, totally-orderable, version of the zone, from + which the serial field of the zone's SOA record is derived. Required. + :paramtype version: str + :keyword view_id: The OCID of the private view containing the zone. This value will be null for + zones in the global DNS, which are publicly resolvable and not part of a private view. + :paramtype view_id: str + :keyword zone_type: The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is + only supported for GLOBAL zones. Required. Known values are: "Primary" and "Secondary". + :paramtype zone_type: str or ~azure.mgmt.oracledatabase.models.ZoneType + :keyword time_created: Zones timeCreated. Required. + :paramtype time_created: ~datetime.datetime """ super().__init__(**kwargs) - self.apex_url = apex_url - self.database_transforms_url = database_transforms_url - self.graph_studio_url = graph_studio_url - self.machine_learning_notebook_url = machine_learning_notebook_url - self.mongo_db_url = mongo_db_url - self.ords_url = ords_url - self.sql_dev_web_url = sql_dev_web_url + self.ocid = ocid + self.is_protected = is_protected + self.lifecycle_state = lifecycle_state + self.self_property = self_property + self.serial = serial + self.version = version + self.view_id = view_id + self.zone_type = zone_type + self.time_created = time_created + self.provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = None -class CustomerContact(_serialization.Model): - """CustomerContact resource properties. +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar email: The email address used by Oracle to send notifications regarding databases and - infrastructure. Required. - :vartype email: str + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON """ _validation = { - "email": {"required": True, "max_length": 320, "min_length": 1}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - "email": {"key": "email", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__(self, *, email: str, **kwargs: Any) -> None: - """ - :keyword email: The email address used by Oracle to send notifications regarding databases and - infrastructure. Required. - :paramtype email: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.email = email + self.type: Optional[str] = None + self.info: Optional[JSON] = None -class DataCollectionOptions(_serialization.Model): - """DataCollectionOptions resource properties. +class ErrorDetail(_serialization.Model): + """The error detail. - :ivar is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for the - VM cluster/Cloud VM cluster/VMBM DBCS. - :vartype is_diagnostics_events_enabled: bool - :ivar is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the VM - cluster / Cloud VM cluster / VMBM DBCS. - :vartype is_health_monitoring_enabled: bool - :ivar is_incident_logs_enabled: Indicates whether incident logs and trace collection are - enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - :vartype is_incident_logs_enabled: bool + Variables are only populated by the server, and will be ignored when sending a request. + + :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.oracledatabase.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.oracledatabase.models.ErrorAdditionalInfo] """ + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + _attribute_map = { - "is_diagnostics_events_enabled": {"key": "isDiagnosticsEventsEnabled", "type": "bool"}, - "is_health_monitoring_enabled": {"key": "isHealthMonitoringEnabled", "type": "bool"}, - "is_incident_logs_enabled": {"key": "isIncidentLogsEnabled", "type": "bool"}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - *, - is_diagnostics_events_enabled: bool = False, - is_health_monitoring_enabled: bool = False, - is_incident_logs_enabled: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword is_diagnostics_events_enabled: Indicates whether diagnostic collection is enabled for - the VM cluster/Cloud VM cluster/VMBM DBCS. - :paramtype is_diagnostics_events_enabled: bool - :keyword is_health_monitoring_enabled: Indicates whether health monitoring is enabled for the - VM cluster / Cloud VM cluster / VMBM DBCS. - :paramtype is_health_monitoring_enabled: bool - :keyword is_incident_logs_enabled: Indicates whether incident logs and trace collection are - enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. - :paramtype is_incident_logs_enabled: bool - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.is_diagnostics_events_enabled = is_diagnostics_events_enabled - self.is_health_monitoring_enabled = is_health_monitoring_enabled - self.is_incident_logs_enabled = is_incident_logs_enabled + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None -class DayOfWeek(_serialization.Model): - """DayOfWeek resource properties. - - All required parameters must be populated in order to send to server. +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). - :ivar name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". - :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + :ivar error: The error object. + :vartype error: ~azure.mgmt.oracledatabase.models.ErrorDetail """ - _validation = { - "name": {"required": True}, - } - _attribute_map = { - "name": {"key": "name", "type": "str"}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, name: Union[str, "_models.DayOfWeekName"], **kwargs: Any) -> None: + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ - :keyword name: Name of the day of the week. Required. Known values are: "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday", and "Sunday". - :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + :keyword error: The error object. + :paramtype error: ~azure.mgmt.oracledatabase.models.ErrorDetail """ super().__init__(**kwargs) - self.name = name + self.error = error -class DayOfWeekUpdate(_serialization.Model): - """DayOfWeek resource properties. +class EstimatedPatchingTime(_serialization.Model): + """The estimated total time required in minutes for all patching operations (database server, + storage server, and network switch patching). - :ivar name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday", and "Sunday". - :vartype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar estimated_db_server_patching_time: The estimated time required in minutes for database + server patching. + :vartype estimated_db_server_patching_time: int + :ivar estimated_network_switches_patching_time: The estimated time required in minutes for + network switch patching. + :vartype estimated_network_switches_patching_time: int + :ivar estimated_storage_server_patching_time: The estimated time required in minutes for + storage server patching. + :vartype estimated_storage_server_patching_time: int + :ivar total_estimated_patching_time: The estimated total time required in minutes for all + patching operations. + :vartype total_estimated_patching_time: int """ + _validation = { + "estimated_db_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, + "estimated_network_switches_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, + "estimated_storage_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, + "total_estimated_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, + } + _attribute_map = { - "name": {"key": "name", "type": "str"}, + "estimated_db_server_patching_time": {"key": "estimatedDbServerPatchingTime", "type": "int"}, + "estimated_network_switches_patching_time": {"key": "estimatedNetworkSwitchesPatchingTime", "type": "int"}, + "estimated_storage_server_patching_time": {"key": "estimatedStorageServerPatchingTime", "type": "int"}, + "total_estimated_patching_time": {"key": "totalEstimatedPatchingTime", "type": "int"}, } - def __init__(self, *, name: Optional[Union[str, "_models.DayOfWeekName"]] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the day of the week. Known values are: "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday", and "Sunday". - :paramtype name: str or ~azure.mgmt.oracledatabase.models.DayOfWeekName - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name + self.estimated_db_server_patching_time: Optional[int] = None + self.estimated_network_switches_patching_time: Optional[int] = None + self.estimated_storage_server_patching_time: Optional[int] = None + self.total_estimated_patching_time: Optional[int] = None -class DbIormConfig(_serialization.Model): - """DbIormConfig for cloud vm cluster. +class ExadataIormConfig(_serialization.Model): + """ExadataIormConfig for cloud vm cluster. - :ivar db_name: The database name. For the default DbPlan, the dbName is default. - :vartype db_name: str - :ivar flash_cache_limit: The flash cache limit for this database. This value is internally - configured based on the share value assigned to the database. - :vartype flash_cache_limit: str - :ivar share: The relative priority of this database. - :vartype share: int + :ivar db_plans: An array of IORM settings for all the database in the Exadata DB system. + :vartype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] + :ivar lifecycle_details: Additional information about the current lifecycleState. + :vartype lifecycle_details: str + :ivar lifecycle_state: The current state of IORM configuration for the Exadata DB system. Known + values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState + :ivar objective: The current value for the IORM objective. The default is AUTO. Known values + are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". + :vartype objective: str or ~azure.mgmt.oracledatabase.models.Objective """ - _validation = { - "share": {"maximum": 32, "minimum": 1}, - } - _attribute_map = { - "db_name": {"key": "dbName", "type": "str"}, - "flash_cache_limit": {"key": "flashCacheLimit", "type": "str"}, - "share": {"key": "share", "type": "int"}, + "db_plans": {"key": "dbPlans", "type": "[DbIormConfig]"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "objective": {"key": "objective", "type": "str"}, } def __init__( self, *, - db_name: Optional[str] = None, - flash_cache_limit: Optional[str] = None, - share: Optional[int] = None, + db_plans: Optional[List["_models.DbIormConfig"]] = None, + lifecycle_details: Optional[str] = None, + lifecycle_state: Optional[Union[str, "_models.IormLifecycleState"]] = None, + objective: Optional[Union[str, "_models.Objective"]] = None, **kwargs: Any ) -> None: """ - :keyword db_name: The database name. For the default DbPlan, the dbName is default. - :paramtype db_name: str - :keyword flash_cache_limit: The flash cache limit for this database. This value is internally - configured based on the share value assigned to the database. - :paramtype flash_cache_limit: str - :keyword share: The relative priority of this database. - :paramtype share: int + :keyword db_plans: An array of IORM settings for all the database in the Exadata DB system. + :paramtype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] + :keyword lifecycle_details: Additional information about the current lifecycleState. + :paramtype lifecycle_details: str + :keyword lifecycle_state: The current state of IORM configuration for the Exadata DB system. + Known values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". + :paramtype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState + :keyword objective: The current value for the IORM objective. The default is AUTO. Known values + are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". + :paramtype objective: str or ~azure.mgmt.oracledatabase.models.Objective """ super().__init__(**kwargs) - self.db_name = db_name - self.flash_cache_limit = flash_cache_limit - self.share = share + self.db_plans = db_plans + self.lifecycle_details = lifecycle_details + self.lifecycle_state = lifecycle_state + self.objective = objective -class DbNode(ProxyResource): - """The DbNode resource belonging to vmCluster. +class ExadbVmCluster(TrackedResource): + """ExadbVmCluster resource 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 id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4436,8 +7349,14 @@ class DbNode(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.oracledatabase.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 resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties + :vartype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterProperties + :ivar zones: The availability zones. + :vartype zones: list[str] """ _validation = { @@ -4445,6 +7364,7 @@ class DbNode(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { @@ -4452,52 +7372,43 @@ class DbNode(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DbNodeProperties"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ExadbVmClusterProperties"}, + "zones": {"key": "zones", "type": "[str]"}, } - def __init__(self, *, properties: Optional["_models.DbNodeProperties"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExadbVmClusterProperties"] = None, + zones: Optional[List[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 :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbNodeProperties + :paramtype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterProperties + :keyword zones: The availability zones. + :paramtype zones: list[str] """ - super().__init__(**kwargs) + super().__init__(tags=tags, location=location, **kwargs) self.properties = properties + self.zones = zones -class DbNodeAction(_serialization.Model): - """DbNode action object. - - All required parameters must be populated in order to send to server. - - :ivar action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and "Reset". - :vartype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum - """ - - _validation = { - "action": {"required": True}, - } - - _attribute_map = { - "action": {"key": "action", "type": "str"}, - } - - def __init__(self, *, action: Union[str, "_models.DbNodeActionEnum"], **kwargs: Any) -> None: - """ - :keyword action: Db action. Required. Known values are: "Start", "Stop", "SoftReset", and - "Reset". - :paramtype action: str or ~azure.mgmt.oracledatabase.models.DbNodeActionEnum - """ - super().__init__(**kwargs) - self.action = action - - -class DbNodeListResult(_serialization.Model): - """The response of a DbNode list operation. +class ExadbVmClusterListResult(_serialization.Model): + """The response of a ExadbVmCluster list operation. All required parameters must be populated in order to send to server. - :ivar value: The DbNode items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbNode] + :ivar value: The ExadbVmCluster items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.ExadbVmCluster] :ivar next_link: The link to the next page of items. :vartype next_link: str """ @@ -4507,14 +7418,16 @@ class DbNodeListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[DbNode]"}, + "value": {"key": "value", "type": "[ExadbVmCluster]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.DbNode"], next_link: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, value: List["_models.ExadbVmCluster"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword value: The DbNode items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbNode] + :keyword value: The ExadbVmCluster items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.ExadbVmCluster] :keyword next_link: The link to the next page of items. :paramtype next_link: str """ @@ -4523,390 +7436,458 @@ def __init__(self, *, value: List["_models.DbNode"], next_link: Optional[str] = self.next_link = next_link -class DbNodeProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The properties of DbNodeResource. +class ExadbVmClusterProperties(_serialization.Model): + """ExadbVmCluster resource model. 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 ocid: DbNode OCID. Required. + :ivar ocid: ExadbVmCluster ocid. :vartype ocid: str - :ivar additional_details: Additional information about the planned maintenance. - :vartype additional_details: str - :ivar backup_ip_id: The OCID of the backup IP address associated with the database node. - :vartype backup_ip_id: str - :ivar backup_vnic2_id: The OCID of the second backup VNIC. - :vartype backup_vnic2_id: str - :ivar backup_vnic_id: The OCID of the backup VNIC. - :vartype backup_vnic_id: str - :ivar cpu_core_count: The number of CPU cores enabled on the Db node. - :vartype cpu_core_count: int - :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. - :vartype db_node_storage_size_in_gbs: int - :ivar db_server_id: The OCID of the Exacc Db server associated with the database node. - :vartype db_server_id: str - :ivar db_system_id: The OCID of the DB system. Required. - :vartype db_system_id: str - :ivar fault_domain: The name of the Fault Domain the instance is contained in. - :vartype fault_domain: str - :ivar host_ip_id: The OCID of the host IP address associated with the database node. - :vartype host_ip_id: str - :ivar hostname: The host name for the database node. + :ivar cluster_name: The cluster name for Exadata VM cluster on Exascale Infrastructure. The + cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores + (_) are not permitted. The cluster name can be no longer than 11 characters and is not case + sensitive. + :vartype cluster_name: str + :ivar backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :vartype backup_subnet_cidr: str + :ivar nsg_url: HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure + Interface. + :vartype nsg_url: str + :ivar provisioning_state: Exadata VM cluster on Exascale Infrastructure provisioning state. + Known values are: "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: CloudVmCluster lifecycle state. Known values are: "Provisioning", + "Available", "Updating", "Terminating", "Terminated", "MaintenanceInProgress", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.ExadbVmClusterLifecycleState + :ivar vnet_id: VNET for network connectivity. Required. + :vartype vnet_id: str + :ivar subnet_id: Client subnet. Required. + :vartype subnet_id: str + :ivar data_collection_options: Indicates user preferences for the various diagnostic collection + options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :vartype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :ivar display_name: Display Name. Required. + :vartype display_name: str + :ivar domain: A domain name used for the Exadata VM cluster on Exascale Infrastructure. + :vartype domain: str + :ivar enabled_ecpu_count: The number of ECPUs to enable for an Exadata VM cluster on Exascale + Infrastructure. Required. + :vartype enabled_ecpu_count: int + :ivar exascale_db_storage_vault_id: The Azure Resource ID of the Exadata Database Storage + Vault. Required. + :vartype exascale_db_storage_vault_id: str + :ivar grid_image_ocid: Grid Setup will be done using this Grid Image OCID. Can be obtained + using giMinorVersions API. + :vartype grid_image_ocid: str + :ivar grid_image_type: The type of Grid Image. Known values are: "ReleaseUpdate" and + "CustomImage". + :vartype grid_image_type: str or ~azure.mgmt.oracledatabase.models.GridImageType + :ivar gi_version: Oracle Grid Infrastructure (GI) software version. + :vartype gi_version: str + :ivar hostname: The hostname for the Exadata VM cluster on Exascale Infrastructure. Required. :vartype hostname: str - :ivar lifecycle_state: The current state of the database node. Known values are: - "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", - "Terminated", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState - :ivar lifecycle_details: Lifecycle details of Db Node. - :vartype lifecycle_details: str - :ivar maintenance_type: The type of database node maintenance. "VmdbRebootMigration" - :vartype maintenance_type: str or ~azure.mgmt.oracledatabase.models.DbNodeMaintenanceType - :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. + :ivar license_model: The Oracle license model that applies to the Exadata VM cluster on + Exascale Infrastructure. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" + and "BringYourOwnLicense". + :vartype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :ivar memory_size_in_gbs: The memory that you want to be allocated in GBs. Memory is calculated + based on 11 GB per VM core reserved. :vartype memory_size_in_gbs: int - :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for - the DB system. This attribute applies only for virtual machine DB systems. - :vartype software_storage_size_in_gb: int - :ivar time_created: The date and time that the database node was created. - :vartype time_created: ~datetime.datetime - :ivar time_maintenance_window_end: End date and time of maintenance window. - :vartype time_maintenance_window_end: ~datetime.datetime - :ivar time_maintenance_window_start: Start date and time of maintenance window. - :vartype time_maintenance_window_start: ~datetime.datetime - :ivar vnic2_id: The OCID of the second VNIC. - :vartype vnic2_id: str - :ivar vnic_id: The OCID of the VNIC. - :vartype vnic_id: str - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState - """ - - _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "additional_details": {"readonly": True}, - "backup_ip_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "backup_vnic2_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "backup_vnic_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "cpu_core_count": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "db_server_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "db_system_id": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "fault_domain": {"readonly": True, "max_length": 255, "min_length": 1}, - "host_ip_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "hostname": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "maintenance_type": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "software_storage_size_in_gb": {"readonly": True}, - "time_created": {"readonly": True}, - "time_maintenance_window_end": {"readonly": True}, - "time_maintenance_window_start": {"readonly": True}, - "vnic2_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "vnic_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "additional_details": {"key": "additionalDetails", "type": "str"}, - "backup_ip_id": {"key": "backupIpId", "type": "str"}, - "backup_vnic2_id": {"key": "backupVnic2Id", "type": "str"}, - "backup_vnic_id": {"key": "backupVnicId", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "db_server_id": {"key": "dbServerId", "type": "str"}, - "db_system_id": {"key": "dbSystemId", "type": "str"}, - "fault_domain": {"key": "faultDomain", "type": "str"}, - "host_ip_id": {"key": "hostIpId", "type": "str"}, - "hostname": {"key": "hostname", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "maintenance_type": {"key": "maintenanceType", "type": "str"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "software_storage_size_in_gb": {"key": "softwareStorageSizeInGb", "type": "int"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_maintenance_window_end": {"key": "timeMaintenanceWindowEnd", "type": "iso-8601"}, - "time_maintenance_window_start": {"key": "timeMaintenanceWindowStart", "type": "iso-8601"}, - "vnic2_id": {"key": "vnic2Id", "type": "str"}, - "vnic_id": {"key": "vnicId", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.ocid = None - self.additional_details = None - self.backup_ip_id = None - self.backup_vnic2_id = None - self.backup_vnic_id = None - self.cpu_core_count = None - self.db_node_storage_size_in_gbs = None - self.db_server_id = None - self.db_system_id = None - self.fault_domain = None - self.host_ip_id = None - self.hostname = None - self.lifecycle_state = None - self.lifecycle_details = None - self.maintenance_type = None - self.memory_size_in_gbs = None - self.software_storage_size_in_gb = None - self.time_created = None - self.time_maintenance_window_end = None - self.time_maintenance_window_start = None - self.vnic2_id = None - self.vnic_id = None - self.provisioning_state = None - - -class DbServer(ProxyResource): - """DbServer resource model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties + :ivar node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + Required. + :vartype node_count: int + :ivar nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision + the VM Cluster will be added by default. + :vartype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :ivar zone_ocid: The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is + associated with. + :vartype zone_ocid: str + :ivar private_zone_ocid: The OCID of the zone the Exadata VM cluster on Exascale Infrastructure + is associated with. + :vartype private_zone_ocid: str + :ivar scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default port + is 1521. + :vartype scan_listener_port_tcp: int + :ivar scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The default + port is 2484. + :vartype scan_listener_port_tcp_ssl: int + :ivar listener_port: The port number configured for the listener on the Exadata VM cluster on + Exascale Infrastructure. + :vartype listener_port: int + :ivar shape: The shape of the Exadata VM cluster on Exascale Infrastructure resource. Required. + :vartype shape: str + :ivar ssh_public_keys: The public key portion of one or more key pairs used for SSH access to + the Exadata VM cluster on Exascale Infrastructure. Required. + :vartype ssh_public_keys: list[str] + :ivar system_version: Operating system version of the image. + :vartype system_version: str + :ivar time_zone: The time zone of the Exadata VM cluster on Exascale Infrastructure. For + details, see `Exadata Infrastructure Time Zones `_. + :vartype time_zone: str + :ivar total_ecpu_count: The number of Total ECPUs for an Exadata VM cluster on Exascale + Infrastructure. Required. + :vartype total_ecpu_count: int + :ivar vm_file_system_storage: Filesystem storage details. Required. + :vartype vm_file_system_storage: ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar scan_dns_name: The FQDN of the DNS record for the SCAN IP addresses that are associated + with the Exadata VM cluster on Exascale Infrastructure. + :vartype scan_dns_name: str + :ivar scan_ip_ids: The Single Client Access Name (SCAN) IP addresses associated with the + Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load + balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the + appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + :vartype scan_ip_ids: list[str] + :ivar scan_dns_record_id: The OCID of the DNS record for the SCAN IP addresses that are + associated with the Exadata VM cluster on Exascale Infrastructure. + :vartype scan_dns_record_id: str + :ivar snapshot_file_system_storage: Snapshot filesystem storage details. + :vartype snapshot_file_system_storage: + ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar total_file_system_storage: Total file system storage details. + :vartype total_file_system_storage: + ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails + :ivar vip_ids: The virtual IP (VIP) addresses associated with the Exadata VM cluster on + Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address + for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the + VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, + this list is empty. + :vartype vip_ids: list[str] + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str + :ivar iorm_config_cache: iormConfigCache details for Exadata VM cluster on Exascale + Infrastructure. + :vartype iorm_config_cache: ~azure.mgmt.oracledatabase.models.ExadataIormConfig + :ivar backup_subnet_ocid: Cluster backup subnet ocid. + :vartype backup_subnet_ocid: str + :ivar subnet_ocid: Cluster subnet ocid. + :vartype subnet_ocid: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "cluster_name": {"max_length": 11, "min_length": 1}, + "backup_subnet_cidr": {"max_length": 32, "min_length": 1}, + "nsg_url": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "vnet_id": {"required": True}, + "subnet_id": {"required": True}, + "display_name": {"required": True, "max_length": 255, "min_length": 1}, + "enabled_ecpu_count": {"required": True, "minimum": 0}, + "exascale_db_storage_vault_id": {"required": True}, + "grid_image_ocid": {"max_length": 255, "min_length": 1}, + "grid_image_type": {"readonly": True}, + "gi_version": {"readonly": True, "max_length": 255, "min_length": 1}, + "hostname": {"required": True, "max_length": 12, "min_length": 1}, + "memory_size_in_gbs": {"readonly": True}, + "node_count": {"required": True}, + "zone_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "private_zone_ocid": {"max_length": 255, "min_length": 1}, + "listener_port": {"readonly": True}, + "shape": {"required": True}, + "ssh_public_keys": {"required": True}, + "system_version": {"max_length": 255, "min_length": 1}, + "time_zone": {"max_length": 255, "min_length": 1}, + "total_ecpu_count": {"required": True, "minimum": 2}, + "vm_file_system_storage": {"required": True}, + "lifecycle_details": {"readonly": True}, + "scan_dns_name": {"readonly": True, "max_length": 72, "min_length": 1}, + "scan_ip_ids": {"readonly": True}, + "scan_dns_record_id": {"readonly": True, "max_length": 255, "min_length": 1}, + "snapshot_file_system_storage": {"readonly": True}, + "total_file_system_storage": {"readonly": True}, + "vip_ids": {"readonly": True}, + "oci_url": {"readonly": True}, + "iorm_config_cache": {"readonly": True}, + "backup_subnet_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "subnet_ocid": {"readonly": True, "max_length": 255, "min_length": 1}, } _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": "DbServerProperties"}, + "ocid": {"key": "ocid", "type": "str"}, + "cluster_name": {"key": "clusterName", "type": "str"}, + "backup_subnet_cidr": {"key": "backupSubnetCidr", "type": "str"}, + "nsg_url": {"key": "nsgUrl", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "vnet_id": {"key": "vnetId", "type": "str"}, + "subnet_id": {"key": "subnetId", "type": "str"}, + "data_collection_options": {"key": "dataCollectionOptions", "type": "DataCollectionOptions"}, + "display_name": {"key": "displayName", "type": "str"}, + "domain": {"key": "domain", "type": "str"}, + "enabled_ecpu_count": {"key": "enabledEcpuCount", "type": "int"}, + "exascale_db_storage_vault_id": {"key": "exascaleDbStorageVaultId", "type": "str"}, + "grid_image_ocid": {"key": "gridImageOcid", "type": "str"}, + "grid_image_type": {"key": "gridImageType", "type": "str"}, + "gi_version": {"key": "giVersion", "type": "str"}, + "hostname": {"key": "hostname", "type": "str"}, + "license_model": {"key": "licenseModel", "type": "str"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "node_count": {"key": "nodeCount", "type": "int"}, + "nsg_cidrs": {"key": "nsgCidrs", "type": "[NsgCidr]"}, + "zone_ocid": {"key": "zoneOcid", "type": "str"}, + "private_zone_ocid": {"key": "privateZoneOcid", "type": "str"}, + "scan_listener_port_tcp": {"key": "scanListenerPortTcp", "type": "int"}, + "scan_listener_port_tcp_ssl": {"key": "scanListenerPortTcpSsl", "type": "int"}, + "listener_port": {"key": "listenerPort", "type": "int"}, + "shape": {"key": "shape", "type": "str"}, + "ssh_public_keys": {"key": "sshPublicKeys", "type": "[str]"}, + "system_version": {"key": "systemVersion", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "total_ecpu_count": {"key": "totalEcpuCount", "type": "int"}, + "vm_file_system_storage": {"key": "vmFileSystemStorage", "type": "ExadbVmClusterStorageDetails"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "scan_dns_name": {"key": "scanDnsName", "type": "str"}, + "scan_ip_ids": {"key": "scanIpIds", "type": "[str]"}, + "scan_dns_record_id": {"key": "scanDnsRecordId", "type": "str"}, + "snapshot_file_system_storage": {"key": "snapshotFileSystemStorage", "type": "ExadbVmClusterStorageDetails"}, + "total_file_system_storage": {"key": "totalFileSystemStorage", "type": "ExadbVmClusterStorageDetails"}, + "vip_ids": {"key": "vipIds", "type": "[str]"}, + "oci_url": {"key": "ociUrl", "type": "str"}, + "iorm_config_cache": {"key": "iormConfigCache", "type": "ExadataIormConfig"}, + "backup_subnet_ocid": {"key": "backupSubnetOcid", "type": "str"}, + "subnet_ocid": {"key": "subnetOcid", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.DbServerProperties"] = None, **kwargs: Any) -> None: + def __init__( # pylint: disable=too-many-locals + self, + *, + vnet_id: str, + subnet_id: str, + display_name: str, + enabled_ecpu_count: int, + exascale_db_storage_vault_id: str, + hostname: str, + node_count: int, + shape: str, + ssh_public_keys: List[str], + total_ecpu_count: int, + vm_file_system_storage: "_models.ExadbVmClusterStorageDetails", + cluster_name: Optional[str] = None, + backup_subnet_cidr: Optional[str] = None, + data_collection_options: Optional["_models.DataCollectionOptions"] = None, + domain: Optional[str] = None, + grid_image_ocid: Optional[str] = None, + license_model: Optional[Union[str, "_models.LicenseModel"]] = None, + nsg_cidrs: Optional[List["_models.NsgCidr"]] = None, + private_zone_ocid: Optional[str] = None, + scan_listener_port_tcp: Optional[int] = None, + scan_listener_port_tcp_ssl: Optional[int] = None, + system_version: Optional[str] = None, + time_zone: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbServerProperties + :keyword cluster_name: The cluster name for Exadata VM cluster on Exascale Infrastructure. The + cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores + (_) are not permitted. The cluster name can be no longer than 11 characters and is not case + sensitive. + :paramtype cluster_name: str + :keyword backup_subnet_cidr: Client OCI backup subnet CIDR, default is 192.168.252.0/22. + :paramtype backup_subnet_cidr: str + :keyword vnet_id: VNET for network connectivity. Required. + :paramtype vnet_id: str + :keyword subnet_id: Client subnet. Required. + :paramtype subnet_id: str + :keyword data_collection_options: Indicates user preferences for the various diagnostic + collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + :paramtype data_collection_options: ~azure.mgmt.oracledatabase.models.DataCollectionOptions + :keyword display_name: Display Name. Required. + :paramtype display_name: str + :keyword domain: A domain name used for the Exadata VM cluster on Exascale Infrastructure. + :paramtype domain: str + :keyword enabled_ecpu_count: The number of ECPUs to enable for an Exadata VM cluster on + Exascale Infrastructure. Required. + :paramtype enabled_ecpu_count: int + :keyword exascale_db_storage_vault_id: The Azure Resource ID of the Exadata Database Storage + Vault. Required. + :paramtype exascale_db_storage_vault_id: str + :keyword grid_image_ocid: Grid Setup will be done using this Grid Image OCID. Can be obtained + using giMinorVersions API. + :paramtype grid_image_ocid: str + :keyword hostname: The hostname for the Exadata VM cluster on Exascale Infrastructure. + Required. + :paramtype hostname: str + :keyword license_model: The Oracle license model that applies to the Exadata VM cluster on + Exascale Infrastructure. The default is LICENSE_INCLUDED. Known values are: "LicenseIncluded" + and "BringYourOwnLicense". + :paramtype license_model: str or ~azure.mgmt.oracledatabase.models.LicenseModel + :keyword node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + Required. + :paramtype node_count: int + :keyword nsg_cidrs: CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to + provision the VM Cluster will be added by default. + :paramtype nsg_cidrs: list[~azure.mgmt.oracledatabase.models.NsgCidr] + :keyword private_zone_ocid: The OCID of the zone the Exadata VM cluster on Exascale + Infrastructure is associated with. + :paramtype private_zone_ocid: str + :keyword scan_listener_port_tcp: The TCP Single Client Access Name (SCAN) port. The default + port is 1521. + :paramtype scan_listener_port_tcp: int + :keyword scan_listener_port_tcp_ssl: The TCPS Single Client Access Name (SCAN) port. The + default port is 2484. + :paramtype scan_listener_port_tcp_ssl: int + :keyword shape: The shape of the Exadata VM cluster on Exascale Infrastructure resource. + Required. + :paramtype shape: str + :keyword ssh_public_keys: The public key portion of one or more key pairs used for SSH access + to the Exadata VM cluster on Exascale Infrastructure. Required. + :paramtype ssh_public_keys: list[str] + :keyword system_version: Operating system version of the image. + :paramtype system_version: str + :keyword time_zone: The time zone of the Exadata VM cluster on Exascale Infrastructure. For + details, see `Exadata Infrastructure Time Zones `_. + :paramtype time_zone: str + :keyword total_ecpu_count: The number of Total ECPUs for an Exadata VM cluster on Exascale + Infrastructure. Required. + :paramtype total_ecpu_count: int + :keyword vm_file_system_storage: Filesystem storage details. Required. + :paramtype vm_file_system_storage: + ~azure.mgmt.oracledatabase.models.ExadbVmClusterStorageDetails """ super().__init__(**kwargs) - self.properties = properties - - -class DbServerListResult(_serialization.Model): - """The response of a DbServer list operation. + self.ocid: Optional[str] = None + self.cluster_name = cluster_name + self.backup_subnet_cidr = backup_subnet_cidr + self.nsg_url: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.ExadbVmClusterLifecycleState"]] = None + self.vnet_id = vnet_id + self.subnet_id = subnet_id + self.data_collection_options = data_collection_options + self.display_name = display_name + self.domain = domain + self.enabled_ecpu_count = enabled_ecpu_count + self.exascale_db_storage_vault_id = exascale_db_storage_vault_id + self.grid_image_ocid = grid_image_ocid + self.grid_image_type: Optional[Union[str, "_models.GridImageType"]] = None + self.gi_version: Optional[str] = None + self.hostname = hostname + self.license_model = license_model + self.memory_size_in_gbs: Optional[int] = None + self.node_count = node_count + self.nsg_cidrs = nsg_cidrs + self.zone_ocid: Optional[str] = None + self.private_zone_ocid = private_zone_ocid + self.scan_listener_port_tcp = scan_listener_port_tcp + self.scan_listener_port_tcp_ssl = scan_listener_port_tcp_ssl + self.listener_port: Optional[int] = None + self.shape = shape + self.ssh_public_keys = ssh_public_keys + self.system_version = system_version + self.time_zone = time_zone + self.total_ecpu_count = total_ecpu_count + self.vm_file_system_storage = vm_file_system_storage + self.lifecycle_details: Optional[str] = None + self.scan_dns_name: Optional[str] = None + self.scan_ip_ids: Optional[List[str]] = None + self.scan_dns_record_id: Optional[str] = None + self.snapshot_file_system_storage: Optional["_models.ExadbVmClusterStorageDetails"] = None + self.total_file_system_storage: Optional["_models.ExadbVmClusterStorageDetails"] = None + self.vip_ids: Optional[List[str]] = None + self.oci_url: Optional[str] = None + self.iorm_config_cache: Optional["_models.ExadataIormConfig"] = None + self.backup_subnet_ocid: Optional[str] = None + self.subnet_ocid: Optional[str] = None + + +class ExadbVmClusterStorageDetails(_serialization.Model): + """Storage Details on the Exadata VM cluster. All required parameters must be populated in order to send to server. - :ivar value: The DbServer items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbServer] - :ivar next_link: The link to the next page of items. - :vartype next_link: str + :ivar total_size_in_gbs: Total Capacity. Required. + :vartype total_size_in_gbs: int """ _validation = { - "value": {"required": True}, + "total_size_in_gbs": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[DbServer]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "total_size_in_gbs": {"key": "totalSizeInGbs", "type": "int"}, } - def __init__(self, *, value: List["_models.DbServer"], next_link: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, total_size_in_gbs: int, **kwargs: Any) -> None: """ - :keyword value: The DbServer items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbServer] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str + :keyword total_size_in_gbs: Total Capacity. Required. + :paramtype total_size_in_gbs: int """ super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DbServerPatchingDetails(_serialization.Model): - """DbServer Patching Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar estimated_patch_duration: Estimated Patch Duration. - :vartype estimated_patch_duration: int - :ivar patching_status: Patching Status. Known values are: "Scheduled", "MaintenanceInProgress", - "Failed", and "Complete". - :vartype patching_status: str or ~azure.mgmt.oracledatabase.models.DbServerPatchingStatus - :ivar time_patching_ended: Time Patching Ended. - :vartype time_patching_ended: ~datetime.datetime - :ivar time_patching_started: Time Patching Started. - :vartype time_patching_started: ~datetime.datetime - """ - - _validation = { - "estimated_patch_duration": {"readonly": True, "maximum": 3000, "minimum": 1}, - "patching_status": {"readonly": True}, - "time_patching_ended": {"readonly": True}, - "time_patching_started": {"readonly": True}, - } - - _attribute_map = { - "estimated_patch_duration": {"key": "estimatedPatchDuration", "type": "int"}, - "patching_status": {"key": "patchingStatus", "type": "str"}, - "time_patching_ended": {"key": "timePatchingEnded", "type": "iso-8601"}, - "time_patching_started": {"key": "timePatchingStarted", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.estimated_patch_duration = None - self.patching_status = None - self.time_patching_ended = None - self.time_patching_started = None - + self.total_size_in_gbs = total_size_in_gbs -class DbServerProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """DbServer resource properties. - - Variables are only populated by the server, and will be ignored when sending a request. - :ivar ocid: Db server name. - :vartype ocid: str - :ivar display_name: The name for the Db Server. - :vartype display_name: str - :ivar compartment_id: The OCID of the compartment. - :vartype compartment_id: str - :ivar exadata_infrastructure_id: The OCID of the Exadata infrastructure. - :vartype exadata_infrastructure_id: str - :ivar cpu_core_count: The number of CPU cores enabled on the Db server. - :vartype cpu_core_count: int - :ivar db_server_patching_details: dbServerPatching details of the Db server. - :vartype db_server_patching_details: ~azure.mgmt.oracledatabase.models.DbServerPatchingDetails - :ivar max_memory_in_gbs: The total memory available in GBs. - :vartype max_memory_in_gbs: int - :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db server. - :vartype db_node_storage_size_in_gbs: int - :ivar vm_cluster_ids: The OCID of the VM Clusters associated with the Db server. - :vartype vm_cluster_ids: list[str] - :ivar db_node_ids: The OCID of the Db nodes associated with the Db server. - :vartype db_node_ids: list[str] - :ivar lifecycle_details: Lifecycle details of dbServer. - :vartype lifecycle_details: str - :ivar lifecycle_state: DbServer provisioning state. Known values are: "Creating", "Available", - "Unavailable", "Deleting", "Deleted", and "MaintenanceInProgress". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbServerProvisioningState - :ivar max_cpu_count: The total number of CPU cores available. - :vartype max_cpu_count: int - :ivar autonomous_vm_cluster_ids: The list of OCIDs of the Autonomous VM Clusters associated - with the Db server. - :vartype autonomous_vm_cluster_ids: list[str] - :ivar autonomous_virtual_machine_ids: The list of OCIDs of the Autonomous Virtual Machines - associated with the Db server. - :vartype autonomous_virtual_machine_ids: list[str] - :ivar max_db_node_storage_in_gbs: The total max dbNode storage in GBs. - :vartype max_db_node_storage_in_gbs: int - :ivar memory_size_in_gbs: The total memory size in GBs. - :vartype memory_size_in_gbs: int - :ivar shape: The shape of the Db server. The shape determines the amount of CPU, storage, and - memory resources available. - :vartype shape: str - :ivar time_created: The date and time that the Db Server was created. - :vartype time_created: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState +class ExadbVmClusterUpdate(_serialization.Model): + """The type used for update operations of the ExadbVmCluster. + + :ivar zones: The availability zones. + :vartype zones: list[str] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdateProperties """ - _validation = { - "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, - "display_name": {"readonly": True, "max_length": 255, "min_length": 1}, - "compartment_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "exadata_infrastructure_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "cpu_core_count": {"readonly": True}, - "db_server_patching_details": {"readonly": True}, - "max_memory_in_gbs": {"readonly": True}, - "db_node_storage_size_in_gbs": {"readonly": True}, - "vm_cluster_ids": {"readonly": True}, - "db_node_ids": {"readonly": True}, - "lifecycle_details": {"readonly": True}, - "lifecycle_state": {"readonly": True}, - "max_cpu_count": {"readonly": True}, - "autonomous_vm_cluster_ids": {"readonly": True}, - "autonomous_virtual_machine_ids": {"readonly": True}, - "max_db_node_storage_in_gbs": {"readonly": True}, - "memory_size_in_gbs": {"readonly": True}, - "shape": {"readonly": True, "max_length": 255, "min_length": 1}, - "time_created": {"readonly": True}, - "provisioning_state": {"readonly": True}, + _attribute_map = { + "zones": {"key": "zones", "type": "[str]"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "ExadbVmClusterUpdateProperties"}, } + def __init__( + self, + *, + zones: Optional[List[str]] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExadbVmClusterUpdateProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword zones: The availability zones. + :paramtype zones: list[str] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdateProperties + """ + super().__init__(**kwargs) + self.zones = zones + self.tags = tags + self.properties = properties + + +class ExadbVmClusterUpdateProperties(_serialization.Model): + """The updatable properties of the ExadbVmCluster. + + :ivar node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + :vartype node_count: int + """ + _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "compartment_id": {"key": "compartmentId", "type": "str"}, - "exadata_infrastructure_id": {"key": "exadataInfrastructureId", "type": "str"}, - "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, - "db_server_patching_details": {"key": "dbServerPatchingDetails", "type": "DbServerPatchingDetails"}, - "max_memory_in_gbs": {"key": "maxMemoryInGbs", "type": "int"}, - "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, - "vm_cluster_ids": {"key": "vmClusterIds", "type": "[str]"}, - "db_node_ids": {"key": "dbNodeIds", "type": "[str]"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "max_cpu_count": {"key": "maxCpuCount", "type": "int"}, - "autonomous_vm_cluster_ids": {"key": "autonomousVmClusterIds", "type": "[str]"}, - "autonomous_virtual_machine_ids": {"key": "autonomousVirtualMachineIds", "type": "[str]"}, - "max_db_node_storage_in_gbs": {"key": "maxDbNodeStorageInGbs", "type": "int"}, - "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, - "shape": {"key": "shape", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, + "node_count": {"key": "nodeCount", "type": "int"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, node_count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword node_count: The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + :paramtype node_count: int + """ super().__init__(**kwargs) - self.ocid = None - self.display_name = None - self.compartment_id = None - self.exadata_infrastructure_id = None - self.cpu_core_count = None - self.db_server_patching_details = None - self.max_memory_in_gbs = None - self.db_node_storage_size_in_gbs = None - self.vm_cluster_ids = None - self.db_node_ids = None - self.lifecycle_details = None - self.lifecycle_state = None - self.max_cpu_count = None - self.autonomous_vm_cluster_ids = None - self.autonomous_virtual_machine_ids = None - self.max_db_node_storage_in_gbs = None - self.memory_size_in_gbs = None - self.shape = None - self.time_created = None - self.provisioning_state = None + self.node_count = node_count -class DbSystemShape(ProxyResource): - """DbSystemShape resource definition. +class ExascaleDbNode(ProxyResource): + """The DbNode resource belonging to ExadbVmCluster. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4917,7 +7898,7 @@ class DbSystemShape(ProxyResource): information. :vartype system_data: ~azure.mgmt.oracledatabase.models.SystemData :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties + :vartype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbNodeProperties """ _validation = { @@ -4932,25 +7913,25 @@ class DbSystemShape(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DbSystemShapeProperties"}, + "properties": {"key": "properties", "type": "ExascaleDbNodeProperties"}, } - def __init__(self, *, properties: Optional["_models.DbSystemShapeProperties"] = None, **kwargs: Any) -> None: + def __init__(self, *, properties: Optional["_models.ExascaleDbNodeProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DbSystemShapeProperties + :paramtype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbNodeProperties """ super().__init__(**kwargs) self.properties = properties -class DbSystemShapeListResult(_serialization.Model): - """The response of a DbSystemShape list operation. +class ExascaleDbNodeListResult(_serialization.Model): + """The response of a ExascaleDbNode list operation. All required parameters must be populated in order to send to server. - :ivar value: The DbSystemShape items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] + :ivar value: The ExascaleDbNode items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.ExascaleDbNode] :ivar next_link: The link to the next page of items. :vartype next_link: str """ @@ -4960,14 +7941,16 @@ class DbSystemShapeListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[DbSystemShape]"}, + "value": {"key": "value", "type": "[ExascaleDbNode]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.DbSystemShape"], next_link: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, value: List["_models.ExascaleDbNode"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword value: The DbSystemShape items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DbSystemShape] + :keyword value: The ExascaleDbNode items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.ExascaleDbNode] :keyword next_link: The link to the next page of items. :paramtype next_link: str """ @@ -4976,290 +7959,191 @@ def __init__(self, *, value: List["_models.DbSystemShape"], next_link: Optional[ self.next_link = next_link -class DbSystemShapeProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """DbSystemShape resource model. - - Variables are only populated by the server, and will be ignored when sending a request. +class ExascaleDbNodeProperties(_serialization.Model): + """The properties of DbNodeResource. All required parameters must be populated in order to send to server. - :ivar shape_family: The family of the shape used for the DB system. - :vartype shape_family: str - :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB - system for this shape. Required. - :vartype available_core_count: int - :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB system - for this shape. - :vartype minimum_core_count: int - :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled - on the DB system for this shape. - :vartype runtime_minimum_core_count: int - :ivar core_count_increment: The discrete number by which the CPU core count for this shape can - be increased or decreased. - :vartype core_count_increment: int - :ivar min_storage_count: The minimum number of Exadata storage servers available for the - Exadata infrastructure. - :vartype min_storage_count: int - :ivar max_storage_count: The maximum number of Exadata storage servers available for the - Exadata infrastructure. - :vartype max_storage_count: int - :ivar available_data_storage_per_server_in_tbs: The maximum data storage available per storage - server for this shape. Only applicable to ExaCC Elastic shapes. - :vartype available_data_storage_per_server_in_tbs: float - :ivar available_memory_per_node_in_gbs: The maximum memory available per database node for this - shape. Only applicable to ExaCC Elastic shapes. - :vartype available_memory_per_node_in_gbs: int - :ivar available_db_node_per_node_in_gbs: The maximum Db Node storage available per database - node for this shape. Only applicable to ExaCC Elastic shapes. - :vartype available_db_node_per_node_in_gbs: int - :ivar min_core_count_per_node: The minimum number of CPU cores that can be enabled per node for - this shape. - :vartype min_core_count_per_node: int - :ivar available_memory_in_gbs: The maximum memory that can be enabled for this shape. - :vartype available_memory_in_gbs: int - :ivar min_memory_per_node_in_gbs: The minimum memory that need be allocated per node for this - shape. - :vartype min_memory_per_node_in_gbs: int - :ivar available_db_node_storage_in_gbs: The maximum Db Node storage that can be enabled for - this shape. - :vartype available_db_node_storage_in_gbs: int - :ivar min_db_node_storage_per_node_in_gbs: The minimum Db Node storage that need be allocated - per node for this shape. - :vartype min_db_node_storage_per_node_in_gbs: int - :ivar available_data_storage_in_tbs: The maximum DATA storage that can be enabled for this - shape. - :vartype available_data_storage_in_tbs: int - :ivar min_data_storage_in_tbs: The minimum data storage that need be allocated for this shape. - :vartype min_data_storage_in_tbs: int - :ivar minimum_node_count: The minimum number of database nodes available for this shape. - :vartype minimum_node_count: int - :ivar maximum_node_count: The maximum number of database nodes available for this shape. - :vartype maximum_node_count: int - :ivar available_core_count_per_node: The maximum number of CPU cores per database node that can - be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. - :vartype available_core_count_per_node: int - """ - - _validation = { - "shape_family": {"readonly": True, "max_length": 255, "min_length": 1}, - "available_core_count": {"required": True, "readonly": True}, - "minimum_core_count": {"readonly": True}, - "runtime_minimum_core_count": {"readonly": True}, - "core_count_increment": {"readonly": True}, - "min_storage_count": {"readonly": True}, - "max_storage_count": {"readonly": True}, - "available_data_storage_per_server_in_tbs": {"readonly": True}, - "available_memory_per_node_in_gbs": {"readonly": True}, - "available_db_node_per_node_in_gbs": {"readonly": True}, - "min_core_count_per_node": {"readonly": True}, - "available_memory_in_gbs": {"readonly": True}, - "min_memory_per_node_in_gbs": {"readonly": True}, - "available_db_node_storage_in_gbs": {"readonly": True}, - "min_db_node_storage_per_node_in_gbs": {"readonly": True}, - "available_data_storage_in_tbs": {"readonly": True}, - "min_data_storage_in_tbs": {"readonly": True}, - "minimum_node_count": {"readonly": True}, - "maximum_node_count": {"readonly": True}, - "available_core_count_per_node": {"readonly": True}, - } - - _attribute_map = { - "shape_family": {"key": "shapeFamily", "type": "str"}, - "available_core_count": {"key": "availableCoreCount", "type": "int"}, - "minimum_core_count": {"key": "minimumCoreCount", "type": "int"}, - "runtime_minimum_core_count": {"key": "runtimeMinimumCoreCount", "type": "int"}, - "core_count_increment": {"key": "coreCountIncrement", "type": "int"}, - "min_storage_count": {"key": "minStorageCount", "type": "int"}, - "max_storage_count": {"key": "maxStorageCount", "type": "int"}, - "available_data_storage_per_server_in_tbs": {"key": "availableDataStoragePerServerInTbs", "type": "float"}, - "available_memory_per_node_in_gbs": {"key": "availableMemoryPerNodeInGbs", "type": "int"}, - "available_db_node_per_node_in_gbs": {"key": "availableDbNodePerNodeInGbs", "type": "int"}, - "min_core_count_per_node": {"key": "minCoreCountPerNode", "type": "int"}, - "available_memory_in_gbs": {"key": "availableMemoryInGbs", "type": "int"}, - "min_memory_per_node_in_gbs": {"key": "minMemoryPerNodeInGbs", "type": "int"}, - "available_db_node_storage_in_gbs": {"key": "availableDbNodeStorageInGbs", "type": "int"}, - "min_db_node_storage_per_node_in_gbs": {"key": "minDbNodeStoragePerNodeInGbs", "type": "int"}, - "available_data_storage_in_tbs": {"key": "availableDataStorageInTbs", "type": "int"}, - "min_data_storage_in_tbs": {"key": "minDataStorageInTbs", "type": "int"}, - "minimum_node_count": {"key": "minimumNodeCount", "type": "int"}, - "maximum_node_count": {"key": "maximumNodeCount", "type": "int"}, - "available_core_count_per_node": {"key": "availableCoreCountPerNode", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.shape_family = None - self.available_core_count = None - self.minimum_core_count = None - self.runtime_minimum_core_count = None - self.core_count_increment = None - self.min_storage_count = None - self.max_storage_count = None - self.available_data_storage_per_server_in_tbs = None - self.available_memory_per_node_in_gbs = None - self.available_db_node_per_node_in_gbs = None - self.min_core_count_per_node = None - self.available_memory_in_gbs = None - self.min_memory_per_node_in_gbs = None - self.available_db_node_storage_in_gbs = None - self.min_db_node_storage_per_node_in_gbs = None - self.available_data_storage_in_tbs = None - self.min_data_storage_in_tbs = None - self.minimum_node_count = None - self.maximum_node_count = None - self.available_core_count_per_node = None - - -class DnsPrivateView(ProxyResource): - """DnsPrivateView resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :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.oracledatabase.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties + :ivar ocid: DbNode OCID. Required. + :vartype ocid: str + :ivar additional_details: Additional information about the planned maintenance. + :vartype additional_details: str + :ivar cpu_core_count: The number of CPU cores enabled on the Db node. + :vartype cpu_core_count: int + :ivar db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :vartype db_node_storage_size_in_gbs: int + :ivar fault_domain: The name of the Fault Domain the instance is contained in. + :vartype fault_domain: str + :ivar hostname: The host name for the database node. + :vartype hostname: str + :ivar lifecycle_state: The current state of the database node. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :ivar maintenance_type: The type of database node maintenance. + :vartype maintenance_type: str + :ivar memory_size_in_gbs: The allocated memory in GBs on the Db node. + :vartype memory_size_in_gbs: int + :ivar software_storage_size_in_gb: The size (in GB) of the block storage volume allocation for + the DB system. This attribute applies only for virtual machine DB systems. + :vartype software_storage_size_in_gb: int + :ivar time_maintenance_window_end: End date and time of maintenance window. + :vartype time_maintenance_window_end: ~datetime.datetime + :ivar time_maintenance_window_start: Start date and time of maintenance window. + :vartype time_maintenance_window_start: ~datetime.datetime + :ivar total_cpu_core_count: The total number of CPU cores reserved on the Db node. + :vartype total_cpu_core_count: int """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, + "ocid": {"required": True, "max_length": 255, "min_length": 1}, + "fault_domain": {"max_length": 255, "min_length": 1}, } _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": "DnsPrivateViewProperties"}, + "ocid": {"key": "ocid", "type": "str"}, + "additional_details": {"key": "additionalDetails", "type": "str"}, + "cpu_core_count": {"key": "cpuCoreCount", "type": "int"}, + "db_node_storage_size_in_gbs": {"key": "dbNodeStorageSizeInGbs", "type": "int"}, + "fault_domain": {"key": "faultDomain", "type": "str"}, + "hostname": {"key": "hostname", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "maintenance_type": {"key": "maintenanceType", "type": "str"}, + "memory_size_in_gbs": {"key": "memorySizeInGbs", "type": "int"}, + "software_storage_size_in_gb": {"key": "softwareStorageSizeInGb", "type": "int"}, + "time_maintenance_window_end": {"key": "timeMaintenanceWindowEnd", "type": "iso-8601"}, + "time_maintenance_window_start": {"key": "timeMaintenanceWindowStart", "type": "iso-8601"}, + "total_cpu_core_count": {"key": "totalCpuCoreCount", "type": "int"}, } - def __init__(self, *, properties: Optional["_models.DnsPrivateViewProperties"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + ocid: str, + additional_details: Optional[str] = None, + cpu_core_count: Optional[int] = None, + db_node_storage_size_in_gbs: Optional[int] = None, + fault_domain: Optional[str] = None, + hostname: Optional[str] = None, + lifecycle_state: Optional[Union[str, "_models.DbNodeProvisioningState"]] = None, + maintenance_type: Optional[str] = None, + memory_size_in_gbs: Optional[int] = None, + software_storage_size_in_gb: Optional[int] = None, + time_maintenance_window_end: Optional[datetime.datetime] = None, + time_maintenance_window_start: Optional[datetime.datetime] = None, + total_cpu_core_count: Optional[int] = None, + **kwargs: Any + ) -> None: """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateViewProperties + :keyword ocid: DbNode OCID. Required. + :paramtype ocid: str + :keyword additional_details: Additional information about the planned maintenance. + :paramtype additional_details: str + :keyword cpu_core_count: The number of CPU cores enabled on the Db node. + :paramtype cpu_core_count: int + :keyword db_node_storage_size_in_gbs: The allocated local node storage in GBs on the Db node. + :paramtype db_node_storage_size_in_gbs: int + :keyword fault_domain: The name of the Fault Domain the instance is contained in. + :paramtype fault_domain: str + :keyword hostname: The host name for the database node. + :paramtype hostname: str + :keyword lifecycle_state: The current state of the database node. Known values are: + "Provisioning", "Available", "Updating", "Stopping", "Stopped", "Starting", "Terminating", + "Terminated", and "Failed". + :paramtype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.DbNodeProvisioningState + :keyword maintenance_type: The type of database node maintenance. + :paramtype maintenance_type: str + :keyword memory_size_in_gbs: The allocated memory in GBs on the Db node. + :paramtype memory_size_in_gbs: int + :keyword software_storage_size_in_gb: The size (in GB) of the block storage volume allocation + for the DB system. This attribute applies only for virtual machine DB systems. + :paramtype software_storage_size_in_gb: int + :keyword time_maintenance_window_end: End date and time of maintenance window. + :paramtype time_maintenance_window_end: ~datetime.datetime + :keyword time_maintenance_window_start: Start date and time of maintenance window. + :paramtype time_maintenance_window_start: ~datetime.datetime + :keyword total_cpu_core_count: The total number of CPU cores reserved on the Db node. + :paramtype total_cpu_core_count: int """ super().__init__(**kwargs) - self.properties = properties - + self.ocid = ocid + self.additional_details = additional_details + self.cpu_core_count = cpu_core_count + self.db_node_storage_size_in_gbs = db_node_storage_size_in_gbs + self.fault_domain = fault_domain + self.hostname = hostname + self.lifecycle_state = lifecycle_state + self.maintenance_type = maintenance_type + self.memory_size_in_gbs = memory_size_in_gbs + self.software_storage_size_in_gb = software_storage_size_in_gb + self.time_maintenance_window_end = time_maintenance_window_end + self.time_maintenance_window_start = time_maintenance_window_start + self.total_cpu_core_count = total_cpu_core_count -class DnsPrivateViewListResult(_serialization.Model): - """The response of a DnsPrivateView list operation. - All required parameters must be populated in order to send to server. +class ExascaleDbStorageDetails(_serialization.Model): + """Exadata Database Storage Details. - :ivar value: The DnsPrivateView items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :ivar next_link: The link to the next page of items. - :vartype next_link: str + :ivar available_size_in_gbs: Available Capacity. + :vartype available_size_in_gbs: int + :ivar total_size_in_gbs: Total Capacity. + :vartype total_size_in_gbs: int """ - _validation = { - "value": {"required": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[DnsPrivateView]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "available_size_in_gbs": {"key": "availableSizeInGbs", "type": "int"}, + "total_size_in_gbs": {"key": "totalSizeInGbs", "type": "int"}, } def __init__( - self, *, value: List["_models.DnsPrivateView"], next_link: Optional[str] = None, **kwargs: Any + self, *, available_size_in_gbs: Optional[int] = None, total_size_in_gbs: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword value: The DnsPrivateView items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateView] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str + :keyword available_size_in_gbs: Available Capacity. + :paramtype available_size_in_gbs: int + :keyword total_size_in_gbs: Total Capacity. + :paramtype total_size_in_gbs: int """ super().__init__(**kwargs) - self.value = value - self.next_link = next_link + self.available_size_in_gbs = available_size_in_gbs + self.total_size_in_gbs = total_size_in_gbs -class DnsPrivateViewProperties(_serialization.Model): - """Views resource model. - - Variables are only populated by the server, and will be ignored when sending a request. +class ExascaleDbStorageInputDetails(_serialization.Model): + """Create exadata Database Storage Details model. All required parameters must be populated in order to send to server. - :ivar ocid: The OCID of the view. Required. - :vartype ocid: str - :ivar display_name: The display name of the view resource. - :vartype display_name: str - :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable - to be explicitly managed. Required. - :vartype is_protected: bool - :ivar lifecycle_state: Views lifecycleState. Known values are: "Active", "Deleted", "Deleting", - and "Updating". - :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.DnsPrivateViewsLifecycleState - :ivar self_property: The canonical absolute URL of the resource. Required. - :vartype self_property: str - :ivar time_created: views timeCreated. Required. - :vartype time_created: ~datetime.datetime - :ivar time_updated: views timeCreated. Required. - :vartype time_updated: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + :ivar total_size_in_gbs: Total Capacity. Required. + :vartype total_size_in_gbs: int """ _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "display_name": {"readonly": True}, - "is_protected": {"required": True, "readonly": True}, - "lifecycle_state": {"readonly": True}, - "self_property": {"required": True, "readonly": True}, - "time_created": {"required": True, "readonly": True}, - "time_updated": {"required": True, "readonly": True}, - "provisioning_state": {"readonly": True}, + "total_size_in_gbs": {"required": True}, } _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "is_protected": {"key": "isProtected", "type": "bool"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "self_property": {"key": "self", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, - "time_updated": {"key": "timeUpdated", "type": "iso-8601"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, + "total_size_in_gbs": {"key": "totalSizeInGbs", "type": "int"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, total_size_in_gbs: int, **kwargs: Any) -> None: + """ + :keyword total_size_in_gbs: Total Capacity. Required. + :paramtype total_size_in_gbs: int + """ super().__init__(**kwargs) - self.ocid = None - self.display_name = None - self.is_protected = None - self.lifecycle_state = None - self.self_property = None - self.time_created = None - self.time_updated = None - self.provisioning_state = None + self.total_size_in_gbs = total_size_in_gbs -class DnsPrivateZone(ProxyResource): - """DnsPrivateZone resource definition. +class ExascaleDbStorageVault(TrackedResource): + """ExascaleDbStorageVault resource 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 id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5269,8 +8153,14 @@ class DnsPrivateZone(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.oracledatabase.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 resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties + :vartype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultProperties + :ivar zones: The availability zones. + :vartype zones: list[str] """ _validation = { @@ -5278,6 +8168,7 @@ class DnsPrivateZone(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { @@ -5285,25 +8176,43 @@ class DnsPrivateZone(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "DnsPrivateZoneProperties"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ExascaleDbStorageVaultProperties"}, + "zones": {"key": "zones", "type": "[str]"}, } - def __init__(self, *, properties: Optional["_models.DnsPrivateZoneProperties"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ExascaleDbStorageVaultProperties"] = None, + zones: Optional[List[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 :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.oracledatabase.models.DnsPrivateZoneProperties + :paramtype properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultProperties + :keyword zones: The availability zones. + :paramtype zones: list[str] """ - super().__init__(**kwargs) + super().__init__(tags=tags, location=location, **kwargs) self.properties = properties + self.zones = zones -class DnsPrivateZoneListResult(_serialization.Model): - """The response of a DnsPrivateZone list operation. +class ExascaleDbStorageVaultListResult(_serialization.Model): + """The response of a ExascaleDbStorageVault list operation. All required parameters must be populated in order to send to server. - :ivar value: The DnsPrivateZone items on this page. Required. - :vartype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :ivar value: The ExascaleDbStorageVault items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] :ivar next_link: The link to the next page of items. :vartype next_link: str """ @@ -5313,16 +8222,16 @@ class DnsPrivateZoneListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[DnsPrivateZone]"}, + "value": {"key": "value", "type": "[ExascaleDbStorageVault]"}, "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, *, value: List["_models.DnsPrivateZone"], next_link: Optional[str] = None, **kwargs: Any + self, *, value: List["_models.ExascaleDbStorageVault"], next_link: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword value: The DnsPrivateZone items on this page. Required. - :paramtype value: list[~azure.mgmt.oracledatabase.models.DnsPrivateZone] + :keyword value: The ExascaleDbStorageVault items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] :keyword next_link: The link to the next page of items. :paramtype next_link: str """ @@ -5331,266 +8240,319 @@ def __init__( self.next_link = next_link -class DnsPrivateZoneProperties(_serialization.Model): - """Zones resource model. +class ExascaleDbStorageVaultProperties(_serialization.Model): + """ExascaleDbStorageVault resource model. 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 ocid: The OCID of the Zone. Required. - :vartype ocid: str - :ivar is_protected: A Boolean flag indicating whether or not parts of the resource are unable - to be explicitly managed. Required. - :vartype is_protected: bool - :ivar lifecycle_state: Zones lifecycleState. Known values are: "Active", "Creating", "Deleted", - "Deleting", and "Updating". + :ivar additional_flash_cache_in_percent: The size of additional Flash Cache in percentage of + High Capacity database storage. + :vartype additional_flash_cache_in_percent: int + :ivar description: Exadata Database Storage Vault description. + :vartype description: str + :ivar display_name: The user-friendly name for the Exadata Database Storage Vault. The name + does not need to be unique. Required. + :vartype display_name: str + :ivar high_capacity_database_storage_input: Create exadata Database Storage Details. Required. + :vartype high_capacity_database_storage_input: + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageInputDetails + :ivar high_capacity_database_storage: Response exadata Database Storage Details. + :vartype high_capacity_database_storage: + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageDetails + :ivar time_zone: The time zone that you want to use for the Exadata Database Storage Vault. + :vartype time_zone: str + :ivar provisioning_state: Exadata Database Storage Vault provisioning state. Known values are: + "Succeeded", "Failed", "Canceled", and "Provisioning". + :vartype provisioning_state: str or + ~azure.mgmt.oracledatabase.models.AzureResourceProvisioningState + :ivar lifecycle_state: Exadata Database Storage Vault lifecycle state. Known values are: + "Provisioning", "Available", "Updating", "Terminating", "Terminated", and "Failed". :vartype lifecycle_state: str or - ~azure.mgmt.oracledatabase.models.DnsPrivateZonesLifecycleState - :ivar self_property: The canonical absolute URL of the resource. Required. - :vartype self_property: str - :ivar serial: The current serial of the zone. As seen in the zone's SOA record. Required. - :vartype serial: int - :ivar version: Version is the never-repeating, totally-orderable, version of the zone, from - which the serial field of the zone's SOA record is derived. Required. - :vartype version: str - :ivar view_id: The OCID of the private view containing the zone. This value will be null for - zones in the global DNS, which are publicly resolvable and not part of a private view. - :vartype view_id: str - :ivar zone_type: The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only - supported for GLOBAL zones. Required. Known values are: "Primary" and "Secondary". - :vartype zone_type: str or ~azure.mgmt.oracledatabase.models.ZoneType - :ivar time_created: Zones timeCreated. Required. - :vartype time_created: ~datetime.datetime - :ivar provisioning_state: Azure resource provisioning state. Known values are: "Succeeded", - "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.oracledatabase.models.ResourceProvisioningState + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultLifecycleState + :ivar lifecycle_details: Additional information about the current lifecycle state. + :vartype lifecycle_details: str + :ivar vm_cluster_count: The number of Exadata VM clusters used the Exadata Database Storage + Vault. + :vartype vm_cluster_count: int + :ivar ocid: The OCID of the Exadata Database Storage Vault. + :vartype ocid: str + :ivar oci_url: HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + :vartype oci_url: str """ _validation = { - "ocid": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, - "is_protected": {"required": True, "readonly": True}, - "lifecycle_state": {"readonly": True}, - "self_property": {"required": True, "readonly": True}, - "serial": {"required": True, "readonly": True}, - "version": {"required": True, "readonly": True}, - "view_id": {"readonly": True, "max_length": 255, "min_length": 1}, - "zone_type": {"required": True, "readonly": True}, - "time_created": {"required": True, "readonly": True}, + "additional_flash_cache_in_percent": {"minimum": 0}, + "description": {"max_length": 400, "min_length": 1}, + "display_name": {"required": True, "max_length": 255, "min_length": 1}, + "high_capacity_database_storage_input": {"required": True}, + "high_capacity_database_storage": {"readonly": True}, + "time_zone": {"max_length": 255, "min_length": 1}, "provisioning_state": {"readonly": True}, + "lifecycle_state": {"readonly": True}, + "lifecycle_details": {"readonly": True}, + "vm_cluster_count": {"readonly": True}, + "ocid": {"readonly": True, "max_length": 255, "min_length": 1}, + "oci_url": {"readonly": True}, } _attribute_map = { - "ocid": {"key": "ocid", "type": "str"}, - "is_protected": {"key": "isProtected", "type": "bool"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "self_property": {"key": "self", "type": "str"}, - "serial": {"key": "serial", "type": "int"}, - "version": {"key": "version", "type": "str"}, - "view_id": {"key": "viewId", "type": "str"}, - "zone_type": {"key": "zoneType", "type": "str"}, - "time_created": {"key": "timeCreated", "type": "iso-8601"}, + "additional_flash_cache_in_percent": {"key": "additionalFlashCacheInPercent", "type": "int"}, + "description": {"key": "description", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "high_capacity_database_storage_input": { + "key": "highCapacityDatabaseStorageInput", + "type": "ExascaleDbStorageInputDetails", + }, + "high_capacity_database_storage": {"key": "highCapacityDatabaseStorage", "type": "ExascaleDbStorageDetails"}, + "time_zone": {"key": "timeZone", "type": "str"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, + "lifecycle_state": {"key": "lifecycleState", "type": "str"}, + "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, + "vm_cluster_count": {"key": "vmClusterCount", "type": "int"}, + "ocid": {"key": "ocid", "type": "str"}, + "oci_url": {"key": "ociUrl", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + display_name: str, + high_capacity_database_storage_input: "_models.ExascaleDbStorageInputDetails", + additional_flash_cache_in_percent: Optional[int] = None, + description: Optional[str] = None, + time_zone: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword additional_flash_cache_in_percent: The size of additional Flash Cache in percentage of + High Capacity database storage. + :paramtype additional_flash_cache_in_percent: int + :keyword description: Exadata Database Storage Vault description. + :paramtype description: str + :keyword display_name: The user-friendly name for the Exadata Database Storage Vault. The name + does not need to be unique. Required. + :paramtype display_name: str + :keyword high_capacity_database_storage_input: Create exadata Database Storage Details. + Required. + :paramtype high_capacity_database_storage_input: + ~azure.mgmt.oracledatabase.models.ExascaleDbStorageInputDetails + :keyword time_zone: The time zone that you want to use for the Exadata Database Storage Vault. + :paramtype time_zone: str + """ super().__init__(**kwargs) - self.ocid = None - self.is_protected = None - self.lifecycle_state = None - self.self_property = None - self.serial = None - self.version = None - self.view_id = None - self.zone_type = None - self.time_created = None - self.provisioning_state = None - + self.additional_flash_cache_in_percent = additional_flash_cache_in_percent + self.description = description + self.display_name = display_name + self.high_capacity_database_storage_input = high_capacity_database_storage_input + self.high_capacity_database_storage: Optional["_models.ExascaleDbStorageDetails"] = None + self.time_zone = time_zone + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.ExascaleDbStorageVaultLifecycleState"]] = None + self.lifecycle_details: Optional[str] = None + self.vm_cluster_count: Optional[int] = None + self.ocid: Optional[str] = None + self.oci_url: Optional[str] = None -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - Variables are only populated by the server, and will be ignored when sending a request. +class ExascaleDbStorageVaultTagsUpdate(_serialization.Model): + """The type used for updating tags in ExascaleDbStorageVault resources. - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, + _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 FileSystemConfigurationDetails(_serialization.Model): + """File configuration options. + + :ivar mount_point: Mount path. + :vartype mount_point: str + :ivar file_system_size_gb: Size of the VM. + :vartype file_system_size_gb: int + """ + _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, + "mount_point": {"key": "mountPoint", "type": "str"}, + "file_system_size_gb": {"key": "fileSystemSizeGb", "type": "int"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, mount_point: Optional[str] = None, file_system_size_gb: Optional[int] = None, **kwargs: Any + ) -> None: + """ + :keyword mount_point: Mount path. + :paramtype mount_point: str + :keyword file_system_size_gb: Size of the VM. + :paramtype file_system_size_gb: int + """ super().__init__(**kwargs) - self.type = None - self.info = None + self.mount_point = mount_point + self.file_system_size_gb = file_system_size_gb -class ErrorDetail(_serialization.Model): - """The error detail. +class FlexComponent(ProxyResource): + """FlexComponent Resource Definition. Variables are only populated by the server, and will be ignored when sending a request. - :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.oracledatabase.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.oracledatabase.models.ErrorAdditionalInfo] + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.FlexComponentProperties """ _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + "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": "FlexComponentProperties"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, properties: Optional["_models.FlexComponentProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.FlexComponentProperties + """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.properties = properties -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). +class FlexComponentListResult(_serialization.Model): + """The response of a FlexComponent list operation. - :ivar error: The error object. - :vartype error: ~azure.mgmt.oracledatabase.models.ErrorDetail + All required parameters must be populated in order to send to server. + + :ivar value: The FlexComponent items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.FlexComponent] + :ivar next_link: The link to the next page of items. + :vartype next_link: str """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, + "value": {"key": "value", "type": "[FlexComponent]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.FlexComponent"], next_link: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.oracledatabase.models.ErrorDetail + :keyword value: The FlexComponent items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.FlexComponent] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str """ super().__init__(**kwargs) - self.error = error + self.value = value + self.next_link = next_link -class EstimatedPatchingTime(_serialization.Model): - """The estimated total time required in minutes for all patching operations (database server, - storage server, and network switch patching). +class FlexComponentProperties(_serialization.Model): + """FlexComponent resource model. Variables are only populated by the server, and will be ignored when sending a request. - :ivar estimated_db_server_patching_time: The estimated time required in minutes for database - server patching. - :vartype estimated_db_server_patching_time: int - :ivar estimated_network_switches_patching_time: The estimated time required in minutes for - network switch patching. - :vartype estimated_network_switches_patching_time: int - :ivar estimated_storage_server_patching_time: The estimated time required in minutes for - storage server patching. - :vartype estimated_storage_server_patching_time: int - :ivar total_estimated_patching_time: The estimated total time required in minutes for all - patching operations. - :vartype total_estimated_patching_time: int + :ivar minimum_core_count: The minimum number of CPU cores that can be enabled on the DB Server + for this Flex Component. + :vartype minimum_core_count: int + :ivar available_core_count: The maximum number of CPU cores that can be enabled on the DB + Server for this Flex Component. + :vartype available_core_count: int + :ivar available_db_storage_in_gbs: The maximum storage that can be enabled on the Storage + Server for this Flex Component. + :vartype available_db_storage_in_gbs: int + :ivar runtime_minimum_core_count: The runtime minimum number of CPU cores that can be enabled + for this Flex Component. + :vartype runtime_minimum_core_count: int + :ivar shape: The name of the DB system shape for this Flex Component. + :vartype shape: str + :ivar available_memory_in_gbs: The maximum memory size that can be enabled on the DB Server for + this Flex Component. + :vartype available_memory_in_gbs: int + :ivar available_local_storage_in_gbs: The maximum local storage that can be enabled on the DB + Server for this Flex Component. + :vartype available_local_storage_in_gbs: int + :ivar compute_model: The compute model of the DB Server for this Flex Component. + :vartype compute_model: str + :ivar hardware_type: The hardware type of the DB (Compute) or Storage (Cell) Server for this + Flex Component. Known values are: "COMPUTE" and "CELL". + :vartype hardware_type: str or ~azure.mgmt.oracledatabase.models.HardwareType + :ivar description_summary: The description summary for this Flex Component. + :vartype description_summary: str """ _validation = { - "estimated_db_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "estimated_network_switches_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "estimated_storage_server_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, - "total_estimated_patching_time": {"readonly": True, "maximum": 3000, "minimum": 1}, + "minimum_core_count": {"readonly": True}, + "available_core_count": {"readonly": True}, + "available_db_storage_in_gbs": {"readonly": True}, + "runtime_minimum_core_count": {"readonly": True}, + "shape": {"readonly": True, "max_length": 255, "min_length": 1}, + "available_memory_in_gbs": {"readonly": True}, + "available_local_storage_in_gbs": {"readonly": True}, + "compute_model": {"readonly": True}, + "hardware_type": {"readonly": True}, + "description_summary": {"readonly": True, "max_length": 255, "min_length": 1}, } _attribute_map = { - "estimated_db_server_patching_time": {"key": "estimatedDbServerPatchingTime", "type": "int"}, - "estimated_network_switches_patching_time": {"key": "estimatedNetworkSwitchesPatchingTime", "type": "int"}, - "estimated_storage_server_patching_time": {"key": "estimatedStorageServerPatchingTime", "type": "int"}, - "total_estimated_patching_time": {"key": "totalEstimatedPatchingTime", "type": "int"}, + "minimum_core_count": {"key": "minimumCoreCount", "type": "int"}, + "available_core_count": {"key": "availableCoreCount", "type": "int"}, + "available_db_storage_in_gbs": {"key": "availableDbStorageInGbs", "type": "int"}, + "runtime_minimum_core_count": {"key": "runtimeMinimumCoreCount", "type": "int"}, + "shape": {"key": "shape", "type": "str"}, + "available_memory_in_gbs": {"key": "availableMemoryInGbs", "type": "int"}, + "available_local_storage_in_gbs": {"key": "availableLocalStorageInGbs", "type": "int"}, + "compute_model": {"key": "computeModel", "type": "str"}, + "hardware_type": {"key": "hardwareType", "type": "str"}, + "description_summary": {"key": "descriptionSummary", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.estimated_db_server_patching_time = None - self.estimated_network_switches_patching_time = None - self.estimated_storage_server_patching_time = None - self.total_estimated_patching_time = None - - -class ExadataIormConfig(_serialization.Model): - """ExadataIormConfig for cloud vm cluster. - - :ivar db_plans: An array of IORM settings for all the database in the Exadata DB system. - :vartype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] - :ivar lifecycle_details: Additional information about the current lifecycleState. - :vartype lifecycle_details: str - :ivar lifecycle_state: The current state of IORM configuration for the Exadata DB system. Known - values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". - :vartype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState - :ivar objective: The current value for the IORM objective. The default is AUTO. Known values - are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". - :vartype objective: str or ~azure.mgmt.oracledatabase.models.Objective - """ - - _attribute_map = { - "db_plans": {"key": "dbPlans", "type": "[DbIormConfig]"}, - "lifecycle_details": {"key": "lifecycleDetails", "type": "str"}, - "lifecycle_state": {"key": "lifecycleState", "type": "str"}, - "objective": {"key": "objective", "type": "str"}, - } - - def __init__( - self, - *, - db_plans: Optional[List["_models.DbIormConfig"]] = None, - lifecycle_details: Optional[str] = None, - lifecycle_state: Optional[Union[str, "_models.IormLifecycleState"]] = None, - objective: Optional[Union[str, "_models.Objective"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword db_plans: An array of IORM settings for all the database in the Exadata DB system. - :paramtype db_plans: list[~azure.mgmt.oracledatabase.models.DbIormConfig] - :keyword lifecycle_details: Additional information about the current lifecycleState. - :paramtype lifecycle_details: str - :keyword lifecycle_state: The current state of IORM configuration for the Exadata DB system. - Known values are: "BootStrapping", "Enabled", "Disabled", "Updating", and "Failed". - :paramtype lifecycle_state: str or ~azure.mgmt.oracledatabase.models.IormLifecycleState - :keyword objective: The current value for the IORM objective. The default is AUTO. Known values - are: "LowLatency", "HighThroughput", "Balanced", "Auto", and "Basic". - :paramtype objective: str or ~azure.mgmt.oracledatabase.models.Objective - """ - super().__init__(**kwargs) - self.db_plans = db_plans - self.lifecycle_details = lifecycle_details - self.lifecycle_state = lifecycle_state - self.objective = objective + self.minimum_core_count: Optional[int] = None + self.available_core_count: Optional[int] = None + self.available_db_storage_in_gbs: Optional[int] = None + self.runtime_minimum_core_count: Optional[int] = None + self.shape: Optional[str] = None + self.available_memory_in_gbs: Optional[int] = None + self.available_local_storage_in_gbs: Optional[int] = None + self.compute_model: Optional[str] = None + self.hardware_type: Optional[Union[str, "_models.HardwareType"]] = None + self.description_summary: Optional[str] = None class GenerateAutonomousDatabaseWalletDetails(_serialization.Model): @@ -5640,13 +8602,124 @@ def __init__( self.password = password +class GiMinorVersion(ProxyResource): + """The Oracle Grid Infrastructure (GI) minor version resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/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.oracledatabase.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.oracledatabase.models.GiMinorVersionProperties + """ + + _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"}, + "properties": {"key": "properties", "type": "GiMinorVersionProperties"}, + } + + def __init__(self, *, properties: Optional["_models.GiMinorVersionProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: The resource-specific properties for this resource. + :paramtype properties: ~azure.mgmt.oracledatabase.models.GiMinorVersionProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GiMinorVersionListResult(_serialization.Model): + """The response of a GiMinorVersion list operation. + + All required parameters must be populated in order to send to server. + + :ivar value: The GiMinorVersion items on this page. Required. + :vartype value: list[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[GiMinorVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: List["_models.GiMinorVersion"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: The GiMinorVersion items on this page. Required. + :paramtype value: list[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GiMinorVersionProperties(_serialization.Model): + """The Oracle Grid Infrastructure (GI) minor version properties. + + All required parameters must be populated in order to send to server. + + :ivar version: A valid Oracle Grid Infrastructure (GI) software version. Required. + :vartype version: str + :ivar grid_image_ocid: Grid Infrastructure Image Id. + :vartype grid_image_ocid: str + """ + + _validation = { + "version": {"required": True, "max_length": 255, "min_length": 1}, + "grid_image_ocid": {"max_length": 255, "min_length": 1}, + } + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "grid_image_ocid": {"key": "gridImageOcid", "type": "str"}, + } + + def __init__(self, *, version: str, grid_image_ocid: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword version: A valid Oracle Grid Infrastructure (GI) software version. Required. + :paramtype version: str + :keyword grid_image_ocid: Grid Infrastructure Image Id. + :paramtype grid_image_ocid: str + """ + super().__init__(**kwargs) + self.version = version + self.grid_image_ocid = grid_image_ocid + + class GiVersion(ProxyResource): """GiVersion resource definition. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5719,8 +8792,6 @@ def __init__(self, *, value: List["_models.GiVersion"], next_link: Optional[str] class GiVersionProperties(_serialization.Model): """GiVersion resource model. - 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: A valid Oracle Grid Infrastructure (GI) software version. Required. @@ -5728,17 +8799,20 @@ class GiVersionProperties(_serialization.Model): """ _validation = { - "version": {"required": True, "readonly": True, "max_length": 255, "min_length": 1}, + "version": {"required": True, "max_length": 255, "min_length": 1}, } _attribute_map = { "version": {"key": "version", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, version: str, **kwargs: Any) -> None: + """ + :keyword version: A valid Oracle Grid Infrastructure (GI) software version. Required. + :paramtype version: str + """ super().__init__(**kwargs) - self.version = None + self.version = version class LongTermBackUpScheduleDetails(_serialization.Model): @@ -6034,11 +9108,11 @@ def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kw :paramtype display: ~azure.mgmt.oracledatabase.models.OperationDisplay """ super().__init__(**kwargs) - self.name = None - self.is_data_action = None + self.name: Optional[str] = None + self.is_data_action: Optional[bool] = None self.display = display - self.origin = None - self.action_type = None + self.origin: Optional[Union[str, "_models.Origin"]] = None + self.action_type: Optional[Union[str, "_models.ActionType"]] = None class OperationDisplay(_serialization.Model): @@ -6077,10 +9151,10 @@ class OperationDisplay(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None + self.provider: Optional[str] = None + self.resource: Optional[str] = None + self.operation: Optional[str] = None + self.description: Optional[str] = None class OperationListResult(_serialization.Model): @@ -6108,8 +9182,8 @@ class OperationListResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.value: Optional[List["_models.Operation"]] = None + self.next_link: Optional[str] = None class OracleSubscription(ProxyResource): @@ -6118,7 +9192,7 @@ class OracleSubscription(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -6226,6 +9300,15 @@ class OracleSubscriptionProperties(_serialization.Model): :vartype product_code: str :ivar intent: Intent for the update operation. Known values are: "Retain" and "Reset". :vartype intent: str or ~azure.mgmt.oracledatabase.models.Intent + :ivar azure_subscription_ids: Azure subscriptions to be added. + :vartype azure_subscription_ids: list[str] + :ivar add_subscription_operation_state: State of the add Azure subscription operation on Oracle + subscription. Known values are: "Succeeded", "Updating", and "Failed". + :vartype add_subscription_operation_state: str or + ~azure.mgmt.oracledatabase.models.AddSubscriptionOperationState + :ivar last_operation_status_detail: Status details of the last operation on Oracle + subscription. + :vartype last_operation_status_detail: str """ _validation = { @@ -6233,6 +9316,9 @@ class OracleSubscriptionProperties(_serialization.Model): "saas_subscription_id": {"readonly": True}, "cloud_account_id": {"readonly": True, "max_length": 255, "min_length": 1}, "cloud_account_state": {"readonly": True}, + "azure_subscription_ids": {"readonly": True}, + "add_subscription_operation_state": {"readonly": True}, + "last_operation_status_detail": {"readonly": True}, } _attribute_map = { @@ -6243,6 +9329,9 @@ class OracleSubscriptionProperties(_serialization.Model): "term_unit": {"key": "termUnit", "type": "str"}, "product_code": {"key": "productCode", "type": "str"}, "intent": {"key": "intent", "type": "str"}, + "azure_subscription_ids": {"key": "azureSubscriptionIds", "type": "[str]"}, + "add_subscription_operation_state": {"key": "addSubscriptionOperationState", "type": "str"}, + "last_operation_status_detail": {"key": "lastOperationStatusDetail", "type": "str"}, } def __init__( @@ -6263,13 +9352,16 @@ def __init__( :paramtype intent: str or ~azure.mgmt.oracledatabase.models.Intent """ super().__init__(**kwargs) - self.provisioning_state = None - self.saas_subscription_id = None - self.cloud_account_id = None - self.cloud_account_state = None + self.provisioning_state: Optional[Union[str, "_models.OracleSubscriptionProvisioningState"]] = None + self.saas_subscription_id: Optional[str] = None + self.cloud_account_id: Optional[str] = None + self.cloud_account_state: Optional[Union[str, "_models.CloudAccountProvisioningState"]] = None self.term_unit = term_unit self.product_code = product_code self.intent = intent + self.azure_subscription_ids: Optional[List[str]] = None + self.add_subscription_operation_state: Optional[Union[str, "_models.AddSubscriptionOperationState"]] = None + self.last_operation_status_detail: Optional[str] = None class OracleSubscriptionUpdate(_serialization.Model): @@ -6277,7 +9369,7 @@ class OracleSubscriptionUpdate(_serialization.Model): :ivar plan: Details of the resource plan. :vartype plan: ~azure.mgmt.oracledatabase.models.PlanUpdate - :ivar properties: The updatable properties of the OracleSubscription. + :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties """ @@ -6296,7 +9388,7 @@ def __init__( """ :keyword plan: Details of the resource plan. :paramtype plan: ~azure.mgmt.oracledatabase.models.PlanUpdate - :keyword properties: The updatable properties of the OracleSubscription. + :keyword properties: The resource-specific properties for this resource. :paramtype properties: ~azure.mgmt.oracledatabase.models.OracleSubscriptionUpdateProperties """ super().__init__(**kwargs) @@ -6339,9 +9431,14 @@ def __init__( class PeerDbDetails(_serialization.Model): """PeerDb Details. - :ivar peer_db_id: The database OCID of the Disaster Recovery peer database, which is located in - a different region from the current peer database. + :ivar peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :vartype peer_db_id: str + :ivar peer_db_ocid: Ocid of the Disaster Recovery peer database, which is located in a + different region from the current peer database. + :vartype peer_db_ocid: str + :ivar peer_db_location: The location of the Disaster Recovery peer database. + :vartype peer_db_location: str """ _validation = { @@ -6350,16 +9447,32 @@ class PeerDbDetails(_serialization.Model): _attribute_map = { "peer_db_id": {"key": "peerDbId", "type": "str"}, + "peer_db_ocid": {"key": "peerDbOcid", "type": "str"}, + "peer_db_location": {"key": "peerDbLocation", "type": "str"}, } - def __init__(self, *, peer_db_id: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + peer_db_id: Optional[str] = None, + peer_db_ocid: Optional[str] = None, + peer_db_location: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword peer_db_id: The database OCID of the Disaster Recovery peer database, which is located - in a different region from the current peer database. + :keyword peer_db_id: The Azure resource ID of the Disaster Recovery peer database, which is + located in a different region from the current peer database. :paramtype peer_db_id: str + :keyword peer_db_ocid: Ocid of the Disaster Recovery peer database, which is located in a + different region from the current peer database. + :paramtype peer_db_ocid: str + :keyword peer_db_location: The location of the Disaster Recovery peer database. + :paramtype peer_db_location: str """ super().__init__(**kwargs) self.peer_db_id = peer_db_id + self.peer_db_ocid = peer_db_ocid + self.peer_db_location = peer_db_location class Plan(_serialization.Model): @@ -6726,6 +9839,35 @@ def __init__( self.value = value +class RemoveVirtualMachineFromExadbVmClusterDetails(_serialization.Model): # pylint: disable=name-too-long + """Details of removing Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. + Applies to Exadata Database Service on Exascale Infrastructure only. + + All required parameters must be populated in order to send to server. + + :ivar db_nodes: The list of ExaCS DB nodes for the Exadata VM cluster on Exascale + Infrastructure to be removed. Required. + :vartype db_nodes: list[~azure.mgmt.oracledatabase.models.DbNodeDetails] + """ + + _validation = { + "db_nodes": {"required": True}, + } + + _attribute_map = { + "db_nodes": {"key": "dbNodes", "type": "[DbNodeDetails]"}, + } + + def __init__(self, *, db_nodes: List["_models.DbNodeDetails"], **kwargs: Any) -> None: + """ + :keyword db_nodes: The list of ExaCS DB nodes for the Exadata VM cluster on Exascale + Infrastructure to be removed. Required. + :paramtype db_nodes: list[~azure.mgmt.oracledatabase.models.DbNodeDetails] + """ + super().__init__(**kwargs) + self.db_nodes = db_nodes + + class RestoreAutonomousDatabaseDetails(_serialization.Model): """Details to restore an Oracle Autonomous Database. @@ -6752,7 +9894,7 @@ def __init__(self, *, timestamp: datetime.datetime, **kwargs: Any) -> None: self.timestamp = timestamp -class SaasSubscriptionDetails(_serialization.Model): # pylint: disable=too-many-instance-attributes +class SaasSubscriptionDetails(_serialization.Model): """SaaS Subscription Details model. Variables are only populated by the server, and will be ignored when sending a request. @@ -6816,18 +9958,18 @@ class SaasSubscriptionDetails(_serialization.Model): # pylint: disable=too-many def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.subscription_name = None - self.time_created = None - self.offer_id = None - self.plan_id = None - self.saas_subscription_status = None - self.publisher_id = None - self.purchaser_email_id = None - self.purchaser_tenant_id = None - self.term_unit = None - self.is_auto_renew = None - self.is_free_trial = None + self.id: Optional[str] = None + self.subscription_name: Optional[str] = None + self.time_created: Optional[datetime.datetime] = None + self.offer_id: Optional[str] = None + self.plan_id: Optional[str] = None + self.saas_subscription_status: Optional[str] = None + self.publisher_id: Optional[str] = None + self.purchaser_email_id: Optional[str] = None + self.purchaser_tenant_id: Optional[str] = None + self.term_unit: Optional[str] = None + self.is_auto_renew: Optional[bool] = None + self.is_free_trial: Optional[bool] = None class ScheduledOperationsType(_serialization.Model): @@ -6991,7 +10133,7 @@ class SystemVersion(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7064,8 +10206,6 @@ def __init__(self, *, value: List["_models.SystemVersion"], next_link: Optional[ class SystemVersionProperties(_serialization.Model): """System Version Resource model. - 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 system_version: A valid Oracle System Version. Required. @@ -7073,17 +10213,20 @@ class SystemVersionProperties(_serialization.Model): """ _validation = { - "system_version": {"required": True, "readonly": True}, + "system_version": {"required": True}, } _attribute_map = { "system_version": {"key": "systemVersion", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, system_version: str, **kwargs: Any) -> None: + """ + :keyword system_version: A valid Oracle System Version. Required. + :paramtype system_version: str + """ super().__init__(**kwargs) - self.system_version = None + self.system_version = system_version class SystemVersionsFilter(_serialization.Model): @@ -7187,7 +10330,7 @@ def __init__(self, *, error: "_models.ValidationError", **kwargs: Any) -> None: :paramtype error: ~azure.mgmt.oracledatabase.models.ValidationError """ super().__init__(**kwargs) - self.status = None + self.status: Optional[Union[str, "_models.ValidationStatus"]] = None self.error = error @@ -7197,7 +10340,7 @@ class VirtualNetworkAddress(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7331,9 +10474,9 @@ def __init__(self, *, ip_address: Optional[str] = None, vm_ocid: Optional[str] = super().__init__(**kwargs) self.ip_address = ip_address self.vm_ocid = vm_ocid - self.ocid = None - self.domain = None - self.lifecycle_details = None - self.provisioning_state = None - self.lifecycle_state = None - self.time_assigned = None + self.ocid: Optional[str] = None + self.domain: Optional[str] = None + self.lifecycle_details: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.AzureResourceProvisioningState"]] = None + self.lifecycle_state: Optional[Union[str, "_models.VirtualNetworkAddressLifecycleState"]] = None + self.time_assigned: Optional[datetime.datetime] = None diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py index 4b7f8e25139e..d3274c137499 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/models/_oracle_database_mgmt_client_enums.py @@ -16,6 +16,17 @@ class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): INTERNAL = "Internal" +class AddSubscriptionOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Add Subscription Operation state enum.""" + + SUCCEEDED = "Succeeded" + """Succeeded - State when Add Subscription operation succeeded""" + UPDATING = "Updating" + """Updating - State when Add Subscription operation is being Updated""" + FAILED = "Failed" + """Failed - State when Add Subscription operation failed""" + + class AutonomousDatabaseBackupLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Autonomous database backup lifecycle state enum.""" @@ -218,6 +229,10 @@ class DataBaseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Regular DB""" CLONE = "Clone" """Clone DB""" + CLONE_FROM_BACKUP_TIMESTAMP = "CloneFromBackupTimestamp" + """Clone DB from backup timestamp""" + CROSS_REGION_DISASTER_RECOVERY = "CrossRegionDisasterRecovery" + """Cross Region Disaster Recovery""" class DataSafeStatusType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -373,6 +388,42 @@ class DnsPrivateZonesLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta """DNS Private Zones is updating""" +class ExadbVmClusterLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Exadata VM cluster on Exascale Infrastructure lifecycle state enum.""" + + PROVISIONING = "Provisioning" + """Indicates that resource in Provisioning state""" + AVAILABLE = "Available" + """Indicates that resource in Available state""" + UPDATING = "Updating" + """Indicates that resource in Updating state""" + TERMINATING = "Terminating" + """Indicates that resource in Terminating state""" + TERMINATED = "Terminated" + """Indicates that resource in Terminated state""" + MAINTENANCE_IN_PROGRESS = "MaintenanceInProgress" + """Indicates that resource Maintenance in progress state""" + FAILED = "Failed" + """Indicates that resource in Failed state""" + + +class ExascaleDbStorageVaultLifecycleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Exadata Database Storage Vault lifecycle state enum.""" + + PROVISIONING = "Provisioning" + """Indicates that resource in Provisioning state""" + AVAILABLE = "Available" + """Indicates that resource in Available state""" + UPDATING = "Updating" + """Indicates that resource in Updating state""" + TERMINATING = "Terminating" + """Indicates that resource in Terminating state""" + TERMINATED = "Terminated" + """Indicates that resource in Terminated state""" + FAILED = "Failed" + """Indicates that resource in Failed state""" + + class GenerateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Generate type enum.""" @@ -382,6 +433,24 @@ class GenerateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Generate all""" +class GridImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GridImageType enum.""" + + RELEASE_UPDATE = "ReleaseUpdate" + """Release update""" + CUSTOM_IMAGE = "CustomImage" + """Custom image""" + + +class HardwareType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Hardware Type enum.""" + + COMPUTE = "COMPUTE" + """Hardware type is Database Server""" + CELL = "CELL" + """Hardware type is Storage Server""" + + class HostFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Host format type enum.""" @@ -617,6 +686,15 @@ class SessionModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Redirect session mode""" +class ShapeFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allowed values for GI Minor Versions shapeFamily filter.""" + + EXADATA = "EXADATA" + """Family value for Exadata Shape""" + EXADB_XS = "EXADB_XS" + """Family value for Exadb XS Shape""" + + class SourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Source type enum.""" @@ -647,6 +725,17 @@ class SyntaxFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Ezconnectplus format""" +class SystemShapes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allowed values for System Shapes.""" + + EXADATA_X9_M = "Exadata.X9M" + """Exadata X9M shape""" + EXADATA_X11_M = "Exadata.X11M" + """Exadata X11M shape""" + EXA_DB_XS = "ExaDbXS" + """Exadata DB on Exascale Infrastructure shape""" + + class TlsAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """TLS authentication type enum.""" diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py index 6cd78dc91ca1..791a7724582a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/__init__.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,27 +6,38 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._operations import Operations -from ._autonomous_databases_operations import AutonomousDatabasesOperations -from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations -from ._cloud_vm_clusters_operations import CloudVmClustersOperations -from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations -from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations -from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations -from ._db_system_shapes_operations import DbSystemShapesOperations -from ._dns_private_views_operations import DnsPrivateViewsOperations -from ._dns_private_zones_operations import DnsPrivateZonesOperations -from ._gi_versions_operations import GiVersionsOperations -from ._system_versions_operations import SystemVersionsOperations -from ._oracle_subscriptions_operations import OracleSubscriptionsOperations -from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations -from ._db_servers_operations import DbServersOperations -from ._db_nodes_operations import DbNodesOperations -from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import Operations # type: ignore +from ._autonomous_databases_operations import AutonomousDatabasesOperations # type: ignore +from ._cloud_exadata_infrastructures_operations import CloudExadataInfrastructuresOperations # type: ignore +from ._cloud_vm_clusters_operations import CloudVmClustersOperations # type: ignore +from ._exadb_vm_clusters_operations import ExadbVmClustersOperations # type: ignore +from ._exascale_db_storage_vaults_operations import ExascaleDbStorageVaultsOperations # type: ignore +from ._autonomous_database_character_sets_operations import AutonomousDatabaseCharacterSetsOperations # type: ignore +from ._autonomous_database_national_character_sets_operations import AutonomousDatabaseNationalCharacterSetsOperations # type: ignore +from ._autonomous_database_versions_operations import AutonomousDatabaseVersionsOperations # type: ignore +from ._db_system_shapes_operations import DbSystemShapesOperations # type: ignore +from ._dns_private_views_operations import DnsPrivateViewsOperations # type: ignore +from ._dns_private_zones_operations import DnsPrivateZonesOperations # type: ignore +from ._flex_components_operations import FlexComponentsOperations # type: ignore +from ._gi_versions_operations import GiVersionsOperations # type: ignore +from ._gi_minor_versions_operations import GiMinorVersionsOperations # type: ignore +from ._system_versions_operations import SystemVersionsOperations # type: ignore +from ._oracle_subscriptions_operations import OracleSubscriptionsOperations # type: ignore +from ._autonomous_database_backups_operations import AutonomousDatabaseBackupsOperations # type: ignore +from ._db_servers_operations import DbServersOperations # type: ignore +from ._db_nodes_operations import DbNodesOperations # type: ignore +from ._virtual_network_addresses_operations import VirtualNetworkAddressesOperations # type: ignore +from ._exascale_db_nodes_operations import ExascaleDbNodesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -33,19 +45,24 @@ "AutonomousDatabasesOperations", "CloudExadataInfrastructuresOperations", "CloudVmClustersOperations", + "ExadbVmClustersOperations", + "ExascaleDbStorageVaultsOperations", "AutonomousDatabaseCharacterSetsOperations", "AutonomousDatabaseNationalCharacterSetsOperations", "AutonomousDatabaseVersionsOperations", "DbSystemShapesOperations", "DnsPrivateViewsOperations", "DnsPrivateZonesOperations", + "FlexComponentsOperations", "GiVersionsOperations", + "GiMinorVersionsOperations", "SystemVersionsOperations", "OracleSubscriptionsOperations", "AutonomousDatabaseBackupsOperations", "DbServersOperations", "DbNodesOperations", "VirtualNetworkAddressesOperations", + "ExascaleDbNodesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py index 49bc636fbc9e..82a68be019f6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_backups_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,20 +42,20 @@ _SERIALIZER.client_side_validation = False -def build_list_by_autonomous_database_request( # pylint: disable=name-too-long +def build_list_by_parent_request( resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -85,14 +83,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -121,7 +119,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,7 +127,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -160,7 +158,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -168,7 +166,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -199,14 +197,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -243,13 +241,13 @@ class AutonomousDatabaseBackupsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_autonomous_database( + def list_by_parent( self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any ) -> Iterable["_models.AutonomousDatabaseBackup"]: """List AutonomousDatabaseBackup resources by AutonomousDatabase. @@ -271,7 +269,7 @@ def list_by_autonomous_database( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseBackupListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +280,7 @@ def list_by_autonomous_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_autonomous_database_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, subscription_id=self._config.subscription_id, @@ -290,7 +288,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -306,7 +303,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -353,7 +349,7 @@ def get( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseBackup :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +372,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -391,7 +386,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -405,8 +400,8 @@ def _create_or_update_initial( adbbackupid: str, resource: Union[_models.AutonomousDatabaseBackup, IO[bytes]], **kwargs: Any - ) -> _models.AutonomousDatabaseBackup: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +414,7 @@ def _create_or_update_initial( 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.AutonomousDatabaseBackup] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -441,10 +436,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -452,18 +447,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - 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 = self._deserialize("AutonomousDatabaseBackup", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -583,10 +582,11 @@ def begin_create_or_update( 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("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -617,8 +617,8 @@ def _update_initial( adbbackupid: str, properties: Union[_models.AutonomousDatabaseBackupUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabaseBackup]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,7 +631,7 @@ def _update_initial( 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[Optional[_models.AutonomousDatabaseBackup]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -653,10 +653,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -664,19 +664,21 @@ def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -795,10 +797,11 @@ def begin_update( 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("AutonomousDatabaseBackup", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseBackup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -822,10 +825,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements + def _delete_initial( self, resource_group_name: str, autonomousdatabasename: str, adbbackupid: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -837,7 +840,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -848,10 +851,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -859,6 +862,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -868,8 +875,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete( @@ -897,7 +908,7 @@ def begin_delete( 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, adbbackupid=adbbackupid, @@ -907,6 +918,7 @@ def begin_delete( 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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py index 8921da8053bc..ee0e832b1995 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_character_sets_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +41,14 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -73,14 +69,14 @@ def build_get_request(location: str, adbscharsetname: str, subscription_id: str, _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -112,14 +108,14 @@ class AutonomousDatabaseCharacterSetsOperations: # pylint: disable=name-too-lon def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.AutonomousDatabaseCharacterSet"]: - """List AutonomousDatabaseCharacterSet resources by Location. + """List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -135,7 +131,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Au api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseCharacterSetListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +149,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -169,7 +164,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -211,7 +205,7 @@ def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.Aut :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseCharacterSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -233,7 +227,6 @@ def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.Aut headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -248,7 +241,7 @@ def get(self, location: str, adbscharsetname: str, **kwargs: Any) -> _models.Aut error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseCharacterSet", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseCharacterSet", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py index d871d703a56a..403452a2129f 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_national_character_sets_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +41,14 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -73,14 +69,14 @@ def build_get_request(location: str, adbsncharsetname: str, subscription_id: str _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -112,16 +108,16 @@ class AutonomousDatabaseNationalCharacterSetsOperations: # pylint: disable=name def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location( self, location: str, **kwargs: Any ) -> Iterable["_models.AutonomousDatabaseNationalCharacterSet"]: - """List AutonomousDatabaseNationalCharacterSet resources by Location. + """List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -137,7 +133,7 @@ def list_by_location( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseNationalCharacterSetListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +151,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -171,7 +166,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -215,7 +209,7 @@ def get( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseNationalCharacterSet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +231,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -252,7 +245,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSet", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseNationalCharacterSet", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py index 414d425ad5e3..f4e78ae55ded 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_database_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,14 +41,14 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -73,14 +69,14 @@ def build_get_request(location: str, autonomousdbversionsname: str, subscription _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -114,14 +110,14 @@ class AutonomousDatabaseVersionsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.AutonomousDbVersion"]: - """List AutonomousDbVersion resources by Location. + """List AutonomousDbVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -135,7 +131,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Au api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDbVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -153,7 +149,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -169,7 +164,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -211,7 +205,7 @@ def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDbVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -233,7 +227,6 @@ def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _m headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -248,7 +241,7 @@ def get(self, location: str, autonomousdbversionsname: str, **kwargs: Any) -> _m error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDbVersion", pipeline_response) + deserialized = self._deserialize("AutonomousDbVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py index 577e79ccd86a..bc4728544273 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_autonomous_databases_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -139,7 +137,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +145,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -177,7 +175,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,7 +183,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -215,14 +213,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -244,13 +242,51 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_change_disaster_recovery_configuration_request( # pylint: disable=name-too-long + resource_group_name: str, autonomousdatabasename: 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", "2025-03-01")) + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "autonomousdatabasename": _SERIALIZER.url( + "autonomousdatabasename", autonomousdatabasename, "str", max_length=30, min_length=1, pattern=r".*" + ), + } + + _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_failover_request( resource_group_name: str, autonomousdatabasename: 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -258,7 +294,7 @@ def build_failover_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -288,7 +324,7 @@ def build_generate_wallet_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -296,7 +332,7 @@ def build_generate_wallet_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -326,7 +362,7 @@ def build_restore_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -334,7 +370,7 @@ def build_restore_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -364,14 +400,14 @@ def build_shrink_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -399,7 +435,7 @@ def build_switchover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -407,7 +443,7 @@ def build_switchover_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -445,10 +481,10 @@ class AutonomousDatabasesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.AutonomousDatabase"]: @@ -464,7 +500,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.AutonomousDat api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -481,7 +517,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -497,7 +532,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -544,7 +578,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AutonomousDatabaseListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +596,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -578,7 +611,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -621,7 +653,7 @@ def get(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: A :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabase :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +675,6 @@ def get(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: A headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -658,7 +689,7 @@ def get(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: A error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -671,8 +702,8 @@ def _create_or_update_initial( autonomousdatabasename: str, resource: Union[_models.AutonomousDatabase, IO[bytes]], **kwargs: Any - ) -> _models.AutonomousDatabase: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -685,7 +716,7 @@ def _create_or_update_initial( 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.AutonomousDatabase] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -706,10 +737,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -717,18 +748,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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 = self._deserialize("AutonomousDatabase", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -835,10 +870,11 @@ def begin_create_or_update( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -868,8 +904,8 @@ def _update_initial( autonomousdatabasename: str, properties: Union[_models.AutonomousDatabaseUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +918,7 @@ def _update_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -903,10 +939,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -914,19 +950,21 @@ def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1032,10 +1070,11 @@ def begin_update( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1059,10 +1098,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _delete_initial(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1074,7 +1111,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -1084,10 +1121,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1095,6 +1132,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1104,8 +1145,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> LROPoller[None]: @@ -1129,7 +1174,7 @@ def begin_delete(self, resource_group_name: str, autonomousdatabasename: str, ** 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, autonomousdatabasename=autonomousdatabasename, api_version=api_version, @@ -1138,6 +1183,7 @@ def begin_delete(self, resource_group_name: str, autonomousdatabasename: str, ** 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 @@ -1161,14 +1207,214 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def _change_disaster_recovery_configuration_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "DisasterRecoveryConfigurationDetails") + + _request = build_change_disaster_recovery_configuration_request( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + 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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: _models.DisasterRecoveryConfigurationDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails + :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 AutonomousDatabase or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either AutonomousDatabase or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_change_disaster_recovery_configuration( # pylint: disable=name-too-long + self, + resource_group_name: str, + autonomousdatabasename: str, + body: Union[_models.DisasterRecoveryConfigurationDetails, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AutonomousDatabase]: + """Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param autonomousdatabasename: The database name. Required. + :type autonomousdatabasename: str + :param body: The content of the action request. Is either a + DisasterRecoveryConfigurationDetails type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.DisasterRecoveryConfigurationDetails or IO[bytes] + :return: An instance of LROPoller that returns either AutonomousDatabase or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.AutonomousDatabase] + :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.AutonomousDatabase] = 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._change_disaster_recovery_configuration_initial( + resource_group_name=resource_group_name, + autonomousdatabasename=autonomousdatabasename, + body=body, + 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("AutonomousDatabase", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AutonomousDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AutonomousDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _failover_initial( self, resource_group_name: str, autonomousdatabasename: str, body: Union[_models.PeerDbDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1181,7 +1427,7 @@ def _failover_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1202,10 +1448,10 @@ def _failover_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1213,19 +1459,21 @@ def _failover_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1331,10 +1579,11 @@ def begin_failover( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1435,7 +1684,7 @@ def generate_wallet( :rtype: ~azure.mgmt.oracledatabase.models.AutonomousDatabaseWalletFile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1718,6 @@ def generate_wallet( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -1484,7 +1732,7 @@ def generate_wallet( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("AutonomousDatabaseWalletFile", pipeline_response) + deserialized = self._deserialize("AutonomousDatabaseWalletFile", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1497,8 +1745,8 @@ def _restore_initial( autonomousdatabasename: str, body: Union[_models.RestoreAutonomousDatabaseDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1511,7 +1759,7 @@ def _restore_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1532,10 +1780,10 @@ def _restore_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1543,19 +1791,21 @@ def _restore_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1661,10 +1911,11 @@ def begin_restore( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1688,10 +1939,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _shrink_initial( - self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _shrink_initial(self, resource_group_name: str, autonomousdatabasename: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1703,7 +1952,7 @@ def _shrink_initial( _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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_shrink_request( resource_group_name=resource_group_name, @@ -1713,10 +1962,10 @@ def _shrink_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1724,19 +1973,21 @@ def _shrink_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1777,10 +2028,11 @@ def begin_shrink( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1810,8 +2062,8 @@ def _switchover_initial( autonomousdatabasename: str, body: Union[_models.PeerDbDetails, IO[bytes]], **kwargs: Any - ) -> Optional[_models.AutonomousDatabase]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1824,7 +2076,7 @@ def _switchover_initial( 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[Optional[_models.AutonomousDatabase]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1845,10 +2097,10 @@ def _switchover_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1856,19 +2108,21 @@ def _switchover_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("AutonomousDatabase", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1974,10 +2228,11 @@ def begin_switchover( 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("AutonomousDatabase", pipeline_response) + deserialized = self._deserialize("AutonomousDatabase", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py index c8063deb2c92..955d776131db 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_exadata_infrastructures_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,13 +46,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,14 +72,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -106,14 +104,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -141,7 +139,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,7 +147,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -179,7 +177,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -187,7 +185,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -217,14 +215,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -252,14 +250,14 @@ def build_add_storage_capacity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -295,10 +293,10 @@ class CloudExadataInfrastructuresOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudExadataInfrastructure"]: @@ -316,7 +314,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudExadataI api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +331,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -349,7 +346,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -400,7 +396,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudExadataInfrastructureListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +414,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -434,7 +429,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -479,7 +473,7 @@ def get( :rtype: ~azure.mgmt.oracledatabase.models.CloudExadataInfrastructure :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +495,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -516,7 +509,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -529,8 +522,8 @@ def _create_or_update_initial( cloudexadatainfrastructurename: str, resource: Union[_models.CloudExadataInfrastructure, IO[bytes]], **kwargs: Any - ) -> _models.CloudExadataInfrastructure: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +536,7 @@ def _create_or_update_initial( 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.CloudExadataInfrastructure] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -564,10 +557,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -575,18 +568,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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 = self._deserialize("CloudExadataInfrastructure", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -696,10 +693,11 @@ def begin_create_or_update( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -729,8 +727,8 @@ def _update_initial( cloudexadatainfrastructurename: str, properties: Union[_models.CloudExadataInfrastructureUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -743,7 +741,7 @@ def _update_initial( 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[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -764,10 +762,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -775,19 +773,21 @@ def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -897,10 +897,11 @@ def begin_update( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -924,10 +925,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements + def _delete_initial( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -939,7 +940,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -949,10 +950,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -960,6 +961,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -969,8 +974,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete( @@ -996,7 +1005,7 @@ def begin_delete( 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, cloudexadatainfrastructurename=cloudexadatainfrastructurename, api_version=api_version, @@ -1005,6 +1014,7 @@ def begin_delete( 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 @@ -1030,8 +1040,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _add_storage_capacity_initial( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any - ) -> Optional[_models.CloudExadataInfrastructure]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1043,7 +1053,7 @@ def _add_storage_capacity_initial( _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[Optional[_models.CloudExadataInfrastructure]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_add_storage_capacity_request( resource_group_name=resource_group_name, @@ -1053,10 +1063,10 @@ def _add_storage_capacity_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1064,19 +1074,21 @@ def _add_storage_capacity_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1117,10 +1129,11 @@ def begin_add_storage_capacity( 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("CloudExadataInfrastructure", pipeline_response) + deserialized = self._deserialize("CloudExadataInfrastructure", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py index ce4460ba2548..6614093b5875 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_cloud_vm_clusters_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, List, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,14 +70,14 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -104,14 +102,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -137,7 +135,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +143,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -173,7 +171,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,7 +179,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -209,14 +207,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -242,7 +240,7 @@ def build_add_vms_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +248,7 @@ def build_add_vms_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -278,7 +276,7 @@ def build_list_private_ip_addresses_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -286,7 +284,7 @@ def build_list_private_ip_addresses_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -314,7 +312,7 @@ def build_remove_vms_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -322,7 +320,7 @@ def build_remove_vms_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -358,10 +356,10 @@ class CloudVmClustersOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudVmCluster"]: @@ -377,7 +375,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CloudVmCluste api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -394,7 +392,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -410,7 +407,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -457,7 +453,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CloudVmClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -475,7 +471,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -491,7 +486,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -534,7 +528,7 @@ def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) :rtype: ~azure.mgmt.oracledatabase.models.CloudVmCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +550,6 @@ def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -571,7 +564,7 @@ def get(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -584,8 +577,8 @@ def _create_or_update_initial( cloudvmclustername: str, resource: Union[_models.CloudVmCluster, IO[bytes]], **kwargs: Any - ) -> _models.CloudVmCluster: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +591,7 @@ def _create_or_update_initial( 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.CloudVmCluster] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -619,10 +612,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -630,18 +623,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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 = self._deserialize("CloudVmCluster", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -748,10 +745,11 @@ def begin_create_or_update( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -781,8 +779,8 @@ def _update_initial( cloudvmclustername: str, properties: Union[_models.CloudVmClusterUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -795,7 +793,7 @@ def _update_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -816,10 +814,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -827,19 +825,21 @@ def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -945,10 +945,11 @@ def begin_update( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -972,10 +973,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _delete_initial(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -987,7 +986,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -997,10 +996,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1008,6 +1007,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1017,8 +1020,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any) -> LROPoller[None]: @@ -1042,7 +1049,7 @@ def begin_delete(self, resource_group_name: str, cloudvmclustername: str, **kwar 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, api_version=api_version, @@ -1051,6 +1058,7 @@ def begin_delete(self, resource_group_name: str, cloudvmclustername: str, **kwar 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 @@ -1080,8 +1088,8 @@ def _add_vms_initial( cloudvmclustername: str, body: Union[_models.AddRemoveDbNode, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1094,7 +1102,7 @@ def _add_vms_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1115,10 +1123,10 @@ def _add_vms_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1126,19 +1134,21 @@ def _add_vms_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1244,10 +1254,11 @@ def begin_add_vms( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1347,7 +1358,7 @@ def list_private_ip_addresses( :rtype: list[~azure.mgmt.oracledatabase.models.PrivateIpAddressProperties] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1381,7 +1392,6 @@ def list_private_ip_addresses( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -1396,7 +1406,7 @@ def list_private_ip_addresses( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("[PrivateIpAddressProperties]", pipeline_response) + deserialized = self._deserialize("[PrivateIpAddressProperties]", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1409,8 +1419,8 @@ def _remove_vms_initial( cloudvmclustername: str, body: Union[_models.AddRemoveDbNode, IO[bytes]], **kwargs: Any - ) -> Optional[_models.CloudVmCluster]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1423,7 +1433,7 @@ def _remove_vms_initial( 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[Optional[_models.CloudVmCluster]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1444,10 +1454,10 @@ def _remove_vms_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1455,19 +1465,21 @@ def _remove_vms_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudVmCluster", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1573,10 +1585,11 @@ def begin_remove_vms( 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("CloudVmCluster", pipeline_response) + deserialized = self._deserialize("CloudVmCluster", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py index 555a3e19530b..504a6e623b2b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_nodes_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,20 +42,20 @@ _SERIALIZER.client_side_validation = False -def build_list_by_cloud_vm_cluster_request( +def build_list_by_parent_request( resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -83,14 +81,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -117,7 +115,7 @@ def build_action_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +123,7 @@ def build_action_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -162,13 +160,13 @@ class DbNodesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_vm_cluster( + def list_by_parent( self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any ) -> Iterable["_models.DbNode"]: """List DbNode resources by CloudVmCluster. @@ -188,7 +186,7 @@ def list_by_cloud_vm_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbNodeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -199,7 +197,7 @@ def list_by_cloud_vm_cluster( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_vm_cluster_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, subscription_id=self._config.subscription_id, @@ -207,7 +205,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -223,7 +220,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -268,7 +264,7 @@ def get(self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str :rtype: ~azure.mgmt.oracledatabase.models.DbNode :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +287,6 @@ def get(self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -306,7 +301,7 @@ def get(self, resource_group_name: str, cloudvmclustername: str, dbnodeocid: str error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbNode", pipeline_response) + deserialized = self._deserialize("DbNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -320,8 +315,8 @@ def _action_initial( dbnodeocid: str, body: Union[_models.DbNodeAction, IO[bytes]], **kwargs: Any - ) -> Optional[_models.DbNode]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +329,7 @@ def _action_initial( 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[Optional[_models.DbNode]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -356,10 +351,10 @@ def _action_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -367,19 +362,21 @@ def _action_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("DbNode", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -492,10 +489,11 @@ def begin_action( 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("DbNode", pipeline_response) + deserialized = self._deserialize("DbNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py index dcd9b8d17403..a48d14490c57 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_servers_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,20 +37,20 @@ _SERIALIZER.client_side_validation = False -def build_list_by_cloud_exadata_infrastructure_request( # pylint: disable=name-too-long +def build_list_by_parent_request( resource_group_name: str, cloudexadatainfrastructurename: 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -86,14 +82,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -132,13 +128,13 @@ class DbServersOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_exadata_infrastructure( + def list_by_parent( self, resource_group_name: str, cloudexadatainfrastructurename: str, **kwargs: Any ) -> Iterable["_models.DbServer"]: """List DbServer resources by CloudExadataInfrastructure. @@ -158,7 +154,7 @@ def list_by_cloud_exadata_infrastructure( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbServerListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +165,7 @@ def list_by_cloud_exadata_infrastructure( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_exadata_infrastructure_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudexadatainfrastructurename=cloudexadatainfrastructurename, subscription_id=self._config.subscription_id, @@ -177,7 +173,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -193,7 +188,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -240,7 +234,7 @@ def get( :rtype: ~azure.mgmt.oracledatabase.models.DbServer :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -263,7 +257,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -278,7 +271,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbServer", pipeline_response) + deserialized = self._deserialize("DbServer", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py index 97e366ce296a..903baaf2caaa 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_db_system_shapes_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,17 +37,19 @@ _SERIALIZER.client_side_validation = False -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_list_by_location_request( + location: str, subscription_id: str, *, zone: Optional[str] = None, **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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -61,6 +59,8 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -72,14 +72,14 @@ def build_get_request(location: str, dbsystemshapename: str, subscription_id: st _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -111,17 +111,21 @@ class DbSystemShapesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DbSystemShape"]: - """List DbSystemShape resources by Location. + def list_by_location( + self, location: str, zone: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.DbSystemShape"]: + """List DbSystemShape resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str :return: An iterator like instance of either DbSystemShape or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.DbSystemShape] :raises ~azure.core.exceptions.HttpResponseError: @@ -132,7 +136,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Db api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DbSystemShapeListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,11 +150,11 @@ def prepare_request(next_link=None): _request = build_list_by_location_request( location=location, subscription_id=self._config.subscription_id, + zone=zone, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -166,7 +170,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -208,7 +211,7 @@ def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.D :rtype: ~azure.mgmt.oracledatabase.models.DbSystemShape :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +233,6 @@ def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.D headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -245,7 +247,7 @@ def get(self, location: str, dbsystemshapename: str, **kwargs: Any) -> _models.D error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DbSystemShape", pipeline_response) + deserialized = self._deserialize("DbSystemShape", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py index 346b6c6dcb70..902d785409a6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_views_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,13 +41,13 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,14 +68,14 @@ def build_get_request(location: str, dnsprivateviewocid: str, subscription_id: s _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -113,14 +109,14 @@ class DnsPrivateViewsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DnsPrivateView"]: - """List DnsPrivateView resources by Location. + """List DnsPrivateView resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -134,7 +130,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Dn api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DnsPrivateViewListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -152,7 +148,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -168,7 +163,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -210,7 +204,7 @@ def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models. :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateView :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -232,7 +226,6 @@ def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models. headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -247,7 +240,7 @@ def get(self, location: str, dnsprivateviewocid: str, **kwargs: Any) -> _models. error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DnsPrivateView", pipeline_response) + deserialized = self._deserialize("DnsPrivateView", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py index ef4a951b72d5..e55de85ee16a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_dns_private_zones_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,13 +41,13 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,14 +68,14 @@ def build_get_request(location: str, dnsprivatezonename: str, subscription_id: s _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -111,14 +107,14 @@ class DnsPrivateZonesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.DnsPrivateZone"]: - """List DnsPrivateZone resources by Location. + """List DnsPrivateZone resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -132,7 +128,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Dn api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DnsPrivateZoneListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +146,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -166,7 +161,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -208,7 +202,7 @@ def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models. :rtype: ~azure.mgmt.oracledatabase.models.DnsPrivateZone :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +224,6 @@ def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models. headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -245,7 +238,7 @@ def get(self, location: str, dnsprivatezonename: str, **kwargs: Any) -> _models. error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("DnsPrivateZone", pipeline_response) + deserialized = self._deserialize("DnsPrivateZone", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exadb_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exadb_vm_clusters_operations.py new file mode 100644 index 000000000000..20401a6c3905 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exadb_vm_clusters_operations.py @@ -0,0 +1,1212 @@ +# 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 +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, 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 OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters") + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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_or_update_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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_update_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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_delete_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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_remove_vms_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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) + + +class ExadbVmClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exadb_vm_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by subscription ID. + + :return: An iterator like instance of either ExadbVmCluster or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmClusterListResult] = 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_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("ExadbVmClusterListResult", 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) -> Iterable["_models.ExadbVmCluster"]: + """List ExadbVmCluster resources by 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 either ExadbVmCluster or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmClusterListResult] = 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("ExadbVmClusterListResult", 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, exadb_vm_cluster_name: str, **kwargs: Any) -> _models.ExadbVmCluster: + """Get a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: ExadbVmCluster or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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.ExadbVmCluster] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExadbVmCluster", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, 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, "ExadbVmCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: _models.ExadbVmCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + resource: Union[_models.ExadbVmCluster, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Create a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param resource: Resource create parameters. Is either a ExadbVmCluster type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExadbVmCluster or IO[bytes] + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = 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_or_update_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExadbVmCluster", 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.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, 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(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "ExadbVmClusterUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: _models.ExadbVmClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + properties: Union[_models.ExadbVmClusterUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Update a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param properties: The resource properties to be updated. Is either a ExadbVmClusterUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExadbVmClusterUpdate or IO[bytes] + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = 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, + exadb_vm_cluster_name=exadb_vm_cluster_name, + properties=properties, + 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("ExadbVmCluster", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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, + exadb_vm_cluster_name=exadb_vm_cluster_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 [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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, exadb_vm_cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_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, + exadb_vm_cluster_name=exadb_vm_cluster_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, lro_options={"final-state-via": "location"}, **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 + + def _remove_vms_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "RemoveVirtualMachineFromExadbVmClusterDetails") + + _request = build_remove_vms_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: _models.RemoveVirtualMachineFromExadbVmClusterDetails, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails + :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 ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_remove_vms( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + body: Union[_models.RemoveVirtualMachineFromExadbVmClusterDetails, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExadbVmCluster]: + """Remove VMs from the VM Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param body: The content of the action request. Is either a + RemoveVirtualMachineFromExadbVmClusterDetails type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.RemoveVirtualMachineFromExadbVmClusterDetails or + IO[bytes] + :return: An instance of LROPoller that returns either ExadbVmCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExadbVmCluster] + :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.ExadbVmCluster] = 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._remove_vms_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + body=body, + 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("ExadbVmCluster", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExadbVmCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExadbVmCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_nodes_operations.py new file mode 100644 index 000000000000..257adfc3e0b6 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_nodes_operations.py @@ -0,0 +1,531 @@ +# 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, Dict, IO, Iterable, 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 OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_parent_request( + resource_group_name: str, exadb_vm_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + } + + _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, + exadb_vm_cluster_name: str, + exascale_db_node_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + "exascaleDbNodeName": _SERIALIZER.url("exascale_db_node_name", exascale_db_node_name, "str", pattern=r".*"), + } + + _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_action_request( + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_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", "2025-03-01")) + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exadbVmClusterName": _SERIALIZER.url("exadb_vm_cluster_name", exadb_vm_cluster_name, "str", pattern=r".*"), + "exascaleDbNodeName": _SERIALIZER.url("exascale_db_node_name", exascale_db_node_name, "str", pattern=r".*"), + } + + _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) + + +class ExascaleDbNodesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_nodes` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, resource_group_name: str, exadb_vm_cluster_name: str, **kwargs: Any + ) -> Iterable["_models.ExascaleDbNode"]: + """List ExascaleDbNode resources by ExadbVmCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :return: An iterator like instance of either ExascaleDbNode or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbNode] + :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.ExascaleDbNodeListResult] = 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_parent_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_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("ExascaleDbNodeListResult", 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, exadb_vm_cluster_name: str, exascale_db_node_name: str, **kwargs: Any + ) -> _models.ExascaleDbNode: + """Get a ExascaleDbNode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :return: ExascaleDbNode or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbNode + :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.ExascaleDbNode] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_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("ExascaleDbNode", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _action_initial( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "DbNodeAction") + + _request = build_action_request( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: _models.DbNodeAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction + :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 DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_action( + self, + resource_group_name: str, + exadb_vm_cluster_name: str, + exascale_db_node_name: str, + body: Union[_models.DbNodeAction, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DbActionResponse]: + """VM actions on DbNode of ExadbVmCluster by the provided filter. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exadb_vm_cluster_name: The name of the ExadbVmCluster. Required. + :type exadb_vm_cluster_name: str + :param exascale_db_node_name: The name of the ExascaleDbNode. Required. + :type exascale_db_node_name: str + :param body: The content of the action request. Is either a DbNodeAction type or a IO[bytes] + type. Required. + :type body: ~azure.mgmt.oracledatabase.models.DbNodeAction or IO[bytes] + :return: An instance of LROPoller that returns either DbActionResponse or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.DbActionResponse] + :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.DbActionResponse] = 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._action_initial( + resource_group_name=resource_group_name, + exadb_vm_cluster_name=exadb_vm_cluster_name, + exascale_db_node_name=exascale_db_node_name, + body=body, + 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("DbActionResponse", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DbActionResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DbActionResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_storage_vaults_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_storage_vaults_operations.py new file mode 100644 index 000000000000..cd87c88a8c21 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_exascale_db_storage_vaults_operations.py @@ -0,0 +1,996 @@ +# 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, Dict, IO, Iterable, 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 OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults" + ) + 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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, exascale_db_storage_vault_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str", pattern=r".*" + ), + } + + _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, exascale_db_storage_vault_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", "2025-03-01")) + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str", pattern=r".*" + ), + } + + _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_update_request( + resource_group_name: str, exascale_db_storage_vault_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", "2025-03-01")) + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str", pattern=r".*" + ), + } + + _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_delete_request( + resource_group_name: str, exascale_db_storage_vault_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "exascaleDbStorageVaultName": _SERIALIZER.url( + "exascale_db_storage_vault_name", exascale_db_storage_vault_name, "str", pattern=r".*" + ), + } + + _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) + + +class ExascaleDbStorageVaultsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`exascale_db_storage_vaults` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by subscription ID. + + :return: An iterator like instance of either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVaultListResult] = 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_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("ExascaleDbStorageVaultListResult", 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 + ) -> Iterable["_models.ExascaleDbStorageVault"]: + """List ExascaleDbStorageVault resources by 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 either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVaultListResult] = 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("ExascaleDbStorageVaultListResult", 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, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> _models.ExascaleDbStorageVault: + """Get a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :return: ExascaleDbStorageVault or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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.ExascaleDbStorageVault] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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("ExascaleDbStorageVault", 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, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, 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, "ExascaleDbStorageVault") + + _request = build_create_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: _models.ExascaleDbStorageVault, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault + :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 ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + resource: Union[_models.ExascaleDbStorageVault, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Create a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param resource: Resource create parameters. Is either a ExascaleDbStorageVault type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault or IO[bytes] + :return: An instance of LROPoller that returns either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVault] = 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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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("ExascaleDbStorageVault", 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.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, 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(properties, (IOBase, bytes)): + _content = properties + else: + _json = self._serialize.body(properties, "ExascaleDbStorageVaultTagsUpdate") + + _request = build_update_request( + resource_group_name=resource_group_name, + exascale_db_storage_vault_name=exascale_db_storage_vault_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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: _models.ExascaleDbStorageVaultTagsUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate + :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 ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + exascale_db_storage_vault_name: str, + properties: Union[_models.ExascaleDbStorageVaultTagsUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ExascaleDbStorageVault]: + """Update a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_name: str + :param properties: The resource properties to be updated. Is either a + ExascaleDbStorageVaultTagsUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.oracledatabase.models.ExascaleDbStorageVaultTagsUpdate or + IO[bytes] + :return: An instance of LROPoller that returns either ExascaleDbStorageVault or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.oracledatabase.models.ExascaleDbStorageVault] + :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.ExascaleDbStorageVault] = 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, + exascale_db_storage_vault_name=exascale_db_storage_vault_name, + properties=properties, + 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("ExascaleDbStorageVault", 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": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ExascaleDbStorageVault].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ExascaleDbStorageVault]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, exascale_db_storage_vault_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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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 [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) + + 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.stream_download(self._client._pipeline, decompress=_decompress) + + 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, exascale_db_storage_vault_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a ExascaleDbStorageVault. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param exascale_db_storage_vault_name: The name of the ExascaleDbStorageVault. Required. + :type exascale_db_storage_vault_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, + exascale_db_storage_vault_name=exascale_db_storage_vault_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, lro_options={"final-state-via": "location"}, **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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_flex_components_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_flex_components_operations.py new file mode 100644 index 000000000000..6b86edc34ae0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_flex_components_operations.py @@ -0,0 +1,258 @@ +# 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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +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 .. import models as _models +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_parent_request( + location: str, subscription_id: str, *, shape: Optional[Union[str, _models.SystemShapes]] = None, **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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape is not None: + _params["shape"] = _SERIALIZER.query("shape", shape, "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(location: str, flex_component_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "flexComponentName": _SERIALIZER.url( + "flex_component_name", flex_component_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" + ), + } + + _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 FlexComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`flex_components` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, location: str, shape: Optional[Union[str, _models.SystemShapes]] = None, **kwargs: Any + ) -> Iterable["_models.FlexComponent"]: + """List FlexComponent resources by SubscriptionLocationResource. + + :param location: The name of the Azure region. Required. + :type location: str + :param shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :type shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :return: An iterator like instance of either FlexComponent or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.FlexComponent] + :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.FlexComponentListResult] = 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_parent_request( + location=location, + subscription_id=self._config.subscription_id, + shape=shape, + 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("FlexComponentListResult", 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, location: str, flex_component_name: str, **kwargs: Any) -> _models.FlexComponent: + """Get a FlexComponent. + + :param location: The name of the Azure region. Required. + :type location: str + :param flex_component_name: The name of the FlexComponent. Required. + :type flex_component_name: str + :return: FlexComponent or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.FlexComponent + :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.FlexComponent] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + flex_component_name=flex_component_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("FlexComponent", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_minor_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_minor_versions_operations.py new file mode 100644 index 000000000000..67f129857a11 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_minor_versions_operations.py @@ -0,0 +1,288 @@ +# 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 typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +import urllib.parse + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +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 .. import models as _models +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_by_parent_request( + location: str, + giversionname: str, + subscription_id: str, + *, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "giversionname": _SERIALIZER.url("giversionname", giversionname, "str", pattern=r".*"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape_family is not None: + _params["shapeFamily"] = _SERIALIZER.query("shape_family", shape_family, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "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( + location: str, giversionname: str, gi_minor_version_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", "2025-03-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName}", + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + "giversionname": _SERIALIZER.url("giversionname", giversionname, "str", pattern=r".*"), + "giMinorVersionName": _SERIALIZER.url( + "gi_minor_version_name", gi_minor_version_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" + ), + } + + _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 GiMinorVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.oracledatabase.OracleDatabaseMgmtClient`'s + :attr:`gi_minor_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_parent( + self, + location: str, + giversionname: str, + shape_family: Optional[Union[str, _models.ShapeFamily]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.GiMinorVersion"]: + """List GiMinorVersion resources by GiVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param shape_family: If provided, filters the results to the set of database versions which are + supported for the given shape family. Known values are: "EXADATA" and "EXADB_XS". Default value + is None. + :type shape_family: str or ~azure.mgmt.oracledatabase.models.ShapeFamily + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str + :return: An iterator like instance of either GiMinorVersion or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.GiMinorVersion] + :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.GiMinorVersionListResult] = 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_parent_request( + location=location, + giversionname=giversionname, + subscription_id=self._config.subscription_id, + shape_family=shape_family, + zone=zone, + 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("GiMinorVersionListResult", 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, location: str, giversionname: str, gi_minor_version_name: str, **kwargs: Any + ) -> _models.GiMinorVersion: + """Get a GiMinorVersion. + + :param location: The name of the Azure region. Required. + :type location: str + :param giversionname: GiVersion name. Required. + :type giversionname: str + :param gi_minor_version_name: The name of the GiMinorVersion. Required. + :type gi_minor_version_name: str + :return: GiMinorVersion or the result of cls(response) + :rtype: ~azure.mgmt.oracledatabase.models.GiMinorVersion + :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.GiMinorVersion] = kwargs.pop("cls", None) + + _request = build_get_request( + location=location, + giversionname=giversionname, + gi_minor_version_name=gi_minor_version_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("GiMinorVersion", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py index 3fc75e088a2d..f8d9389d6304 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_gi_versions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +20,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,17 +36,24 @@ _SERIALIZER.client_side_validation = False -def build_list_by_location_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_list_by_location_request( + location: str, + subscription_id: str, + *, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -61,6 +63,10 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if shape is not None: + _params["shape"] = _SERIALIZER.query("shape", shape, "str") + if zone is not None: + _params["zone"] = _SERIALIZER.query("zone", zone, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -72,14 +78,14 @@ def build_get_request(location: str, giversionname: str, subscription_id: str, * _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -111,17 +117,28 @@ class GiVersionsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.GiVersion"]: - """List GiVersion resources by Location. + def list_by_location( + self, + location: str, + shape: Optional[Union[str, _models.SystemShapes]] = None, + zone: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.GiVersion"]: + """List GiVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str + :param shape: If provided, filters the results for the given shape. Known values are: + "Exadata.X9M", "Exadata.X11M", and "ExaDbXS". Default value is None. + :type shape: str or ~azure.mgmt.oracledatabase.models.SystemShapes + :param zone: Filters the result for the given Azure Availability Zone. Default value is None. + :type zone: str :return: An iterator like instance of either GiVersion or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.oracledatabase.models.GiVersion] :raises ~azure.core.exceptions.HttpResponseError: @@ -132,7 +149,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Gi api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GiVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -146,11 +163,12 @@ def prepare_request(next_link=None): _request = build_list_by_location_request( location=location, subscription_id=self._config.subscription_id, + shape=shape, + zone=zone, api_version=api_version, headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -166,7 +184,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -208,7 +225,7 @@ def get(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVer :rtype: ~azure.mgmt.oracledatabase.models.GiVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +247,6 @@ def get(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVer headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -245,7 +261,7 @@ def get(self, location: str, giversionname: str, **kwargs: Any) -> _models.GiVer error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("GiVersion", pipeline_response) + deserialized = self._deserialize("GiVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py index 86d4cb7c1c42..0f2ef91de49c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +20,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,10 +69,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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) -> Iterable["_models.Operation"]: @@ -93,7 +88,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -109,7 +104,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -125,7 +119,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py index 8a2abea9eebb..094f78e939bc 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_oracle_subscriptions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +46,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,13 +70,13 @@ def build_get_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -98,14 +96,14 @@ def build_create_or_update_request(subscription_id: str, **kwargs: Any) -> HttpR _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) 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}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -127,14 +125,14 @@ def build_update_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) 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}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -156,13 +154,13 @@ def build_delete_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -178,18 +176,48 @@ def build_delete_request(subscription_id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_add_azure_subscriptions_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", "2025-03-01")) + 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}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", + ) + 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 + 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_list_activation_links_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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -209,14 +237,14 @@ def build_list_cloud_account_details_request(subscription_id: str, **kwargs: Any _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -238,14 +266,14 @@ def build_list_saas_subscription_details_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -275,10 +303,10 @@ class OracleSubscriptionsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_subscription(self, **kwargs: Any) -> Iterable["_models.OracleSubscription"]: @@ -294,7 +322,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.OracleSubscri api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OracleSubscriptionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +339,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -327,7 +354,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -365,7 +391,7 @@ def get(self, **kwargs: Any) -> _models.OracleSubscription: :rtype: ~azure.mgmt.oracledatabase.models.OracleSubscription :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +411,6 @@ def get(self, **kwargs: Any) -> _models.OracleSubscription: headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -400,7 +425,7 @@ def get(self, **kwargs: Any) -> _models.OracleSubscription: error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -409,8 +434,8 @@ def get(self, **kwargs: Any) -> _models.OracleSubscription: def _create_or_update_initial( self, resource: Union[_models.OracleSubscription, IO[bytes]], **kwargs: Any - ) -> _models.OracleSubscription: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -423,7 +448,7 @@ def _create_or_update_initial( 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.OracleSubscription] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -442,10 +467,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -453,18 +478,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - 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 = self._deserialize("OracleSubscription", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -538,10 +567,11 @@ def begin_create_or_update( 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("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -567,8 +597,8 @@ def get_long_running_output(pipeline_response): def _update_initial( self, properties: Union[_models.OracleSubscriptionUpdate, IO[bytes]], **kwargs: Any - ) -> Optional[_models.OracleSubscription]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -581,7 +611,7 @@ def _update_initial( 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[Optional[_models.OracleSubscription]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -600,10 +630,10 @@ def _update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -611,19 +641,21 @@ def _update_initial( 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("OracleSubscription", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -696,10 +728,11 @@ def begin_update( 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("OracleSubscription", pipeline_response) + deserialized = self._deserialize("OracleSubscription", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -723,8 +756,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _delete_initial(self, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -736,7 +769,7 @@ def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsisten _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( subscription_id=self._config.subscription_id, @@ -744,10 +777,10 @@ def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsisten headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -755,6 +788,10 @@ def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsisten 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -764,8 +801,12 @@ def _delete_initial(self, **kwargs: Any) -> None: # pylint: disable=inconsisten response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete(self, **kwargs: Any) -> LROPoller[None]: @@ -784,9 +825,10 @@ def begin_delete(self, **kwargs: Any) -> LROPoller[None]: 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( # type: ignore + raw_result = self._delete_initial( 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 @@ -810,8 +852,161 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.ActivationLinks]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _add_azure_subscriptions_initial( + self, body: Union[_models.AzureSubscriptions, 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(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "AzureSubscriptions") + + _request = build_add_azure_subscriptions_request( + 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 [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) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_add_azure_subscriptions( + self, body: _models.AzureSubscriptions, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_add_azure_subscriptions( + self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: 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: + """ + + @distributed_trace + def begin_add_azure_subscriptions( + self, body: Union[_models.AzureSubscriptions, IO[bytes]], **kwargs: Any + ) -> LROPoller[None]: + """Add Azure Subscriptions. + + :param body: The content of the action request. Is either a AzureSubscriptions type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.oracledatabase.models.AzureSubscriptions or IO[bytes] + :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 = 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[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._add_azure_subscriptions_initial( + body=body, + 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): # 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, lro_options={"final-state-via": "location"}, **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 + + def _list_activation_links_initial(self, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -823,7 +1018,7 @@ def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.Acti _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[Optional[_models.ActivationLinks]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_list_activation_links_request( subscription_id=self._config.subscription_id, @@ -831,10 +1026,10 @@ def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.Acti headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -842,19 +1037,21 @@ def _list_activation_links_initial(self, **kwargs: Any) -> Optional[_models.Acti 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("ActivationLinks", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -881,10 +1078,11 @@ def begin_list_activation_links(self, **kwargs: Any) -> LROPoller[_models.Activa raw_result = self._list_activation_links_initial( 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): - deserialized = self._deserialize("ActivationLinks", pipeline_response) + deserialized = self._deserialize("ActivationLinks", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -908,8 +1106,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models.CloudAccountDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _list_cloud_account_details_initial(self, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -921,7 +1119,7 @@ def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models _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[Optional[_models.CloudAccountDetails]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_list_cloud_account_details_request( subscription_id=self._config.subscription_id, @@ -929,10 +1127,10 @@ def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -940,19 +1138,21 @@ def _list_cloud_account_details_initial(self, **kwargs: Any) -> Optional[_models 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -979,10 +1179,11 @@ def begin_list_cloud_account_details(self, **kwargs: Any) -> LROPoller[_models.C raw_result = self._list_cloud_account_details_initial( 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): - deserialized = self._deserialize("CloudAccountDetails", pipeline_response) + deserialized = self._deserialize("CloudAccountDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1006,8 +1207,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_models.SaasSubscriptionDetails]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1019,7 +1220,7 @@ def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_mo _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[Optional[_models.SaasSubscriptionDetails]] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_list_saas_subscription_details_request( subscription_id=self._config.subscription_id, @@ -1027,10 +1228,10 @@ def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_mo headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -1038,19 +1239,21 @@ def _list_saas_subscription_details_initial(self, **kwargs: Any) -> Optional[_mo 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 = None response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) - 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.stream_download(self._client._pipeline, decompress=_decompress) + if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1078,10 +1281,11 @@ def begin_list_saas_subscription_details(self, **kwargs: Any) -> LROPoller[_mode raw_result = self._list_saas_subscription_details_initial( 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): - deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response) + deserialized = self._deserialize("SaasSubscriptionDetails", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py index 1b3427533c4f..3388015e6ceb 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_system_versions_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -20,20 +21,15 @@ ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest +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 .. import models as _models -from .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,13 +41,13 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -72,14 +68,14 @@ def build_get_request(location: str, systemversionname: str, subscription_id: st _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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "location": _SERIALIZER.url("location", location, "str", min_length=1), @@ -111,14 +107,14 @@ class SystemVersionsOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.SystemVersion"]: - """List SystemVersion resources by Location. + """List SystemVersion resources by SubscriptionLocationResource. :param location: The name of the Azure region. Required. :type location: str @@ -132,7 +128,7 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Sy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SystemVersionListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -150,7 +146,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -166,7 +161,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -208,7 +202,7 @@ def get(self, location: str, systemversionname: str, **kwargs: Any) -> _models.S :rtype: ~azure.mgmt.oracledatabase.models.SystemVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +224,6 @@ def get(self, location: str, systemversionname: str, **kwargs: Any) -> _models.S headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -245,7 +238,7 @@ def get(self, location: str, systemversionname: str, **kwargs: Any) -> _models.S error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("SystemVersion", pipeline_response) + deserialized = self._deserialize("SystemVersion", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py index 9aab31be0eb0..60cc92abac51 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/azure/mgmt/oracledatabase/operations/_virtual_network_addresses_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,37 +6,35 @@ # 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 -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, 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.pipeline.transport import HttpResponse from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest +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 .._serialization import Serializer -from .._vendor import _convert_request +from .._configuration import OracleDatabaseMgmtClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,20 +42,20 @@ _SERIALIZER.client_side_validation = False -def build_list_by_cloud_vm_cluster_request( +def build_list_by_parent_request( resource_group_name: str, cloudvmclustername: 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", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -87,14 +85,14 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -127,7 +125,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,7 +133,7 @@ def build_create_or_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -170,14 +168,14 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url( @@ -214,13 +212,13 @@ class VirtualNetworkAddressesOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: OracleDatabaseMgmtClientConfiguration = 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_by_cloud_vm_cluster( + def list_by_parent( self, resource_group_name: str, cloudvmclustername: str, **kwargs: Any ) -> Iterable["_models.VirtualNetworkAddress"]: """List VirtualNetworkAddress resources by CloudVmCluster. @@ -241,7 +239,7 @@ def list_by_cloud_vm_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualNetworkAddressListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +250,7 @@ def list_by_cloud_vm_cluster( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_cloud_vm_cluster_request( + _request = build_list_by_parent_request( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, subscription_id=self._config.subscription_id, @@ -260,7 +258,6 @@ def prepare_request(next_link=None): headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) else: @@ -276,7 +273,6 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -323,7 +319,7 @@ def get( :rtype: ~azure.mgmt.oracledatabase.models.VirtualNetworkAddress :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -346,7 +342,6 @@ def get( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) _stream = False @@ -361,7 +356,7 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) + deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -375,8 +370,8 @@ def _create_or_update_initial( virtualnetworkaddressname: str, resource: Union[_models.VirtualNetworkAddress, IO[bytes]], **kwargs: Any - ) -> _models.VirtualNetworkAddress: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +384,7 @@ def _create_or_update_initial( 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.VirtualNetworkAddress] = kwargs.pop("cls", None) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -411,10 +406,10 @@ def _create_or_update_initial( headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -422,18 +417,22 @@ def _create_or_update_initial( 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) response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response) - 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 = self._deserialize("VirtualNetworkAddress", pipeline_response) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -550,10 +549,11 @@ def begin_create_or_update( 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("VirtualNetworkAddress", pipeline_response) + deserialized = self._deserialize("VirtualNetworkAddress", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -577,10 +577,10 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( # pylint: disable=inconsistent-return-statements + def _delete_initial( self, resource_group_name: str, cloudvmclustername: str, virtualnetworkaddressname: str, **kwargs: Any - ) -> None: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + ) -> Iterator[bytes]: + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +592,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _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) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, @@ -603,10 +603,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements headers=_headers, params=_params, ) - _request = _convert_request(_request) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -614,6 +614,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -623,8 +627,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + if cls: - return cls(pipeline_response, None, response_headers) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace def begin_delete( @@ -652,7 +660,7 @@ def begin_delete( 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( # type: ignore + raw_result = self._delete_initial( resource_group_name=resource_group_name, cloudvmclustername=cloudvmclustername, virtualnetworkaddressname=virtualnetworkaddressname, @@ -662,6 +670,7 @@ def begin_delete( 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 diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py index 770123e172d9..8b07e6b1ee46 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py index 6a9d9d6ed170..0e7df884542f 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py index 95a871ec18c4..e8072656fefd 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py index c44123a23a2d..344bda34851d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_backup_list_by_parent.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.autonomous_database_backups.list_by_autonomous_database( + response = client.autonomous_database_backups.list_by_parent( resource_group_name="rg000", autonomousdatabasename="databasedb1", ) @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_listByParent.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py new file mode 100644 index 000000000000..342cf2ee27f2 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_change_disaster_recovery_configuration.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python autonomous_database_change_disaster_recovery_configuration.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.autonomous_databases.begin_change_disaster_recovery_configuration( + resource_group_name="rg000", + autonomousdatabasename="databasedb1", + body={"disasterRecoveryType": "Adg", "isReplicateAutomaticBackups": False}, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_changeDisasterRecoveryConfiguration.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py index 807ca5436113..ece4563b0661 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py index 26a2ec573283..642ecaac2523 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_character_set_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py index 43579c3de1d1..5bfb1257245e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_clone_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -57,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseClone_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py index 644752cab908..bfb179379d10 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -56,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_cross_region_peer_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_cross_region_peer_create.py new file mode 100644 index 000000000000..4dc453ff43bf --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_cross_region_peer_create.py @@ -0,0 +1,58 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python autonomous_database_cross_region_peer_create.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.autonomous_databases.begin_create_or_update( + resource_group_name="rg000", + autonomousdatabasename="databasedb1", + resource={ + "location": "eastus", + "properties": { + "dataBaseType": "CrossRegionDisasterRecovery", + "isReplicateAutomaticBackups": False, + "remoteDisasterRecoveryType": "Adg", + "source": "CrossRegionDisasterRecovery", + "sourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1", + "sourceLocation": "germanywestcentral", + "sourceOcid": "ocid1..aaaaa", + "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "vnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1", + }, + "tags": {"tagK1": "tagV1"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCrossRegionPeer_create.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py index 38e1c3aa88dc..5a8dddd5dc2e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py index 0321ffd38310..554c44cc4c94 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_failover.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_failover.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py index 9262776dc471..96bb3d206f52 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_generate_wallet.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_generateWallet.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_generateWallet.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py index 03fa0a44a22f..3903485ab112 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py index f82aecc817a2..ea2eaea1bd2f 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listByResourceGroup.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_listByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py index 76ad78db200a..c8d6562917eb 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_list_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listBySubscription.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_listBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py index 8b7d0994d9e2..2865cec49ead 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py index 009c4680c32b..d33b0ef4eb1b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_national_character_set_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py index c532ead6a15d..ade8c39328f0 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_restore.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_restore.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py index e6719a3457d7..67c7a5cb2b07 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_shrink.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_shrink.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_shrink.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py index 77ad07d654c8..29406bc7bc5e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_switchover.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_switchover.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py index 206b107456e0..eec7bfe2b878 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py index 9adf403086cd..78cec8532f29 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/autonomous_database_version_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py index cdaefa34f7b2..ab9a308aa722 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_action.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_action.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py index 19e91f87840e..1b16cc37c927 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py index 46c1c2819691..c7f2185bd6c2 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_nodes_list_by_parent.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.db_nodes.list_by_cloud_vm_cluster( + response = client.db_nodes.list_by_parent( resource_group_name="rg000", cloudvmclustername="cluster1", ) @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_listByParent.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_listByParent.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py index 7ef792665291..df28067bc729 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py index a9fe9312f4e0..d5f864474e39 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_servers_list_by_parent.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.db_servers.list_by_cloud_exadata_infrastructure( + response = client.db_servers.list_by_parent( resource_group_name="rg000", cloudexadatainfrastructurename="infra1", ) @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_listByParent.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_listByParent.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py index 61b558fef64b..15d10c2588bd 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py index 9f86ad401e86..a923e8c82b8a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/db_system_shapes_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py index 0b0c969b3e0e..f837e6122280 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py index 0629a4b703ae..1d16f606f0d8 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_views_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py index 8f92c292c7b1..4e724da226e4 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py index d8d53494bcb1..978ecbf3cea7 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/dns_private_zones_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py index 2f87fb2a4eae..73fcbfd4382f 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_add_storage_capacity.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_addStorageCapacity.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_addStorageCapacity.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py index 3c4f30b4d606..d4d49cd085b6 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py index 525bb2437b80..4a472a31bd4b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py index f55f5532bcba..06af43d4574d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py index 2eda62e4e2e2..826379ed4360 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listByResourceGroup.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_listByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py index b2181c65efc8..bef4383ac606 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exa_infra_list_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listBySubscription.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_listBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_create_or_update_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_create_or_update_maximum_set_gen.py new file mode 100644 index 000000000000..b903e740d524 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_create_or_update_maximum_set_gen.py @@ -0,0 +1,92 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_create_or_update_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.begin_create_or_update( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="clusterName", + resource={ + "location": "xojp", + "properties": { + "backupSubnetCidr": "fr", + "backupSubnetOcid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "clusterName": "hssswln", + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": True, + "isHealthMonitoringEnabled": True, + "isIncidentLogsEnabled": True, + }, + "displayName": "dyhkncxzzgcwlfkfygvqlvqbxekvkbhjprmuxtaukewjnfrrnfqgrqsjfgsayrezkspqplrduuomuvtpkqurcoqjdnadlvedgfngglcgafbxtcewxlgckvehhqgfwkokbjoqftunjsgfjwbdaftxoytsphydwogtlnfxxuzzjvqcrin", + "domain": "vzfak", + "enabledEcpuCount": 0, + "exascaleDbStorageVaultId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/exascaleDbStorageVaults/storageVaultName", + "gridImageOcid": "ocid1.dbpatch.oc1..aaaaa3klq", + "gridImageType": "ReleaseUpdate", + "hostname": "tdn", + "iormConfigCache": { + "dbPlans": [{"dbName": "db1", "flashCacheLimit": "none", "share": 32}], + "lifecycleDetails": "Disabled", + "lifecycleState": "Disabled", + "objective": "LowLatency", + }, + "licenseModel": "LicenseIncluded", + "lifecycleState": "Provisioning", + "nodeCount": 8, + "nsgCidrs": [{"destinationPortRange": {"max": 1522, "min": 1520}, "source": "10.0.0.0/16"}], + "ocid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "privateZoneOcid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "scanDnsRecordId": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "scanListenerPortTcp": 9, + "scanListenerPortTcpSsl": 18, + "shape": "evenjblxxfsztdxlcr", + "snapshotFileSystemStorage": {"totalSizeInGbs": 10}, + "sshPublicKeys": ["wiseakllkohemfmnoyteg"], + "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "subnetOcid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "systemVersion": "udwsykstqawwjrvzebfyyccnjzhxtijvywlgnrkqxnboibyppistnbvqqsnsxmjnzeumgnatmarzfnjhglmtrknszthrxtwewwqjbkwytbhtjbgondtktkpvjmxdcuyjupr", + "timeZone": "ayuqnpfkasdzmxlfnkjzrenyogbvcysdbkstjhyjdgxygitlykihtwdiktilukyplgxovaonrqcqaviyaqgyrqfrklqvqyobnxgmzpqbgjhdtjdquhyqnvhavnqpfupaqhdedgdvfomeueeuwjjfiqiyxspybpyj", + "totalEcpuCount": 56, + "totalFileSystemStorage": {"totalSizeInGbs": 10}, + "vmFileSystemStorage": {"totalSizeInGbs": 10}, + "vnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1", + "zoneOcid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + }, + "tags": {"key9683": "umnfswbmhxzsomcluslxhnxxika"}, + "zones": ["iupjvcfsbvfhrebwf"], + }, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_CreateOrUpdate_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_delete_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_delete_maximum_set_gen.py new file mode 100644 index 000000000000..12cc2c4bfbfd --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_delete_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.exadb_vm_clusters.begin_delete( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + ).result() + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_get_maximum_set_gen.py new file mode 100644 index 000000000000..ae39b4fc8a40 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.get( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_resource_group_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_resource_group_maximum_set_gen.py new file mode 100644 index 000000000000..6897d62bc5e0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_resource_group_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_list_by_resource_group_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.list_by_resource_group( + resource_group_name="rgopenapi", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_ListByResourceGroup_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_subscription_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_subscription_maximum_set_gen.py new file mode 100644 index 000000000000..216c41c1c311 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_list_by_subscription_maximum_set_gen.py @@ -0,0 +1,41 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_list_by_subscription_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_ListBySubscription_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py new file mode 100644 index 000000000000..fab5ccec7883 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_remove_vms_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.begin_remove_vms( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + body={ + "dbNodes": [ + { + "dbNodeId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Oracle.Database/exadbVmClusters/vmCluster/dbNodes/dbNodeName" + } + ] + }, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_RemoveVms_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_update_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_update_maximum_set_gen.py new file mode 100644 index 000000000000..38da7ea8c347 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exadb_vm_clusters_update_maximum_set_gen.py @@ -0,0 +1,48 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exadb_vm_clusters_update_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exadb_vm_clusters.begin_update( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + properties={ + "properties": {"nodeCount": 9}, + "tags": {"key6027": "kesrhztqxwjjsexr"}, + "zones": ["zcqfxmpauiqjphmhwwt"], + }, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py new file mode 100644 index 000000000000..c6dd5156a6e7 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_action_maximum_set_gen.py @@ -0,0 +1,45 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_nodes_action_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_nodes.begin_action( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + exascale_db_node_name="dbNodeName", + body={"action": "Start"}, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Action_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_get_maximum_set_gen.py new file mode 100644 index 000000000000..ff697c56ded8 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_get_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_nodes_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_nodes.get( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + exascale_db_node_name="dbNodeName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py new file mode 100644 index 000000000000..9d55a8f7fd7c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_nodes_list_by_parent_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_nodes_list_by_parent_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_nodes.list_by_parent( + resource_group_name="rgopenapi", + exadb_vm_cluster_name="vmClusterName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_ListByParent_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py new file mode 100644 index 000000000000..a5a66299301e --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_create_maximum_set_gen.py @@ -0,0 +1,58 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_create_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_storage_vaults.begin_create( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + resource={ + "location": "ltguhzffucaytqg", + "properties": { + "additionalFlashCacheInPercent": 0, + "description": "dmnvnnduldfmrmkkvvsdtuvmsmruxzzpsfdydgytlckutfozephjygjetrauvbdfcwmti", + "displayName": "hbsybtelyvhpalemszcvartlhwvskrnpiveqfblvkdihoytqaotdgsgauvgivzaftfgeiwlyeqzssicwrrnlxtsmeakbcsxabjlt", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 28, "totalSizeInGbs": 16}, + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 21}, + "lifecycleState": "Provisioning", + "ocid": "ocid1.autonomousdatabase.oc1..aaaaa3klq", + "timeZone": "ltrbozwxjunncicrtzjrpqnqrcjgghohztrdlbfjrbkpenopyldwolslwgrgumjfkyovvkzcuxjujuxtjjzubvqvnhrswnbdgcbslopeofmtepbrrlymqwwszvsglmyuvlcuejshtpokirwklnwpcykhyinjmlqvxtyixlthtdishhmtipbygsayvgqzfrprgppylydlcskbmvwctxifdltippfvsxiughqbojqpqrekxsotnqsk", + }, + "tags": {"key7827": "xqi"}, + "zones": ["qk"], + }, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Create_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py new file mode 100644 index 000000000000..3dfe9179fdc0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_delete_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.exascale_db_storage_vaults.begin_delete( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + ).result() + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py new file mode 100644 index 000000000000..9782b2a80b93 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_storage_vaults.get( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py new file mode 100644 index 000000000000..0d369dc5242b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_list_by_resource_group_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name="rgopenapi", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_ListByResourceGroup_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py new file mode 100644 index 000000000000..7ee23e47dd7b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.py @@ -0,0 +1,41 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_list_by_subscription_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_storage_vaults.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_ListBySubscription_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py new file mode 100644 index 000000000000..1d4ffa701e17 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/exascale_db_storage_vaults_update_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python exascale_db_storage_vaults_update_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.exascale_db_storage_vaults.begin_update( + resource_group_name="rgopenapi", + exascale_db_storage_vault_name="vmClusterName", + properties={"tags": {"key6179": "ouj"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py new file mode 100644 index 000000000000..330e51832a0f --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python flex_components_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.flex_components.get( + location="eastus", + flex_component_name="flexComponent", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py new file mode 100644 index 000000000000..48509cad3f89 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/flex_components_list_by_parent_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python flex_components_list_by_parent_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.flex_components.list_by_parent( + location="eastus", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_ListByParent_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py new file mode 100644 index 000000000000..20181733bdae --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_get_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python gi_minor_versions_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gi_minor_versions.get( + location="eastus", + giversionname="giVersionName", + gi_minor_version_name="giMinorVersionName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py new file mode 100644 index 000000000000..c5210e574dbb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_minor_versions_list_by_parent_maximum_set_gen.py @@ -0,0 +1,44 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python gi_minor_versions_list_by_parent_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gi_minor_versions.list_by_parent( + location="eastus", + giversionname="giVersionName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_ListByParent_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py index 28235a48b7d5..77f5fae89547 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/giVersions_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_maximum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_maximum_set_gen.py new file mode 100644 index 000000000000..cffb0fdadb0c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python gi_versions_get_maximum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gi_versions.get( + location="eastus", + giversionname="giVersionName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_minimum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_minimum_set_gen.py new file mode 100644 index 000000000000..f5234608f4e5 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_get_minimum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python gi_versions_get_minimum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gi_versions.get( + location="eastus", + giversionname="giVersionName", + ) + print(response) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py similarity index 88% rename from sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py rename to sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py index 750275cec17d..53ecbbee10c1 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_maximum_set_gen.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-oracledatabase # USAGE - python gi_versions_list_by_location.py + python gi_versions_list_by_location_maximum_set_gen.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, @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_ListByLocation_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py new file mode 100644 index 000000000000..4f6cefe6eda3 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/gi_versions_list_by_location_minimum_set_gen.py @@ -0,0 +1,43 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python gi_versions_list_by_location_minimum_set_gen.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.gi_versions.list_by_location( + location="eastus", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_ListByLocation_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py index 6180090ba956..99bf92079157 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/operations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/operations_list.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/operations_list.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py new file mode 100644 index 000000000000..d3d54df4e4fb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_add_azure_subscriptions.py @@ -0,0 +1,41 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-oracledatabase +# USAGE + python oracle_subscriptions_add_azure_subscriptions.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 = OracleDatabaseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["00000000-0000-0000-0000-000000000001"]}, + ).result() + + +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_addAzureSubscriptions.json +if __name__ == "__main__": + main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py index 86fefc017010..104bc9fd8397 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py index cc22d43c96f6..0c5e616c4051 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -33,6 +34,6 @@ def main(): client.oracle_subscriptions.begin_delete().result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py index d4cecbdb1dea..fb9c56c2701a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py index 828f5267dc44..59eb3016e687 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_activation_links.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listActivationLinks.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listActivationLinks.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py index f17abbdcad3c..9d4506b3253c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listBySubscription.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py index 63e70fbd2014..f39e54e275a2 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_cloud_account_details.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listCloudAccountDetails.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listCloudAccountDetails.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py index 93c9be83c55f..3fad4fa5b65f 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/oracle_subscriptions_list_saas_subscription_details.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -34,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py index 1110fde7f564..012c713a70f8 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py index 4c0ca9005831..86819d89c1c3 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/system_versions_list_by_location.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_listByLocation.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py index 3e25c5a3ae21..4229ff4a1a1b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py index 70d0e289eb4a..7ef6cbc1e953 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py index 75c8c8a3cb21..bd3255e2577b 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py index 0db239b86191..6b8765d70bc9 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/virtual_network_addresses_list_by_parent.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -30,7 +31,7 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000000", ) - response = client.virtual_network_addresses.list_by_cloud_vm_cluster( + response = client.virtual_network_addresses.list_by_parent( resource_group_name="rg000", cloudvmclustername="cluster1", ) @@ -38,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_listByParent.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_listByParent.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py index 7778c3c7fa3c..cef5ee3ea37a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_add_vms.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_addVms.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_addVms.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py index c92e2274d5a1..94b82e85dc4d 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -77,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_create.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_create.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py index f7221b825f9f..0dd5076a8e1e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_delete.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_delete.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py index 6f140206350b..e49a5931d33a 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_get.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py index 1390d2135e73..1566a5b56804 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listByResourceGroup.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py index ecfb2edfc1b5..4ed894d530ec 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_by_subscription.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -35,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listBySubscription.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py index 0305029a1951..1d506c5c4950 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_list_private_ip_addresses.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listPrivateIpAddresses.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listPrivateIpAddresses.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py index 8be29a083d2c..178084ac0f2e 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_samples/vm_clusters_remove_vms.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,8 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, IO, Union - from azure.identity import DefaultAzureCredential from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_removeVms.json +# x-ms-original-file: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_removeVms.json if __name__ == "__main__": main() diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py new file mode 100644 index 000000000000..26eeda9482fa --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# 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. +# -------------------------------------------------------------------------- +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): + oracledatabasemgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + oracledatabasemgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=oracledatabasemgmt_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/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py new file mode 100644 index 000000000000..6c447d76acc6 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations.py @@ -0,0 +1,145 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseBackupsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_list_by_parent(self, resource_group): + response = self.client.autonomous_database_backups.list_by_parent( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_get(self, resource_group): + response = self.client.autonomous_database_backups.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_backups_begin_create_or_update(self, resource_group): + response = self.client.autonomous_database_backups.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "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", + }, + api_version="2025-03-01", + ).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_autonomous_database_backups_begin_update(self, resource_group): + response = self.client.autonomous_database_backups.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + properties={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "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", + }, + api_version="2025-03-01", + ).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_autonomous_database_backups_begin_delete(self, resource_group): + response = self.client.autonomous_database_backups.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py new file mode 100644 index 000000000000..8953ac095857 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_backups_operations_async.py @@ -0,0 +1,152 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseBackupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_list_by_parent(self, resource_group): + response = self.client.autonomous_database_backups.list_by_parent( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + 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_autonomous_database_backups_get(self, resource_group): + response = await self.client.autonomous_database_backups.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_backups_begin_create_or_update(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "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", + }, + api_version="2025-03-01", + ) + ).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_autonomous_database_backups_begin_update(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + properties={ + "id": "str", + "name": "str", + "properties": { + "autonomousDatabaseOcid": "str", + "backupType": "str", + "databaseSizeInTbs": 0.0, + "dbVersion": "str", + "displayName": "str", + "isAutomatic": bool, + "isRestorable": bool, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "retentionPeriodInDays": 0, + "sizeInTbs": 0.0, + "timeAvailableTil": "2020-02-20 00:00:00", + "timeEnded": "str", + "timeStarted": "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", + }, + api_version="2025-03-01", + ) + ).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_autonomous_database_backups_begin_delete(self, resource_group): + response = await ( + await self.client.autonomous_database_backups.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + adbbackupid="str", + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.py new file mode 100644 index 000000000000..af0f37de73d2 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseCharacterSetsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_character_sets.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_character_sets_get(self, resource_group): + response = self.client.autonomous_database_character_sets.get( + location="str", + adbscharsetname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.py new file mode 100644 index 000000000000..26e650bb9bf3 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_character_sets_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseCharacterSetsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_character_sets.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_autonomous_database_character_sets_get(self, resource_group): + response = await self.client.autonomous_database_character_sets.get( + location="str", + adbscharsetname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.py new file mode 100644 index 000000000000..636a7c116ab7 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseNationalCharacterSetsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_national_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_national_character_sets.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_national_character_sets_get(self, resource_group): + response = self.client.autonomous_database_national_character_sets.get( + location="str", + adbsncharsetname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.py new file mode 100644 index 000000000000..938452989c04 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_national_character_sets_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseNationalCharacterSetsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_national_character_sets_list_by_location(self, resource_group): + response = self.client.autonomous_database_national_character_sets.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_autonomous_database_national_character_sets_get(self, resource_group): + response = await self.client.autonomous_database_national_character_sets.get( + location="str", + adbsncharsetname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.py new file mode 100644 index 000000000000..aa771f9366b7 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_versions_list_by_location(self, resource_group): + response = self.client.autonomous_database_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_database_versions_get(self, resource_group): + response = self.client.autonomous_database_versions.get( + location="str", + autonomousdbversionsname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.py new file mode 100644 index 000000000000..57554c6fc272 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_database_versions_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabaseVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_database_versions_list_by_location(self, resource_group): + response = self.client.autonomous_database_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_autonomous_database_versions_get(self, resource_group): + response = await self.client.autonomous_database_versions.get( + location="str", + autonomousdbversionsname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py new file mode 100644 index 000000000000..2ed1a97b229c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations.py @@ -0,0 +1,223 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabasesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_get(self, resource_group): + response = self.client.autonomous_databases.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_create_or_update(self, resource_group): + response = self.client.autonomous_databases.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": "autonomous_database_base_properties", + "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", + }, + api_version="2025-03-01", + ).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_autonomous_databases_begin_update(self, resource_group): + response = self.client.autonomous_databases.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + properties={ + "properties": { + "adminPassword": "str", + "autonomousMaintenanceScheduleType": "str", + "backupRetentionPeriodInDays": 0, + "computeCount": 0.0, + "cpuCoreCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInGbs": 0, + "dataStorageSizeInTbs": 0, + "databaseEdition": "str", + "displayName": "str", + "isAutoScalingEnabled": bool, + "isAutoScalingForStorageEnabled": bool, + "isLocalDataGuardEnabled": bool, + "isMtlsConnectionRequired": bool, + "licenseModel": "str", + "localAdgAutoFailoverMaxDataLossLimit": 0, + "longTermBackupSchedule": { + "isDisabled": bool, + "repeatCadence": "str", + "retentionPeriodInDays": 0, + "timeOfBackup": "2020-02-20 00:00:00", + }, + "openMode": "str", + "peerDbId": "str", + "permissionLevel": "str", + "role": "str", + "scheduledOperations": { + "dayOfWeek": {"name": "str"}, + "scheduledStartTime": "str", + "scheduledStopTime": "str", + }, + "whitelistedIps": ["str"], + }, + "tags": {"str": "str"}, + }, + api_version="2025-03-01", + ).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_autonomous_databases_begin_delete(self, resource_group): + response = self.client.autonomous_databases.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ).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_autonomous_databases_begin_change_disaster_recovery_configuration(self, resource_group): + response = self.client.autonomous_databases.begin_change_disaster_recovery_configuration( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={ + "disasterRecoveryType": "str", + "isReplicateAutomaticBackups": bool, + "isSnapshotStandby": bool, + "timeSnapshotStandbyEnabledTill": "2020-02-20 00:00:00", + }, + api_version="2025-03-01", + ).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_autonomous_databases_begin_failover(self, resource_group): + response = self.client.autonomous_databases.begin_failover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + api_version="2025-03-01", + ).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_autonomous_databases_generate_wallet(self, resource_group): + response = self.client.autonomous_databases.generate_wallet( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"password": "str", "generateType": "str", "isRegional": bool}, + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_autonomous_databases_begin_restore(self, resource_group): + response = self.client.autonomous_databases.begin_restore( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"timestamp": "2020-02-20 00:00:00"}, + api_version="2025-03-01", + ).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_autonomous_databases_begin_shrink(self, resource_group): + response = self.client.autonomous_databases.begin_shrink( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ).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_autonomous_databases_begin_switchover(self, resource_group): + response = self.client.autonomous_databases.begin_switchover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py new file mode 100644 index 000000000000..2f3e40948cc6 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_autonomous_databases_operations_async.py @@ -0,0 +1,240 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtAutonomousDatabasesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_list_by_subscription(self, resource_group): + response = self.client.autonomous_databases.list_by_subscription( + api_version="2025-03-01", + ) + 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_autonomous_databases_list_by_resource_group(self, resource_group): + response = self.client.autonomous_databases.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + 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_autonomous_databases_get(self, resource_group): + response = await self.client.autonomous_databases.get( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_create_or_update(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_create_or_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": "autonomous_database_base_properties", + "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", + }, + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_update(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_update( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + properties={ + "properties": { + "adminPassword": "str", + "autonomousMaintenanceScheduleType": "str", + "backupRetentionPeriodInDays": 0, + "computeCount": 0.0, + "cpuCoreCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInGbs": 0, + "dataStorageSizeInTbs": 0, + "databaseEdition": "str", + "displayName": "str", + "isAutoScalingEnabled": bool, + "isAutoScalingForStorageEnabled": bool, + "isLocalDataGuardEnabled": bool, + "isMtlsConnectionRequired": bool, + "licenseModel": "str", + "localAdgAutoFailoverMaxDataLossLimit": 0, + "longTermBackupSchedule": { + "isDisabled": bool, + "repeatCadence": "str", + "retentionPeriodInDays": 0, + "timeOfBackup": "2020-02-20 00:00:00", + }, + "openMode": "str", + "peerDbId": "str", + "permissionLevel": "str", + "role": "str", + "scheduledOperations": { + "dayOfWeek": {"name": "str"}, + "scheduledStartTime": "str", + "scheduledStopTime": "str", + }, + "whitelistedIps": ["str"], + }, + "tags": {"str": "str"}, + }, + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_delete(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_delete( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_change_disaster_recovery_configuration(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_change_disaster_recovery_configuration( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={ + "disasterRecoveryType": "str", + "isReplicateAutomaticBackups": bool, + "isSnapshotStandby": bool, + "timeSnapshotStandbyEnabledTill": "2020-02-20 00:00:00", + }, + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_failover(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_failover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + api_version="2025-03-01", + ) + ).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_autonomous_databases_generate_wallet(self, resource_group): + response = await self.client.autonomous_databases.generate_wallet( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"password": "str", "generateType": "str", "isRegional": bool}, + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_autonomous_databases_begin_restore(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_restore( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"timestamp": "2020-02-20 00:00:00"}, + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_shrink(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_shrink( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + api_version="2025-03-01", + ) + ).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_autonomous_databases_begin_switchover(self, resource_group): + response = await ( + await self.client.autonomous_databases.begin_switchover( + resource_group_name=resource_group.name, + autonomousdatabasename="str", + body={"peerDbId": "str", "peerDbLocation": "str", "peerDbOcid": "str"}, + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py new file mode 100644 index 000000000000..c9b84deb30d0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations.py @@ -0,0 +1,193 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtCloudExadataInfrastructuresOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_get(self, resource_group): + response = self.client.cloud_exadata_infrastructures.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_exadata_infrastructures_begin_create_or_update(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_create_or_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + resource={ + "location": "str", + "zones": ["str"], + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "shape": "str", + "activatedStorageCount": 0, + "additionalStorageCount": 0, + "availableStorageSizeInGbs": 0, + "computeCount": 0, + "computeModel": "str", + "cpuCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInTbs": 0.0, + "databaseServerType": "str", + "dbNodeStorageSizeInGbs": 0, + "dbServerVersion": "str", + "definedFileSystemConfiguration": [ + {"isBackupPartition": bool, "isResizable": bool, "minSizeGb": 0, "mountPoint": "str"} + ], + "estimatedPatchingTime": { + "estimatedDbServerPatchingTime": 0, + "estimatedNetworkSwitchesPatchingTime": 0, + "estimatedStorageServerPatchingTime": 0, + "totalEstimatedPatchingTime": 0, + }, + "lastMaintenanceRunId": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "maxCpuCount": 0, + "maxDataStorageInTbs": 0.0, + "maxDbNodeStorageSizeInGbs": 0, + "maxMemoryInGbs": 0, + "memorySizeInGbs": 0, + "monthlyDbServerVersion": "str", + "monthlyStorageServerVersion": "str", + "nextMaintenanceRunId": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "storageCount": 0, + "storageServerType": "str", + "storageServerVersion": "str", + "timeCreated": "str", + "totalStorageSizeInGbs": 0, + }, + "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", + }, + api_version="2025-03-01", + ).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_cloud_exadata_infrastructures_begin_update(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + properties={ + "properties": { + "computeCount": 0, + "customerContacts": [{"email": "str"}], + "displayName": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "storageCount": 0, + }, + "tags": {"str": "str"}, + "zones": ["str"], + }, + api_version="2025-03-01", + ).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_cloud_exadata_infrastructures_begin_delete(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_delete( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ).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_cloud_exadata_infrastructures_begin_add_storage_capacity(self, resource_group): + response = self.client.cloud_exadata_infrastructures.begin_add_storage_capacity( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py new file mode 100644 index 000000000000..ff1264dd876c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_exadata_infrastructures_operations_async.py @@ -0,0 +1,202 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtCloudExadataInfrastructuresOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_list_by_subscription(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_subscription( + api_version="2025-03-01", + ) + 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_cloud_exadata_infrastructures_list_by_resource_group(self, resource_group): + response = self.client.cloud_exadata_infrastructures.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + 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_cloud_exadata_infrastructures_get(self, resource_group): + response = await self.client.cloud_exadata_infrastructures.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_exadata_infrastructures_begin_create_or_update(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_create_or_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + resource={ + "location": "str", + "zones": ["str"], + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "shape": "str", + "activatedStorageCount": 0, + "additionalStorageCount": 0, + "availableStorageSizeInGbs": 0, + "computeCount": 0, + "computeModel": "str", + "cpuCount": 0, + "customerContacts": [{"email": "str"}], + "dataStorageSizeInTbs": 0.0, + "databaseServerType": "str", + "dbNodeStorageSizeInGbs": 0, + "dbServerVersion": "str", + "definedFileSystemConfiguration": [ + {"isBackupPartition": bool, "isResizable": bool, "minSizeGb": 0, "mountPoint": "str"} + ], + "estimatedPatchingTime": { + "estimatedDbServerPatchingTime": 0, + "estimatedNetworkSwitchesPatchingTime": 0, + "estimatedStorageServerPatchingTime": 0, + "totalEstimatedPatchingTime": 0, + }, + "lastMaintenanceRunId": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "maxCpuCount": 0, + "maxDataStorageInTbs": 0.0, + "maxDbNodeStorageSizeInGbs": 0, + "maxMemoryInGbs": 0, + "memorySizeInGbs": 0, + "monthlyDbServerVersion": "str", + "monthlyStorageServerVersion": "str", + "nextMaintenanceRunId": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "storageCount": 0, + "storageServerType": "str", + "storageServerVersion": "str", + "timeCreated": "str", + "totalStorageSizeInGbs": 0, + }, + "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", + }, + api_version="2025-03-01", + ) + ).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_cloud_exadata_infrastructures_begin_update(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_update( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + properties={ + "properties": { + "computeCount": 0, + "customerContacts": [{"email": "str"}], + "displayName": "str", + "maintenanceWindow": { + "customActionTimeoutInMins": 0, + "daysOfWeek": [{"name": "str"}], + "hoursOfDay": [0], + "isCustomActionTimeoutEnabled": bool, + "isMonthlyPatchingEnabled": bool, + "leadTimeInWeeks": 0, + "months": [{"name": "str"}], + "patchingMode": "str", + "preference": "str", + "weeksOfMonth": [0], + }, + "storageCount": 0, + }, + "tags": {"str": "str"}, + "zones": ["str"], + }, + api_version="2025-03-01", + ) + ).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_cloud_exadata_infrastructures_begin_delete(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_delete( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + ).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_cloud_exadata_infrastructures_begin_add_storage_capacity(self, resource_group): + response = await ( + await self.client.cloud_exadata_infrastructures.begin_add_storage_capacity( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py new file mode 100644 index 000000000000..cd0cd6bcb541 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations.py @@ -0,0 +1,224 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtCloudVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_get(self, resource_group): + response = self.client.cloud_vm_clusters.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_create_or_update(self, resource_group): + response = self.client.cloud_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "cloudExadataInfrastructureId": "str", + "cpuCoreCount": 0, + "displayName": "str", + "giVersion": "str", + "hostname": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "vnetId": "str", + "backupSubnetCidr": "str", + "clusterName": "str", + "compartmentId": "str", + "computeModel": "str", + "computeNodes": ["str"], + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "dataStoragePercentage": 0, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "dbServers": ["str"], + "diskRedundancy": "str", + "domain": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "isLocalBackupEnabled": False, + "isSparseDiskgroupEnabled": False, + "lastUpdateHistoryEntryId": "str", + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nodeCount": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "ocpuCount": 0.0, + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "shape": "str", + "storageSizeInGbs": 0, + "subnetOcid": "str", + "systemVersion": "str", + "timeCreated": "2020-02-20 00:00:00", + "timeZone": "str", + "vipIds": ["str"], + "zoneId": "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", + }, + api_version="2025-03-01", + ).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_cloud_vm_clusters_begin_update(self, resource_group): + response = self.client.cloud_vm_clusters.begin_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + properties={ + "properties": { + "computeNodes": ["str"], + "cpuCoreCount": 0, + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "displayName": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "licenseModel": "str", + "memorySizeInGbs": 0, + "ocpuCount": 0.0, + "sshPublicKeys": ["str"], + "storageSizeInGbs": 0, + }, + "tags": {"str": "str"}, + }, + api_version="2025-03-01", + ).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_cloud_vm_clusters_begin_delete(self, resource_group): + response = self.client.cloud_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ).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_cloud_vm_clusters_begin_add_vms(self, resource_group): + response = self.client.cloud_vm_clusters.begin_add_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + api_version="2025-03-01", + ).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_cloud_vm_clusters_list_private_ip_addresses(self, resource_group): + response = self.client.cloud_vm_clusters.list_private_ip_addresses( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"subnetId": "str", "vnicId": "str"}, + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_cloud_vm_clusters_begin_remove_vms(self, resource_group): + response = self.client.cloud_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py new file mode 100644 index 000000000000..4c2a41ebd0e9 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_cloud_vm_clusters_operations_async.py @@ -0,0 +1,235 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtCloudVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_subscription( + api_version="2025-03-01", + ) + 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_cloud_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.cloud_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + 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_cloud_vm_clusters_get(self, resource_group): + response = await self.client.cloud_vm_clusters.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_create_or_update(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "cloudExadataInfrastructureId": "str", + "cpuCoreCount": 0, + "displayName": "str", + "giVersion": "str", + "hostname": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "vnetId": "str", + "backupSubnetCidr": "str", + "clusterName": "str", + "compartmentId": "str", + "computeModel": "str", + "computeNodes": ["str"], + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "dataStoragePercentage": 0, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "dbServers": ["str"], + "diskRedundancy": "str", + "domain": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "isLocalBackupEnabled": False, + "isSparseDiskgroupEnabled": False, + "lastUpdateHistoryEntryId": "str", + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nodeCount": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "ocpuCount": 0.0, + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "shape": "str", + "storageSizeInGbs": 0, + "subnetOcid": "str", + "systemVersion": "str", + "timeCreated": "2020-02-20 00:00:00", + "timeZone": "str", + "vipIds": ["str"], + "zoneId": "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", + }, + api_version="2025-03-01", + ) + ).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_cloud_vm_clusters_begin_update(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + properties={ + "properties": { + "computeNodes": ["str"], + "cpuCoreCount": 0, + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "dataStorageSizeInTbs": 0.0, + "dbNodeStorageSizeInGbs": 0, + "displayName": "str", + "fileSystemConfigurationDetails": [{"fileSystemSizeGb": 0, "mountPoint": "str"}], + "licenseModel": "str", + "memorySizeInGbs": 0, + "ocpuCount": 0.0, + "sshPublicKeys": ["str"], + "storageSizeInGbs": 0, + }, + "tags": {"str": "str"}, + }, + api_version="2025-03-01", + ) + ).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_cloud_vm_clusters_begin_delete(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + ).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_cloud_vm_clusters_begin_add_vms(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_add_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + api_version="2025-03-01", + ) + ).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_cloud_vm_clusters_list_private_ip_addresses(self, resource_group): + response = await self.client.cloud_vm_clusters.list_private_ip_addresses( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"subnetId": "str", "vnicId": "str"}, + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_cloud_vm_clusters_begin_remove_vms(self, resource_group): + response = await ( + await self.client.cloud_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + cloudvmclustername="str", + body={"dbServers": ["str"]}, + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py new file mode 100644 index 000000000000..e289bd650acc --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations.py @@ -0,0 +1,58 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbNodesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_list_by_parent(self, resource_group): + response = self.client.db_nodes.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_get(self, resource_group): + response = self.client.db_nodes.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_nodes_begin_action(self, resource_group): + response = self.client.db_nodes.begin_action( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + body={"action": "str"}, + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.py new file mode 100644 index 000000000000..cfe9850f9f66 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_nodes_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbNodesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_nodes_list_by_parent(self, resource_group): + response = self.client.db_nodes.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + 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_db_nodes_get(self, resource_group): + response = await self.client.db_nodes.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_nodes_begin_action(self, resource_group): + response = await ( + await self.client.db_nodes.begin_action( + resource_group_name=resource_group.name, + cloudvmclustername="str", + dbnodeocid="str", + body={"action": "str"}, + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.py new file mode 100644 index 000000000000..94e5eef6e16c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbServersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_servers_list_by_parent(self, resource_group): + response = self.client.db_servers.list_by_parent( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_servers_get(self, resource_group): + response = self.client.db_servers.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + dbserverocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py new file mode 100644 index 000000000000..eaa151cdd4d2 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_servers_operations_async.py @@ -0,0 +1,45 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbServersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_servers_list_by_parent(self, resource_group): + response = self.client.db_servers.list_by_parent( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + api_version="2025-03-01", + ) + 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_db_servers_get(self, resource_group): + response = await self.client.db_servers.get( + resource_group_name=resource_group.name, + cloudexadatainfrastructurename="str", + dbserverocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.py new file mode 100644 index 000000000000..dfc3424ec722 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbSystemShapesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_system_shapes_list_by_location(self, resource_group): + response = self.client.db_system_shapes.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_db_system_shapes_get(self, resource_group): + response = self.client.db_system_shapes.get( + location="str", + dbsystemshapename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.py new file mode 100644 index 000000000000..868ad9d7ea11 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_db_system_shapes_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDbSystemShapesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_db_system_shapes_list_by_location(self, resource_group): + response = self.client.db_system_shapes.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_db_system_shapes_get(self, resource_group): + response = await self.client.db_system_shapes.get( + location="str", + dbsystemshapename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.py new file mode 100644 index 000000000000..f238b06dc305 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDnsPrivateViewsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_views_list_by_location(self, resource_group): + response = self.client.dns_private_views.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_views_get(self, resource_group): + response = self.client.dns_private_views.get( + location="str", + dnsprivateviewocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.py new file mode 100644 index 000000000000..9886fba97fcb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_views_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDnsPrivateViewsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_views_list_by_location(self, resource_group): + response = self.client.dns_private_views.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_dns_private_views_get(self, resource_group): + response = await self.client.dns_private_views.get( + location="str", + dnsprivateviewocid="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.py new file mode 100644 index 000000000000..8e350beffca0 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDnsPrivateZonesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_zones_list_by_location(self, resource_group): + response = self.client.dns_private_zones.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_dns_private_zones_get(self, resource_group): + response = self.client.dns_private_zones.get( + location="str", + dnsprivatezonename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.py new file mode 100644 index 000000000000..c4d55baa0bbf --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_dns_private_zones_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtDnsPrivateZonesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_dns_private_zones_list_by_location(self, resource_group): + response = self.client.dns_private_zones.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_dns_private_zones_get(self, resource_group): + response = await self.client.dns_private_zones.get( + location="str", + dnsprivatezonename="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py new file mode 100644 index 000000000000..236ea08269aa --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations.py @@ -0,0 +1,172 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExadbVmClustersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_get(self, resource_group): + response = self.client.exadb_vm_clusters.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exadb_vm_clusters_begin_create_or_update(self, resource_group): + response = self.client.exadb_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "enabledEcpuCount": 0, + "exascaleDbStorageVaultId": "str", + "hostname": "str", + "nodeCount": 0, + "shape": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "totalEcpuCount": 0, + "vmFileSystemStorage": {"totalSizeInGbs": 0}, + "vnetId": "str", + "backupSubnetCidr": "str", + "backupSubnetOcid": "str", + "clusterName": "str", + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "domain": "str", + "giVersion": "str", + "gridImageOcid": "str", + "gridImageType": "str", + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "privateZoneOcid": "str", + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "snapshotFileSystemStorage": {"totalSizeInGbs": 0}, + "subnetOcid": "str", + "systemVersion": "str", + "timeZone": "str", + "totalFileSystemStorage": {"totalSizeInGbs": 0}, + "vipIds": ["str"], + "zoneOcid": "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", + "zones": ["str"], + }, + api_version="2025-03-01", + ).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_exadb_vm_clusters_begin_update(self, resource_group): + response = self.client.exadb_vm_clusters.begin_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + properties={"properties": {"nodeCount": 0}, "tags": {"str": "str"}, "zones": ["str"]}, + api_version="2025-03-01", + ).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_exadb_vm_clusters_begin_delete(self, resource_group): + response = self.client.exadb_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ).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_exadb_vm_clusters_begin_remove_vms(self, resource_group): + response = self.client.exadb_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + body={"dbNodes": [{"dbNodeId": "str"}]}, + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py new file mode 100644 index 000000000000..7a0f7534ff16 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exadb_vm_clusters_operations_async.py @@ -0,0 +1,181 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExadbVmClustersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_list_by_subscription(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_subscription( + api_version="2025-03-01", + ) + 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_exadb_vm_clusters_list_by_resource_group(self, resource_group): + response = self.client.exadb_vm_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + 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_exadb_vm_clusters_get(self, resource_group): + response = await self.client.exadb_vm_clusters.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exadb_vm_clusters_begin_create_or_update(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "enabledEcpuCount": 0, + "exascaleDbStorageVaultId": "str", + "hostname": "str", + "nodeCount": 0, + "shape": "str", + "sshPublicKeys": ["str"], + "subnetId": "str", + "totalEcpuCount": 0, + "vmFileSystemStorage": {"totalSizeInGbs": 0}, + "vnetId": "str", + "backupSubnetCidr": "str", + "backupSubnetOcid": "str", + "clusterName": "str", + "dataCollectionOptions": { + "isDiagnosticsEventsEnabled": False, + "isHealthMonitoringEnabled": False, + "isIncidentLogsEnabled": False, + }, + "domain": "str", + "giVersion": "str", + "gridImageOcid": "str", + "gridImageType": "str", + "iormConfigCache": { + "dbPlans": [{"dbName": "str", "flashCacheLimit": "str", "share": 0}], + "lifecycleDetails": "str", + "lifecycleState": "str", + "objective": "str", + }, + "licenseModel": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "listenerPort": 0, + "memorySizeInGbs": 0, + "nsgCidrs": [{"source": "str", "destinationPortRange": {"max": 0, "min": 0}}], + "nsgUrl": "str", + "ociUrl": "str", + "ocid": "str", + "privateZoneOcid": "str", + "provisioningState": "str", + "scanDnsName": "str", + "scanDnsRecordId": "str", + "scanIpIds": ["str"], + "scanListenerPortTcp": 0, + "scanListenerPortTcpSsl": 0, + "snapshotFileSystemStorage": {"totalSizeInGbs": 0}, + "subnetOcid": "str", + "systemVersion": "str", + "timeZone": "str", + "totalFileSystemStorage": {"totalSizeInGbs": 0}, + "vipIds": ["str"], + "zoneOcid": "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", + "zones": ["str"], + }, + api_version="2025-03-01", + ) + ).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_exadb_vm_clusters_begin_update(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_update( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + properties={"properties": {"nodeCount": 0}, "tags": {"str": "str"}, "zones": ["str"]}, + api_version="2025-03-01", + ) + ).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_exadb_vm_clusters_begin_delete(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_delete( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ) + ).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_exadb_vm_clusters_begin_remove_vms(self, resource_group): + response = await ( + await self.client.exadb_vm_clusters.begin_remove_vms( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + body={"dbNodes": [{"dbNodeId": "str"}]}, + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py new file mode 100644 index 000000000000..dd87d79f7b4b --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations.py @@ -0,0 +1,58 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExascaleDbNodesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_list_by_parent(self, resource_group): + response = self.client.exascale_db_nodes.list_by_parent( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_get(self, resource_group): + response = self.client.exascale_db_nodes.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_nodes_begin_action(self, resource_group): + response = self.client.exascale_db_nodes.begin_action( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + body={"action": "str"}, + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.py new file mode 100644 index 000000000000..4e6350a7e18e --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_nodes_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExascaleDbNodesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_nodes_list_by_parent(self, resource_group): + response = self.client.exascale_db_nodes.list_by_parent( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + api_version="2025-03-01", + ) + 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_exascale_db_nodes_get(self, resource_group): + response = await self.client.exascale_db_nodes.get( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_nodes_begin_action(self, resource_group): + response = await ( + await self.client.exascale_db_nodes.begin_action( + resource_group_name=resource_group.name, + exadb_vm_cluster_name="str", + exascale_db_node_name="str", + body={"action": "str"}, + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations.py new file mode 100644 index 000000000000..6f8e5c266e52 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExascaleDbStorageVaultsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_get(self, resource_group): + response = self.client.exascale_db_storage_vaults.get( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_exascale_db_storage_vaults_begin_create(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_create( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 0}, + "additionalFlashCacheInPercent": 0, + "description": "str", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 0, "totalSizeInGbs": 0}, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "timeZone": "str", + "vmClusterCount": 0, + }, + "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", + "zones": ["str"], + }, + api_version="2025-03-01", + ).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_exascale_db_storage_vaults_begin_update(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_update( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + properties={"tags": {"str": "str"}}, + api_version="2025-03-01", + ).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_exascale_db_storage_vaults_begin_delete(self, resource_group): + response = self.client.exascale_db_storage_vaults.begin_delete( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py new file mode 100644 index 000000000000..5b63104539ab --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_exascale_db_storage_vaults_operations_async.py @@ -0,0 +1,126 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtExascaleDbStorageVaultsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_list_by_subscription(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_subscription( + api_version="2025-03-01", + ) + 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_exascale_db_storage_vaults_list_by_resource_group(self, resource_group): + response = self.client.exascale_db_storage_vaults.list_by_resource_group( + resource_group_name=resource_group.name, + api_version="2025-03-01", + ) + 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_exascale_db_storage_vaults_get(self, resource_group): + response = await self.client.exascale_db_storage_vaults.get( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_exascale_db_storage_vaults_begin_create(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_create( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": { + "displayName": "str", + "highCapacityDatabaseStorageInput": {"totalSizeInGbs": 0}, + "additionalFlashCacheInPercent": 0, + "description": "str", + "highCapacityDatabaseStorage": {"availableSizeInGbs": 0, "totalSizeInGbs": 0}, + "lifecycleDetails": "str", + "lifecycleState": "str", + "ociUrl": "str", + "ocid": "str", + "provisioningState": "str", + "timeZone": "str", + "vmClusterCount": 0, + }, + "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", + "zones": ["str"], + }, + api_version="2025-03-01", + ) + ).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_exascale_db_storage_vaults_begin_update(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_update( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + properties={"tags": {"str": "str"}}, + api_version="2025-03-01", + ) + ).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_exascale_db_storage_vaults_begin_delete(self, resource_group): + response = await ( + await self.client.exascale_db_storage_vaults.begin_delete( + resource_group_name=resource_group.name, + exascale_db_storage_vault_name="str", + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.py new file mode 100644 index 000000000000..0e1fc1d59c93 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtFlexComponentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flex_components_list_by_parent(self, resource_group): + response = self.client.flex_components.list_by_parent( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_flex_components_get(self, resource_group): + response = self.client.flex_components.get( + location="str", + flex_component_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.py new file mode 100644 index 000000000000..8cdd26ae4505 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_flex_components_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtFlexComponentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_flex_components_list_by_parent(self, resource_group): + response = self.client.flex_components.list_by_parent( + location="str", + api_version="2025-03-01", + ) + 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_flex_components_get(self, resource_group): + response = await self.client.flex_components.get( + location="str", + flex_component_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.py new file mode 100644 index 000000000000..62ecfb40a956 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtGiMinorVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_minor_versions_list_by_parent(self, resource_group): + response = self.client.gi_minor_versions.list_by_parent( + location="str", + giversionname="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_minor_versions_get(self, resource_group): + response = self.client.gi_minor_versions.get( + location="str", + giversionname="str", + gi_minor_version_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py new file mode 100644 index 000000000000..33394ac2f8fc --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_minor_versions_operations_async.py @@ -0,0 +1,45 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtGiMinorVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_minor_versions_list_by_parent(self, resource_group): + response = self.client.gi_minor_versions.list_by_parent( + location="str", + giversionname="str", + api_version="2025-03-01", + ) + 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_gi_minor_versions_get(self, resource_group): + response = await self.client.gi_minor_versions.get( + location="str", + giversionname="str", + gi_minor_version_name="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.py new file mode 100644 index 000000000000..6e7c0eb477cd --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtGiVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_versions_list_by_location(self, resource_group): + response = self.client.gi_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_gi_versions_get(self, resource_group): + response = self.client.gi_versions.get( + location="str", + giversionname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.py new file mode 100644 index 000000000000..081f3fbcce38 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_gi_versions_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtGiVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_gi_versions_list_by_location(self, resource_group): + response = self.client.gi_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_gi_versions_get(self, resource_group): + response = await self.client.gi_versions.get( + location="str", + giversionname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py new file mode 100644 index 000000000000..a66745968762 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations.py @@ -0,0 +1,29 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_operations_list(self, resource_group): + response = self.client.operations.list( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py new file mode 100644 index 000000000000..ed6933bd9217 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_operations_async.py @@ -0,0 +1,30 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_operations_list(self, resource_group): + response = self.client.operations.list( + api_version="2025-03-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py new file mode 100644 index 000000000000..5336512b8ddb --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations.py @@ -0,0 +1,140 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtOracleSubscriptionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_list_by_subscription(self, resource_group): + response = self.client.oracle_subscriptions.list_by_subscription( + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_get(self, resource_group): + response = self.client.oracle_subscriptions.get( + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_oracle_subscriptions_begin_create_or_update(self, resource_group): + response = self.client.oracle_subscriptions.begin_create_or_update( + resource={ + "id": "str", + "name": "str", + "plan": {"name": "str", "product": "str", "publisher": "str", "promotionCode": "str", "version": "str"}, + "properties": { + "addSubscriptionOperationState": "str", + "azureSubscriptionIds": ["str"], + "cloudAccountId": "str", + "cloudAccountState": "str", + "intent": "str", + "lastOperationStatusDetail": "str", + "productCode": "str", + "provisioningState": "str", + "saasSubscriptionId": "str", + "termUnit": "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", + }, + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_update(self, resource_group): + response = self.client.oracle_subscriptions.begin_update( + properties={ + "plan": {"name": "str", "product": "str", "promotionCode": "str", "publisher": "str", "version": "str"}, + "properties": {"intent": "str", "productCode": "str"}, + }, + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_delete(self, resource_group): + response = self.client.oracle_subscriptions.begin_delete( + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_add_azure_subscriptions(self, resource_group): + response = self.client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["str"]}, + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_list_activation_links(self, resource_group): + response = self.client.oracle_subscriptions.begin_list_activation_links( + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_list_cloud_account_details(self, resource_group): + response = self.client.oracle_subscriptions.begin_list_cloud_account_details( + api_version="2025-03-01", + ).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_oracle_subscriptions_begin_list_saas_subscription_details(self, resource_group): + response = self.client.oracle_subscriptions.begin_list_saas_subscription_details( + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py new file mode 100644 index 000000000000..02cf2f61b3e8 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_oracle_subscriptions_operations_async.py @@ -0,0 +1,167 @@ +# 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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtOracleSubscriptionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_list_by_subscription(self, resource_group): + response = self.client.oracle_subscriptions.list_by_subscription( + api_version="2025-03-01", + ) + 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_oracle_subscriptions_get(self, resource_group): + response = await self.client.oracle_subscriptions.get( + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_oracle_subscriptions_begin_create_or_update(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_create_or_update( + resource={ + "id": "str", + "name": "str", + "plan": { + "name": "str", + "product": "str", + "publisher": "str", + "promotionCode": "str", + "version": "str", + }, + "properties": { + "addSubscriptionOperationState": "str", + "azureSubscriptionIds": ["str"], + "cloudAccountId": "str", + "cloudAccountState": "str", + "intent": "str", + "lastOperationStatusDetail": "str", + "productCode": "str", + "provisioningState": "str", + "saasSubscriptionId": "str", + "termUnit": "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", + }, + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_update(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_update( + properties={ + "plan": { + "name": "str", + "product": "str", + "promotionCode": "str", + "publisher": "str", + "version": "str", + }, + "properties": {"intent": "str", "productCode": "str"}, + }, + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_delete(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_delete( + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_add_azure_subscriptions(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_add_azure_subscriptions( + body={"azureSubscriptionIds": ["str"]}, + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_list_activation_links(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_activation_links( + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_list_cloud_account_details(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_cloud_account_details( + api_version="2025-03-01", + ) + ).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_oracle_subscriptions_begin_list_saas_subscription_details(self, resource_group): + response = await ( + await self.client.oracle_subscriptions.begin_list_saas_subscription_details( + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.py new file mode 100644 index 000000000000..e2836ee9f381 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtSystemVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_system_versions_list_by_location(self, resource_group): + response = self.client.system_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_system_versions_get(self, resource_group): + response = self.client.system_versions.get( + location="str", + systemversionname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.py new file mode 100644 index 000000000000..9109011c2882 --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_system_versions_operations_async.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtSystemVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_system_versions_list_by_location(self, resource_group): + response = self.client.system_versions.list_by_location( + location="str", + api_version="2025-03-01", + ) + 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_system_versions_get(self, resource_group): + response = await self.client.system_versions.get( + location="str", + systemversionname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations.py new file mode 100644 index 000000000000..b4da853ef39c --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtVirtualNetworkAddressesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_list_by_parent(self, resource_group): + response = self.client.virtual_network_addresses.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_get(self, resource_group): + response = self.client.virtual_network_addresses.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_addresses_begin_create_or_update(self, resource_group): + response = self.client.virtual_network_addresses.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "domain": "str", + "ipAddress": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "timeAssigned": "2020-02-20 00:00:00", + "vmOcid": "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", + }, + api_version="2025-03-01", + ).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_virtual_network_addresses_begin_delete(self, resource_group): + response = self.client.virtual_network_addresses.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + api_version="2025-03-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_operations_async.py new file mode 100644 index 000000000000..ba126bfb072a --- /dev/null +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/generated_tests/test_oracle_database_mgmt_virtual_network_addresses_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.oracledatabase.aio import OracleDatabaseMgmtClient + +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 TestOracleDatabaseMgmtVirtualNetworkAddressesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(OracleDatabaseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_list_by_parent(self, resource_group): + response = self.client.virtual_network_addresses.list_by_parent( + resource_group_name=resource_group.name, + cloudvmclustername="str", + api_version="2025-03-01", + ) + 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_virtual_network_addresses_get(self, resource_group): + response = await self.client.virtual_network_addresses.get( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + api_version="2025-03-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_addresses_begin_create_or_update(self, resource_group): + response = await ( + await self.client.virtual_network_addresses.begin_create_or_update( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + resource={ + "id": "str", + "name": "str", + "properties": { + "domain": "str", + "ipAddress": "str", + "lifecycleDetails": "str", + "lifecycleState": "str", + "ocid": "str", + "provisioningState": "str", + "timeAssigned": "2020-02-20 00:00:00", + "vmOcid": "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", + }, + api_version="2025-03-01", + ) + ).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_virtual_network_addresses_begin_delete(self, resource_group): + response = await ( + await self.client.virtual_network_addresses.begin_delete( + resource_group_name=resource_group.name, + cloudvmclustername="str", + virtualnetworkaddressname="str", + api_version="2025-03-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py b/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py index fd71a882c04b..4caf0c79726c 100644 --- a/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py +++ b/sdk/oracledatabase/azure-mgmt-oracledatabase/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -75,8 +74,9 @@ }, install_requires=[ "isodate>=0.6.1", + "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", )