diff --git a/sdk/storagemover/azure-mgmt-storagemover/CHANGELOG.md b/sdk/storagemover/azure-mgmt-storagemover/CHANGELOG.md index a5c48e796ccf..e965185ef88e 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/CHANGELOG.md +++ b/sdk/storagemover/azure-mgmt-storagemover/CHANGELOG.md @@ -1,5 +1,34 @@ # Release History +## 3.2.0 (2026-07-23) + +### Features Added + + - Model `AzureStorageBlobContainerEndpointProperties` added property `allowed_storage_accounts` + - Model `AzureStorageBlobContainerEndpointProperties` added property `enable_cross_tenant_transfer` + - Model `AzureStorageBlobContainerEndpointUpdateProperties` added property `allowed_storage_accounts` + - Model `AzureStorageBlobContainerEndpointUpdateProperties` added property `enable_cross_tenant_transfer` + - Model `AzureStorageSmbFileShareEndpointProperties` added property `allowed_storage_accounts` + - Model `AzureStorageSmbFileShareEndpointProperties` added property `enable_cross_tenant_transfer` + - Model `AzureStorageSmbFileShareEndpointUpdateProperties` added property `allowed_storage_accounts` + - Model `AzureStorageSmbFileShareEndpointUpdateProperties` added property `enable_cross_tenant_transfer` + - Enum `Frequency` added member `HOURLY` + - Model `JobDefinitionProperties` added property `cross_tenant_endpoint_resource_id` + - Model `JobDefinitionProperties` added property `cross_tenant_endpoint_tenant_id` + - Model `JobDefinitionProperties` added property `is_cross_tenant_job` + - Model `JobDefinitionProperties` added property `mover_synced_until` + - Model `JobDefinitionProperties` added property `sync_mode` + - Model `JobDefinitionUpdateProperties` added property `mover_synced_until` + - Model `JobDefinitionUpdateProperties` added property `sync_mode` + - Enum `JobType` added member `ON_PREM_TO_CLOUD_AGENT_LESS` + - Model `NfsMountEndpointProperties` added property `source_type` + - Enum `NfsVersion` added member `NF_SV4_1` + - Model `ScheduleInfo` added property `repeat_interval` + - Model `SmbMountEndpointProperties` added property `source_type` + - Added enum `NfsMountSourceType` + - Added enum `SmbMountSourceType` + - Operation group `JobDefinitionsOperations` added method `reconcile_job` + ## 3.1.0 (2026-04-06) ### Features Added diff --git a/sdk/storagemover/azure-mgmt-storagemover/README.md b/sdk/storagemover/azure-mgmt-storagemover/README.md index bf9773d12602..7bcc8097b2be 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/README.md +++ b/sdk/storagemover/azure-mgmt-storagemover/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Storagemover Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/storagemover/azure-mgmt-storagemover/_metadata.json b/sdk/storagemover/azure-mgmt-storagemover/_metadata.json index fef9811d0773..3c6321b1422e 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/_metadata.json +++ b/sdk/storagemover/azure-mgmt-storagemover/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2025-12-01", + "apiVersion": "2026-05-01", "apiVersions": { - "Microsoft.StorageMover": "2025-12-01" + "Microsoft.StorageMover": "2026-05-01" }, - "commit": "55fc3e7d12df68485d19b10847f24c95579a06f4", + "commit": "f89d3d95044e14c679785fa9e0d28c7c97af870a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/storagemover/StorageMover.Management", - "emitterVersion": "0.61.2" + "typespec_src": "specification/storagemover/resource-manager/Microsoft.StorageMover/StorageMover", + "emitterVersion": "0.63.3", + "httpClientPythonVersion": "^0.34.2" } \ No newline at end of file diff --git a/sdk/storagemover/azure-mgmt-storagemover/api.md b/sdk/storagemover/azure-mgmt-storagemover/api.md new file mode 100644 index 000000000000..a96eadbd7b94 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/api.md @@ -0,0 +1,3571 @@ +```py +namespace azure.mgmt.storagemover + + class azure.mgmt.storagemover.StorageMoverMgmtClient: implements ContextManager + agents: AgentsOperations + connections: ConnectionsOperations + endpoints: EndpointsOperations + job_definitions: JobDefinitionsOperations + job_runs: JobRunsOperations + operations: Operations + projects: ProjectsOperations + storage_movers: StorageMoversOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.storagemover.aio + + class azure.mgmt.storagemover.aio.StorageMoverMgmtClient: implements AsyncContextManager + agents: AgentsOperations + connections: ConnectionsOperations + endpoints: EndpointsOperations + job_definitions: JobDefinitionsOperations + job_runs: JobRunsOperations + operations: Operations + projects: ProjectsOperations + storage_movers: StorageMoversOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.storagemover.aio.operations + + class azure.mgmt.storagemover.aio.operations.AgentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: Agent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: Agent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + **kwargs: Any + ) -> Agent: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Agent]: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: AgentUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: AgentUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + + class azure.mgmt.storagemover.aio.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'connection_name']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'connection_name', 'accept']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'accept']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Connection]: ... + + + class azure.mgmt.storagemover.aio.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: Endpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: Endpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + **kwargs: Any + ) -> Endpoint: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Endpoint]: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: EndpointBaseUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: EndpointBaseUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + + class azure.mgmt.storagemover.aio.operations.JobDefinitionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobDefinition: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> AsyncItemPaged[JobDefinition]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-05-01', params_added_on={'2026-05-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'project_name', 'job_definition_name', 'accept']}, api_versions_list=['2026-05-01']) + async def reconcile_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @distributed_trace_async + async def start_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @distributed_trace_async + async def stop_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinitionUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinitionUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + + class azure.mgmt.storagemover.aio.operations.JobRunsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_run_name: str, + **kwargs: Any + ) -> JobRun: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> AsyncItemPaged[JobRun]: ... + + + class azure.mgmt.storagemover.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.storagemover.aio.operations.ProjectsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> Project: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Project]: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: ProjectUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: ProjectUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + + class azure.mgmt.storagemover.aio.operations.StorageMoversOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMover, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMover, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + async def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> StorageMover: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[StorageMover]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[StorageMover]: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMoverUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMoverUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + async def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + +namespace azure.mgmt.storagemover.models + + class azure.mgmt.storagemover.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.storagemover.models.Agent(ProxyResource): + id: str + name: str + properties: AgentProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: AgentProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.AgentProperties(_Model): + agent_status: Optional[Union[str, AgentStatus]] + agent_version: Optional[str] + arc_resource_id: str + arc_vm_uuid: str + description: Optional[str] + error_details: Optional[AgentPropertiesErrorDetails] + last_status_update: Optional[datetime] + local_ip_address: Optional[str] + memory_in_mb: Optional[int] + number_of_cores: Optional[int] + provisioning_state: Optional[Union[str, ProvisioningState]] + time_zone: Optional[str] + upload_limit_schedule: Optional[UploadLimitSchedule] + uptime_in_seconds: Optional[int] + + @overload + def __init__( + self, + *, + arc_resource_id: str, + arc_vm_uuid: str, + description: Optional[str] = ..., + upload_limit_schedule: Optional[UploadLimitSchedule] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AgentPropertiesErrorDetails(_Model): + code: Optional[str] + message: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AgentStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXECUTING = "Executing" + OFFLINE = "Offline" + ONLINE = "Online" + REGISTERING = "Registering" + REQUIRES_ATTENTION = "RequiresAttention" + UNREGISTERING = "Unregistering" + + + class azure.mgmt.storagemover.models.AgentUpdateParameters(_Model): + properties: Optional[AgentUpdateProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[AgentUpdateProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.AgentUpdateProperties(_Model): + description: Optional[str] + upload_limit_schedule: Optional[UploadLimitSchedule] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + upload_limit_schedule: Optional[UploadLimitSchedule] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureKeyVaultS3WithHmacCredentials(Credentials, discriminator='AzureKeyVaultS3WithHMAC'): + access_key_uri: Optional[str] + secret_key_uri: Optional[str] + type: Literal[CredentialType.AZURE_KEY_VAULT_S3_WITH_HMAC] + + @overload + def __init__( + self, + *, + access_key_uri: Optional[str] = ..., + secret_key_uri: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureKeyVaultSmbCredentials(Credentials, discriminator='AzureKeyVaultSmb'): + password_uri: Optional[str] + type: Literal[CredentialType.AZURE_KEY_VAULT_SMB] + username_uri: Optional[str] + + @overload + def __init__( + self, + *, + password_uri: Optional[str] = ..., + username_uri: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureMultiCloudConnectorEndpointProperties(EndpointBaseProperties, discriminator='AzureMultiCloudConnector'): + aws_s3_bucket_id: str + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + multi_cloud_connector_id: str + provisioning_state: Union[str, ProvisioningState] + + @overload + def __init__( + self, + *, + aws_s3_bucket_id: str, + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + multi_cloud_connector_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureMultiCloudConnectorEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='AzureMultiCloudConnector'): + description: str + endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageBlobContainerEndpointProperties(EndpointBaseProperties, discriminator='AzureStorageBlobContainer'): + allowed_storage_accounts: Optional[list[str]] + blob_container_name: str + description: str + enable_cross_tenant_transfer: Optional[bool] + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + @overload + def __init__( + self, + *, + allowed_storage_accounts: Optional[list[str]] = ..., + blob_container_name: str, + description: Optional[str] = ..., + enable_cross_tenant_transfer: Optional[bool] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + storage_account_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageBlobContainerEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='AzureStorageBlobContainer'): + allowed_storage_accounts: Optional[list[str]] + description: str + enable_cross_tenant_transfer: Optional[bool] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + + @overload + def __init__( + self, + *, + allowed_storage_accounts: Optional[list[str]] = ..., + description: Optional[str] = ..., + enable_cross_tenant_transfer: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageNfsFileShareEndpointProperties(EndpointBaseProperties, discriminator='AzureStorageNfsFileShare'): + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + file_share_name: str + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + file_share_name: str, + storage_account_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageNfsFileShareEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='AzureStorageNfsFileShare'): + description: str + endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageSmbFileShareEndpointProperties(EndpointBaseProperties, discriminator='AzureStorageSmbFileShare'): + allowed_storage_accounts: Optional[list[str]] + description: str + enable_cross_tenant_transfer: Optional[bool] + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + file_share_name: str + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + @overload + def __init__( + self, + *, + allowed_storage_accounts: Optional[list[str]] = ..., + description: Optional[str] = ..., + enable_cross_tenant_transfer: Optional[bool] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + file_share_name: str, + storage_account_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.AzureStorageSmbFileShareEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='AzureStorageSmbFileShare'): + allowed_storage_accounts: Optional[list[str]] + description: str + enable_cross_tenant_transfer: Optional[bool] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + + @overload + def __init__( + self, + *, + allowed_storage_accounts: Optional[list[str]] = ..., + description: Optional[str] = ..., + enable_cross_tenant_transfer: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.Connection(ProxyResource): + id: str + name: str + properties: ConnectionProperties + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: ConnectionProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.ConnectionProperties(_Model): + connection_status: Optional[Union[str, ConnectionStatus]] + description: Optional[str] + job_list: Optional[list[str]] + private_endpoint_name: Optional[str] + private_endpoint_resource_id: Optional[str] + private_link_service_id: str + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + job_list: Optional[list[str]] = ..., + private_link_service_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPROVED = "Approved" + DISCONNECTED = "Disconnected" + PENDING = "Pending" + REJECTED = "Rejected" + STALE = "Stale" + + + class azure.mgmt.storagemover.models.CopyMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ADDITIVE = "Additive" + MIRROR = "Mirror" + + + class azure.mgmt.storagemover.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.storagemover.models.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_KEY_VAULT_S3_WITH_HMAC = "AzureKeyVaultS3WithHMAC" + AZURE_KEY_VAULT_SMB = "AzureKeyVaultSmb" + + + class azure.mgmt.storagemover.models.Credentials(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.DataIntegrityValidation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SAVE_FILE_MD5 = "SaveFileMD5" + SAVE_VERIFY_FILE_MD5 = "SaveVerifyFileMD5" + + + class azure.mgmt.storagemover.models.DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FRIDAY = "Friday" + MONDAY = "Monday" + SATURDAY = "Saturday" + SUNDAY = "Sunday" + THURSDAY = "Thursday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + + + class azure.mgmt.storagemover.models.Endpoint(ProxyResource): + id: str + identity: Optional[ManagedServiceIdentity] + name: str + properties: EndpointBaseProperties + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: EndpointBaseProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.EndpointBaseProperties(_Model): + description: Optional[str] + endpoint_kind: Optional[Union[str, EndpointKind]] + endpoint_type: str + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + endpoint_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.EndpointBaseUpdateParameters(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[EndpointBaseUpdateProperties] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[EndpointBaseUpdateProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.EndpointBaseUpdateProperties(_Model): + description: Optional[str] + endpoint_type: str + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + endpoint_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.EndpointKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SOURCE = "Source" + TARGET = "Target" + + + class azure.mgmt.storagemover.models.EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_MULTI_CLOUD_CONNECTOR = "AzureMultiCloudConnector" + AZURE_STORAGE_BLOB_CONTAINER = "AzureStorageBlobContainer" + AZURE_STORAGE_NFS_FILE_SHARE = "AzureStorageNfsFileShare" + AZURE_STORAGE_SMB_FILE_SHARE = "AzureStorageSmbFileShare" + NFS_MOUNT = "NfsMount" + S3_WITH_HMAC = "S3WithHMAC" + SMB_MOUNT = "SmbMount" + + + class azure.mgmt.storagemover.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.storagemover.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.storagemover.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.Frequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DAILY = "Daily" + HOURLY = "Hourly" + MONTHLY = "Monthly" + NONE = "None" + ONETIME = "Onetime" + WEEKLY = "Weekly" + + + class azure.mgmt.storagemover.models.JobDefinition(ProxyResource): + id: str + name: str + properties: JobDefinitionProperties + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: JobDefinitionProperties + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.JobDefinitionProperties(_Model): + agent_name: Optional[str] + agent_resource_id: Optional[str] + connections: Optional[list[str]] + copy_mode: Union[str, CopyMode] + cross_tenant_endpoint_resource_id: Optional[str] + cross_tenant_endpoint_tenant_id: Optional[str] + data_integrity_validation: Optional[Union[str, DataIntegrityValidation]] + description: Optional[str] + is_cross_tenant_job: Optional[bool] + job_type: Optional[Union[str, JobType]] + latest_job_run_name: Optional[str] + latest_job_run_resource_id: Optional[str] + latest_job_run_status: Optional[Union[str, JobRunStatus]] + mover_synced_until: Optional[datetime] + preserve_permissions: Optional[bool] + provisioning_state: Optional[Union[str, ProvisioningState]] + schedule: Optional[ScheduleInfo] + source_name: str + source_resource_id: Optional[str] + source_subpath: Optional[str] + source_target_map: Optional[JobDefinitionPropertiesSourceTargetMap] + sync_mode: Optional[str] + target_name: str + target_resource_id: Optional[str] + target_subpath: Optional[str] + + @overload + def __init__( + self, + *, + agent_name: Optional[str] = ..., + connections: Optional[list[str]] = ..., + copy_mode: Union[str, CopyMode], + cross_tenant_endpoint_resource_id: Optional[str] = ..., + cross_tenant_endpoint_tenant_id: Optional[str] = ..., + data_integrity_validation: Optional[Union[str, DataIntegrityValidation]] = ..., + description: Optional[str] = ..., + is_cross_tenant_job: Optional[bool] = ..., + job_type: Optional[Union[str, JobType]] = ..., + mover_synced_until: Optional[datetime] = ..., + preserve_permissions: Optional[bool] = ..., + schedule: Optional[ScheduleInfo] = ..., + source_name: str, + source_subpath: Optional[str] = ..., + source_target_map: Optional[JobDefinitionPropertiesSourceTargetMap] = ..., + sync_mode: Optional[str] = ..., + target_name: str, + target_subpath: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.JobDefinitionPropertiesSourceTargetMap(_Model): + value: Optional[list[SourceTargetMap]] + + + class azure.mgmt.storagemover.models.JobDefinitionUpdateParameters(_Model): + properties: Optional[JobDefinitionUpdateProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[JobDefinitionUpdateProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.JobDefinitionUpdateProperties(_Model): + agent_name: Optional[str] + connections: Optional[list[str]] + copy_mode: Optional[Union[str, CopyMode]] + data_integrity_validation: Optional[Union[str, DataIntegrityValidation]] + description: Optional[str] + mover_synced_until: Optional[datetime] + schedule: Optional[ScheduleInfo] + sync_mode: Optional[str] + + @overload + def __init__( + self, + *, + agent_name: Optional[str] = ..., + connections: Optional[list[str]] = ..., + copy_mode: Optional[Union[str, CopyMode]] = ..., + data_integrity_validation: Optional[Union[str, DataIntegrityValidation]] = ..., + description: Optional[str] = ..., + mover_synced_until: Optional[datetime] = ..., + schedule: Optional[ScheduleInfo] = ..., + sync_mode: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.JobRun(ProxyResource): + id: str + name: str + properties: Optional[JobRunProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[JobRunProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.JobRunError(_Model): + code: Optional[str] + message: Optional[str] + target: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + target: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.JobRunProperties(_Model): + agent_name: Optional[str] + agent_resource_id: Optional[str] + bytes_excluded: Optional[int] + bytes_failed: Optional[int] + bytes_no_transfer_needed: Optional[int] + bytes_scanned: Optional[int] + bytes_transferred: Optional[int] + bytes_unsupported: Optional[int] + error: Optional[JobRunError] + execution_end_time: Optional[datetime] + execution_start_time: Optional[datetime] + items_excluded: Optional[int] + items_failed: Optional[int] + items_no_transfer_needed: Optional[int] + items_scanned: Optional[int] + items_transferred: Optional[int] + items_unsupported: Optional[int] + job_definition_properties: Optional[Any] + last_status_update: Optional[datetime] + provisioning_state: Optional[Union[str, ProvisioningState]] + scan_status: Optional[Union[str, JobRunScanStatus]] + scheduled_execution_time: Optional[datetime] + source_name: Optional[str] + source_properties: Optional[Any] + source_resource_id: Optional[str] + status: Optional[Union[str, JobRunStatus]] + target_name: Optional[str] + target_properties: Optional[Any] + target_resource_id: Optional[str] + trigger_type: Optional[Union[str, TriggerType]] + warnings: Optional[list[JobRunWarning]] + + + class azure.mgmt.storagemover.models.JobRunResourceId(_Model): + job_run_resource_id: Optional[str] + + + class azure.mgmt.storagemover.models.JobRunScanStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + NOT_STARTED = "NotStarted" + SCANNING = "Scanning" + + + class azure.mgmt.storagemover.models.JobRunStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CANCELING = "Canceling" + CANCEL_REQUESTED = "CancelRequested" + FAILED = "Failed" + PAUSED_BY_BANDWIDTH_MANAGEMENT = "PausedByBandwidthManagement" + QUEUED = "Queued" + RUNNING = "Running" + STARTED = "Started" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.storagemover.models.JobRunWarning(_Model): + code: Optional[str] + message: Optional[str] + target: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: Optional[str] = ..., + target: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLOUD_TO_CLOUD = "CloudToCloud" + ON_PREM_TO_CLOUD = "OnPremToCloud" + ON_PREM_TO_CLOUD_AGENT_LESS = "OnPremToCloudAgentLess" + + + class azure.mgmt.storagemover.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.storagemover.models.Minute(int, Enum, metaclass=CaseInsensitiveEnumMeta): + THIRTY = 30 + ZERO = 0 + + + class azure.mgmt.storagemover.models.NfsMountEndpointProperties(EndpointBaseProperties, discriminator='NfsMount'): + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.NFS_MOUNT] + export: str + host: str + nfs_version: Optional[Union[str, NfsVersion]] + provisioning_state: Union[str, ProvisioningState] + source_type: Optional[Union[str, NfsMountSourceType]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + export: str, + host: str, + nfs_version: Optional[Union[str, NfsVersion]] = ..., + source_type: Optional[Union[str, NfsMountSourceType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.NfsMountEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='NfsMount'): + description: str + endpoint_type: Literal[EndpointType.NFS_MOUNT] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.NfsMountSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FSXEFS = "FSX-EFS" + NFS_MOUNT = "NfsMount" + + + class azure.mgmt.storagemover.models.NfsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NF_SAUTO = "NFSauto" + NF_SV3 = "NFSv3" + NF_SV4 = "NFSv4" + NF_SV4_1 = "NFSv4_1" + + + class azure.mgmt.storagemover.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.storagemover.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.storagemover.models.Project(ProxyResource): + id: str + name: str + properties: Optional[ProjectProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ProjectProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.ProjectProperties(_Model): + description: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.ProjectUpdateParameters(_Model): + properties: Optional[ProjectUpdateProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ProjectUpdateProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.ProjectUpdateProperties(_Model): + description: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.storagemover.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.models.Recurrence(_Model): + end_time: Time + start_time: Time + + @overload + def __init__( + self, + *, + end_time: Time, + start_time: Time + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.storagemover.models.S3WithHmacEndpointProperties(EndpointBaseProperties, discriminator='S3WithHMAC'): + credentials: Optional[AzureKeyVaultS3WithHmacCredentials] + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + other_source_type_description: Optional[str] + provisioning_state: Union[str, ProvisioningState] + source_type: Optional[Union[str, S3WithHmacSourceType]] + source_uri: Optional[str] + + @overload + def __init__( + self, + *, + credentials: Optional[AzureKeyVaultS3WithHmacCredentials] = ..., + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + other_source_type_description: Optional[str] = ..., + source_type: Optional[Union[str, S3WithHmacSourceType]] = ..., + source_uri: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.S3WithHmacEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='S3WithHMAC'): + credentials: Optional[AzureKeyVaultS3WithHmacCredentials] + description: str + endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + + @overload + def __init__( + self, + *, + credentials: Optional[AzureKeyVaultS3WithHmacCredentials] = ..., + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.S3WithHmacSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALIBABA = "ALIBABA" + DELL_EMC = "DELL_EMC" + GCS = "GCS" + IBM = "IBM" + MINIO = "MINIO" + OTHER = "OTHER" + + + class azure.mgmt.storagemover.models.ScheduleInfo(_Model): + cron_expression: Optional[str] + days_of_month: Optional[list[int]] + days_of_week: Optional[list[str]] + end_date: Optional[datetime] + execution_time: Optional[SchedulerTime] + frequency: Optional[Union[str, Frequency]] + is_active: Optional[bool] + repeat_interval: Optional[str] + start_date: Optional[datetime] + + @overload + def __init__( + self, + *, + cron_expression: Optional[str] = ..., + days_of_month: Optional[list[int]] = ..., + days_of_week: Optional[list[str]] = ..., + end_date: Optional[datetime] = ..., + execution_time: Optional[SchedulerTime] = ..., + frequency: Optional[Union[str, Frequency]] = ..., + is_active: Optional[bool] = ..., + repeat_interval: Optional[str] = ..., + start_date: Optional[datetime] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SchedulerTime(_Model): + hour: Optional[int] + minute: Optional[Union[int, Minute]] + + @overload + def __init__( + self, + *, + hour: Optional[int] = ..., + minute: Optional[Union[int, Minute]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SmbMountEndpointProperties(EndpointBaseProperties, discriminator='SmbMount'): + credentials: Optional[AzureKeyVaultSmbCredentials] + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.SMB_MOUNT] + host: str + provisioning_state: Union[str, ProvisioningState] + share_name: str + source_type: Optional[Union[str, SmbMountSourceType]] + + @overload + def __init__( + self, + *, + credentials: Optional[AzureKeyVaultSmbCredentials] = ..., + description: Optional[str] = ..., + endpoint_kind: Optional[Union[str, EndpointKind]] = ..., + host: str, + share_name: str, + source_type: Optional[Union[str, SmbMountSourceType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SmbMountEndpointUpdateProperties(EndpointBaseUpdateProperties, discriminator='SmbMount'): + credentials: Optional[AzureKeyVaultSmbCredentials] + description: str + endpoint_type: Literal[EndpointType.SMB_MOUNT] + + @overload + def __init__( + self, + *, + credentials: Optional[AzureKeyVaultSmbCredentials] = ..., + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SmbMountSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FSXSMB = "FSX-SMB" + SMB_MOUNT = "SmbMount" + + + class azure.mgmt.storagemover.models.SourceEndpoint(_Model): + properties: Optional[SourceEndpointProperties] + + @overload + def __init__( + self, + *, + properties: Optional[SourceEndpointProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SourceEndpointProperties(_Model): + aws_s3_bucket_id: Optional[str] + name: Optional[str] + source_endpoint_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + aws_s3_bucket_id: Optional[str] = ..., + name: Optional[str] = ..., + source_endpoint_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SourceTargetMap(_Model): + source_endpoint: SourceEndpoint + target_endpoint: TargetEndpoint + + @overload + def __init__( + self, + *, + source_endpoint: SourceEndpoint, + target_endpoint: TargetEndpoint + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.StorageMover(TrackedResource): + id: str + location: str + name: str + properties: Optional[StorageMoverProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[StorageMoverProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.StorageMoverProperties(_Model): + description: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.StorageMoverUpdateParameters(_Model): + properties: Optional[StorageMoverUpdateProperties] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[StorageMoverUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.storagemover.models.StorageMoverUpdateProperties(_Model): + description: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.TargetEndpoint(_Model): + properties: Optional[TargetEndpointProperties] + + @overload + def __init__( + self, + *, + properties: Optional[TargetEndpointProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.TargetEndpointProperties(_Model): + azure_storage_account_resource_id: Optional[str] + azure_storage_blob_container_name: Optional[str] + name: Optional[str] + target_endpoint_resource_id: Optional[str] + + @overload + def __init__( + self, + *, + azure_storage_account_resource_id: Optional[str] = ..., + azure_storage_blob_container_name: Optional[str] = ..., + name: Optional[str] = ..., + target_endpoint_resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.Time(_Model): + hour: int + minute: Optional[Union[int, Minute]] + + @overload + def __init__( + self, + *, + hour: int, + minute: Optional[Union[int, Minute]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANUAL = "Manual" + SCHEDULED = "Scheduled" + + + class azure.mgmt.storagemover.models.UploadLimitSchedule(_Model): + weekly_recurrences: Optional[list[UploadLimitWeeklyRecurrence]] + + @overload + def __init__( + self, + *, + weekly_recurrences: Optional[list[UploadLimitWeeklyRecurrence]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.UploadLimitWeeklyRecurrence(WeeklyRecurrence): + days: Union[list[str, DayOfWeek]] + end_time: Time + limit_in_mbps: int + start_time: Time + + @overload + def __init__( + self, + *, + days: list[Union[str, DayOfWeek]], + end_time: Time, + limit_in_mbps: int, + start_time: Time + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.storagemover.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.storagemover.models.WeeklyRecurrence(Recurrence): + days: list[Union[str, DayOfWeek]] + end_time: Time + start_time: Time + + @overload + def __init__( + self, + *, + days: list[Union[str, DayOfWeek]], + end_time: Time, + start_time: Time + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.mgmt.storagemover.operations + + class azure.mgmt.storagemover.operations.AgentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: Agent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: Agent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + **kwargs: Any + ) -> Agent: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> ItemPaged[Agent]: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: AgentUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: AgentUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + agent_name: str, + agent: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Agent: ... + + + class azure.mgmt.storagemover.operations.ConnectionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'connection_name']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: Connection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + connection: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'connection_name', 'accept']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + def get( + self, + resource_group_name: str, + storage_mover_name: str, + connection_name: str, + **kwargs: Any + ) -> Connection: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-01', params_added_on={'2025-08-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'accept']}, api_versions_list=['2025-08-01', '2025-12-01', '2026-05-01']) + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> ItemPaged[Connection]: ... + + + class azure.mgmt.storagemover.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: Endpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: Endpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + **kwargs: Any + ) -> Endpoint: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> ItemPaged[Endpoint]: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: EndpointBaseUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: EndpointBaseUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + endpoint_name: str, + endpoint: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Endpoint: ... + + + class azure.mgmt.storagemover.operations.JobDefinitionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobDefinition: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> ItemPaged[JobDefinition]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-05-01', params_added_on={'2026-05-01': ['api_version', 'subscription_id', 'resource_group_name', 'storage_mover_name', 'project_name', 'job_definition_name', 'accept']}, api_versions_list=['2026-05-01']) + def reconcile_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @distributed_trace + def start_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @distributed_trace + def stop_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> JobRunResourceId: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinitionUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: JobDefinitionUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_definition: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JobDefinition: ... + + + class azure.mgmt.storagemover.operations.JobRunsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + job_run_name: str, + **kwargs: Any + ) -> JobRun: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> ItemPaged[JobRun]: ... + + + class azure.mgmt.storagemover.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.storagemover.operations.ProjectsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: Project, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + **kwargs: Any + ) -> Project: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> ItemPaged[Project]: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: ProjectUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: ProjectUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + project: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Project: ... + + + class azure.mgmt.storagemover.operations.StorageMoversOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMover, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMover, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + def create_or_update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + storage_mover_name: str, + **kwargs: Any + ) -> StorageMover: ... + + @distributed_trace + def list( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[StorageMover]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[StorageMover]: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMoverUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: StorageMoverUpdateParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + @overload + def update( + self, + resource_group_name: str, + storage_mover_name: str, + storage_mover: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> StorageMover: ... + + +namespace azure.mgmt.storagemover.types + + class azure.mgmt.storagemover.types.Agent(ProxyResource): + key "id": str + key "name": str + key "properties": Required[AgentProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: AgentProperties + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.AgentProperties(TypedDict, total=False): + key "agentStatus": Union[str, AgentStatus] + key "agentVersion": str + key "arcResourceId": Required[str] + key "arcVmUuid": Required[str] + key "description": str + key "errorDetails": ForwardRef('AgentPropertiesErrorDetails', module='types') + key "lastStatusUpdate": str + key "localIPAddress": str + key "memoryInMB": int + key "numberOfCores": int + key "provisioningState": Union[str, ProvisioningState] + key "timeZone": str + key "uploadLimitSchedule": ForwardRef('UploadLimitSchedule', module='types') + key "uptimeInSeconds": int + agent_status: Union[str, AgentStatus] + agent_version: str + arc_resource_id: str + arc_vm_uuid: str + description: str + error_details: AgentPropertiesErrorDetails + last_status_update: str + local_ip_address: str + memory_in_mb: int + number_of_cores: int + provisioning_state: Union[str, ProvisioningState] + time_zone: str + upload_limit_schedule: UploadLimitSchedule + uptime_in_seconds: int + + + class azure.mgmt.storagemover.types.AgentPropertiesErrorDetails(TypedDict, total=False): + key "code": str + key "message": str + code: str + message: str + + + class azure.mgmt.storagemover.types.AgentUpdateParameters(TypedDict, total=False): + key "properties": ForwardRef('AgentUpdateProperties', module='types') + properties: AgentUpdateProperties + + + class azure.mgmt.storagemover.types.AgentUpdateProperties(TypedDict, total=False): + key "description": str + key "uploadLimitSchedule": ForwardRef('UploadLimitSchedule', module='types') + description: str + upload_limit_schedule: UploadLimitSchedule + + + class azure.mgmt.storagemover.types.AzureKeyVaultS3WithHmacCredentials(TypedDict, total=False): + key "accessKeyUri": str + key "secretKeyUri": str + key "type": Required[Literal[CredentialType.AZURE_KEY_VAULT_S3_WITH_HMAC]] + access_key_uri: str + secret_key_uri: str + type: Literal[CredentialType.AZURE_KEY_VAULT_S3_WITH_HMAC] + + + class azure.mgmt.storagemover.types.AzureKeyVaultSmbCredentials(TypedDict, total=False): + key "passwordUri": str + key "type": Required[Literal[CredentialType.AZURE_KEY_VAULT_SMB]] + key "usernameUri": str + password_uri: str + type: Literal[CredentialType.AZURE_KEY_VAULT_SMB] + username_uri: str + + + class azure.mgmt.storagemover.types.AzureMultiCloudConnectorEndpointProperties(TypedDict, total=False): + key "awsS3BucketId": Required[str] + key "description": str + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR]] + key "multiCloudConnectorId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + aws_s3_bucket_id: str + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + multi_cloud_connector_id: str + provisioning_state: Union[str, ProvisioningState] + + + class azure.mgmt.storagemover.types.AzureMultiCloudConnectorEndpointUpdateProperties(TypedDict, total=False): + key "description": str + key "endpointType": Required[Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR]] + description: str + endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + + + class azure.mgmt.storagemover.types.AzureStorageBlobContainerEndpointProperties(TypedDict, total=False): + key "blobContainerName": Required[str] + key "description": str + key "enableCrossTenantTransfer": bool + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER]] + key "provisioningState": Union[str, ProvisioningState] + key "storageAccountResourceId": Required[str] + allowedStorageAccounts: list[str] + allowed_storage_accounts: list[str] + blob_container_name: str + description: str + enable_cross_tenant_transfer: bool + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + + class azure.mgmt.storagemover.types.AzureStorageBlobContainerEndpointUpdateProperties(TypedDict, total=False): + key "description": str + key "enableCrossTenantTransfer": bool + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER]] + allowedStorageAccounts: list[str] + allowed_storage_accounts: list[str] + description: str + enable_cross_tenant_transfer: bool + endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + + + class azure.mgmt.storagemover.types.AzureStorageNfsFileShareEndpointProperties(TypedDict, total=False): + key "description": str + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE]] + key "fileShareName": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "storageAccountResourceId": Required[str] + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + file_share_name: str + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + + class azure.mgmt.storagemover.types.AzureStorageNfsFileShareEndpointUpdateProperties(TypedDict, total=False): + key "description": str + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE]] + description: str + endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + + + class azure.mgmt.storagemover.types.AzureStorageSmbFileShareEndpointProperties(TypedDict, total=False): + key "description": str + key "enableCrossTenantTransfer": bool + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE]] + key "fileShareName": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "storageAccountResourceId": Required[str] + allowedStorageAccounts: list[str] + allowed_storage_accounts: list[str] + description: str + enable_cross_tenant_transfer: bool + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + file_share_name: str + provisioning_state: Union[str, ProvisioningState] + storage_account_resource_id: str + + + class azure.mgmt.storagemover.types.AzureStorageSmbFileShareEndpointUpdateProperties(TypedDict, total=False): + key "description": str + key "enableCrossTenantTransfer": bool + key "endpointType": Required[Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE]] + allowedStorageAccounts: list[str] + allowed_storage_accounts: list[str] + description: str + enable_cross_tenant_transfer: bool + endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + + + class azure.mgmt.storagemover.types.Connection(ProxyResource): + key "id": str + key "name": str + key "properties": Required[ConnectionProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ConnectionProperties + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.ConnectionProperties(TypedDict, total=False): + key "connectionStatus": Union[str, ConnectionStatus] + key "description": str + key "privateEndpointName": str + key "privateEndpointResourceId": str + key "privateLinkServiceId": Required[str] + key "provisioningState": Union[str, ProvisioningState] + connection_status: Union[str, ConnectionStatus] + description: str + jobList: list[str] + job_list: list[str] + private_endpoint_name: str + private_endpoint_resource_id: str + private_link_service_id: str + provisioning_state: Union[str, ProvisioningState] + + + class azure.mgmt.storagemover.types.CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_KEY_VAULT_S3_WITH_HMAC = "AzureKeyVaultS3WithHMAC" + AZURE_KEY_VAULT_SMB = "AzureKeyVaultSmb" + + + class azure.mgmt.storagemover.types.Endpoint(ProxyResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "name": str + key "properties": Required[EndpointBaseProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + name: str + properties: EndpointBaseProperties + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.EndpointBaseUpdateParameters(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('EndpointBaseUpdateProperties', module='types') + identity: ManagedServiceIdentity + properties: EndpointBaseUpdateProperties + + + class azure.mgmt.storagemover.types.EndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_MULTI_CLOUD_CONNECTOR = "AzureMultiCloudConnector" + AZURE_STORAGE_BLOB_CONTAINER = "AzureStorageBlobContainer" + AZURE_STORAGE_NFS_FILE_SHARE = "AzureStorageNfsFileShare" + AZURE_STORAGE_SMB_FILE_SHARE = "AzureStorageSmbFileShare" + NFS_MOUNT = "NfsMount" + S3_WITH_HMAC = "S3WithHMAC" + SMB_MOUNT = "SmbMount" + + + class azure.mgmt.storagemover.types.JobDefinition(ProxyResource): + key "id": str + key "name": str + key "properties": Required[JobDefinitionProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: JobDefinitionProperties + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.JobDefinitionProperties(TypedDict, total=False): + key "agentName": str + key "agentResourceId": str + key "copyMode": Required[Union[str, CopyMode]] + key "crossTenantEndpointResourceId": str + key "crossTenantEndpointTenantId": str + key "dataIntegrityValidation": Union[str, DataIntegrityValidation] + key "description": str + key "isCrossTenantJob": bool + key "jobType": Union[str, JobType] + key "latestJobRunName": str + key "latestJobRunResourceId": str + key "latestJobRunStatus": Union[str, JobRunStatus] + key "moverSyncedUntil": str + key "preservePermissions": bool + key "provisioningState": Union[str, ProvisioningState] + key "schedule": ForwardRef('ScheduleInfo', module='types') + key "sourceName": Required[str] + key "sourceResourceId": str + key "sourceSubpath": str + key "sourceTargetMap": ForwardRef('JobDefinitionPropertiesSourceTargetMap', module='types') + key "syncMode": str + key "targetName": Required[str] + key "targetResourceId": str + key "targetSubpath": str + agent_name: str + agent_resource_id: str + connections: list[str] + copy_mode: Union[str, CopyMode] + cross_tenant_endpoint_resource_id: str + cross_tenant_endpoint_tenant_id: str + data_integrity_validation: Union[str, DataIntegrityValidation] + description: str + is_cross_tenant_job: bool + job_type: Union[str, JobType] + latest_job_run_name: str + latest_job_run_resource_id: str + latest_job_run_status: Union[str, JobRunStatus] + mover_synced_until: str + preserve_permissions: bool + provisioning_state: Union[str, ProvisioningState] + schedule: ScheduleInfo + source_name: str + source_resource_id: str + source_subpath: str + source_target_map: JobDefinitionPropertiesSourceTargetMap + sync_mode: str + target_name: str + target_resource_id: str + target_subpath: str + + + class azure.mgmt.storagemover.types.JobDefinitionPropertiesSourceTargetMap(TypedDict, total=False): + value: list[SourceTargetMap] + + + class azure.mgmt.storagemover.types.JobDefinitionUpdateParameters(TypedDict, total=False): + key "properties": ForwardRef('JobDefinitionUpdateProperties', module='types') + properties: JobDefinitionUpdateProperties + + + class azure.mgmt.storagemover.types.JobDefinitionUpdateProperties(TypedDict, total=False): + key "agentName": str + key "copyMode": Union[str, CopyMode] + key "dataIntegrityValidation": Union[str, DataIntegrityValidation] + key "description": str + key "moverSyncedUntil": str + key "schedule": ForwardRef('ScheduleInfo', module='types') + key "syncMode": str + agent_name: str + connections: list[str] + copy_mode: Union[str, CopyMode] + data_integrity_validation: Union[str, DataIntegrityValidation] + description: str + mover_synced_until: str + schedule: ScheduleInfo + sync_mode: str + + + class azure.mgmt.storagemover.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principal_id: str + tenant_id: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + user_assigned_identities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.storagemover.types.NfsMountEndpointProperties(TypedDict, total=False): + key "description": str + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.NFS_MOUNT]] + key "export": Required[str] + key "host": Required[str] + key "nfsVersion": Union[str, NfsVersion] + key "provisioningState": Union[str, ProvisioningState] + key "sourceType": Union[str, NfsMountSourceType] + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.NFS_MOUNT] + export: str + host: str + nfs_version: Union[str, NfsVersion] + provisioning_state: Union[str, ProvisioningState] + source_type: Union[str, NfsMountSourceType] + + + class azure.mgmt.storagemover.types.NfsMountEndpointUpdateProperties(TypedDict, total=False): + key "description": str + key "endpointType": Required[Literal[EndpointType.NFS_MOUNT]] + description: str + endpoint_type: Literal[EndpointType.NFS_MOUNT] + + + class azure.mgmt.storagemover.types.Project(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('ProjectProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ProjectProperties + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.ProjectProperties(TypedDict, total=False): + key "description": str + key "provisioningState": Union[str, ProvisioningState] + description: str + provisioning_state: Union[str, ProvisioningState] + + + class azure.mgmt.storagemover.types.ProjectUpdateParameters(TypedDict, total=False): + key "properties": ForwardRef('ProjectUpdateProperties', module='types') + properties: ProjectUpdateProperties + + + class azure.mgmt.storagemover.types.ProjectUpdateProperties(TypedDict, total=False): + key "description": str + description: str + + + class azure.mgmt.storagemover.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.Recurrence(TypedDict, total=False): + key "endTime": Required[Time] + key "startTime": Required[Time] + end_time: Time + start_time: Time + + + class azure.mgmt.storagemover.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.storagemover.types.S3WithHmacEndpointProperties(TypedDict, total=False): + key "credentials": ForwardRef('AzureKeyVaultS3WithHmacCredentials', module='types') + key "description": str + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.S3_WITH_HMAC]] + key "otherSourceTypeDescription": str + key "provisioningState": Union[str, ProvisioningState] + key "sourceType": Union[str, S3WithHmacSourceType] + key "sourceUri": str + credentials: AzureKeyVaultS3WithHmacCredentials + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + other_source_type_description: str + provisioning_state: Union[str, ProvisioningState] + source_type: Union[str, S3WithHmacSourceType] + source_uri: str + + + class azure.mgmt.storagemover.types.S3WithHmacEndpointUpdateProperties(TypedDict, total=False): + key "credentials": ForwardRef('AzureKeyVaultS3WithHmacCredentials', module='types') + key "description": str + key "endpointType": Required[Literal[EndpointType.S3_WITH_HMAC]] + credentials: AzureKeyVaultS3WithHmacCredentials + description: str + endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + + + class azure.mgmt.storagemover.types.ScheduleInfo(TypedDict, total=False): + key "cronExpression": str + key "endDate": str + key "executionTime": ForwardRef('SchedulerTime', module='types') + key "frequency": Union[str, Frequency] + key "isActive": bool + key "repeatInterval": str + key "startDate": str + cron_expression: str + daysOfMonth: list[int] + daysOfWeek: list[str] + days_of_month: list[int] + days_of_week: list[str] + end_date: str + execution_time: SchedulerTime + frequency: Union[str, Frequency] + is_active: bool + repeat_interval: str + start_date: str + + + class azure.mgmt.storagemover.types.SchedulerTime(TypedDict, total=False): + key "hour": int + key "minute": Union[int, Minute] + hour: int + minute: Union[int, Minute] + + + class azure.mgmt.storagemover.types.SmbMountEndpointProperties(TypedDict, total=False): + key "credentials": ForwardRef('AzureKeyVaultSmbCredentials', module='types') + key "description": str + key "endpointKind": Union[str, EndpointKind] + key "endpointType": Required[Literal[EndpointType.SMB_MOUNT]] + key "host": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "shareName": Required[str] + key "sourceType": Union[str, SmbMountSourceType] + credentials: AzureKeyVaultSmbCredentials + description: str + endpoint_kind: Union[str, EndpointKind] + endpoint_type: Literal[EndpointType.SMB_MOUNT] + host: str + provisioning_state: Union[str, ProvisioningState] + share_name: str + source_type: Union[str, SmbMountSourceType] + + + class azure.mgmt.storagemover.types.SmbMountEndpointUpdateProperties(TypedDict, total=False): + key "credentials": ForwardRef('AzureKeyVaultSmbCredentials', module='types') + key "description": str + key "endpointType": Required[Literal[EndpointType.SMB_MOUNT]] + credentials: AzureKeyVaultSmbCredentials + description: str + endpoint_type: Literal[EndpointType.SMB_MOUNT] + + + class azure.mgmt.storagemover.types.SourceEndpoint(TypedDict, total=False): + key "properties": ForwardRef('SourceEndpointProperties', module='types') + properties: SourceEndpointProperties + + + class azure.mgmt.storagemover.types.SourceEndpointProperties(TypedDict, total=False): + key "awsS3BucketId": str + key "name": str + key "sourceEndpointResourceId": str + aws_s3_bucket_id: str + name: str + source_endpoint_resource_id: str + + + class azure.mgmt.storagemover.types.SourceTargetMap(TypedDict, total=False): + key "sourceEndpoint": Required[SourceEndpoint] + key "targetEndpoint": Required[TargetEndpoint] + source_endpoint: SourceEndpoint + target_endpoint: TargetEndpoint + + + class azure.mgmt.storagemover.types.StorageMover(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('StorageMoverProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: StorageMoverProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.storagemover.types.StorageMoverProperties(TypedDict, total=False): + key "description": str + key "provisioningState": Union[str, ProvisioningState] + description: str + provisioning_state: Union[str, ProvisioningState] + + + class azure.mgmt.storagemover.types.StorageMoverUpdateParameters(TypedDict, total=False): + key "properties": ForwardRef('StorageMoverUpdateProperties', module='types') + properties: StorageMoverUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.storagemover.types.StorageMoverUpdateProperties(TypedDict, total=False): + key "description": str + description: str + + + class azure.mgmt.storagemover.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.storagemover.types.TargetEndpoint(TypedDict, total=False): + key "properties": ForwardRef('TargetEndpointProperties', module='types') + properties: TargetEndpointProperties + + + class azure.mgmt.storagemover.types.TargetEndpointProperties(TypedDict, total=False): + key "azureStorageAccountResourceId": str + key "azureStorageBlobContainerName": str + key "name": str + key "targetEndpointResourceId": str + azure_storage_account_resource_id: str + azure_storage_blob_container_name: str + name: str + target_endpoint_resource_id: str + + + class azure.mgmt.storagemover.types.Time(TypedDict, total=False): + key "hour": Required[int] + key "minute": Union[int, Minute] + hour: int + minute: Union[int, Minute] + + + class azure.mgmt.storagemover.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.storagemover.types.UploadLimitSchedule(TypedDict, total=False): + weeklyRecurrences: list[UploadLimitWeeklyRecurrence] + weekly_recurrences: list[UploadLimitWeeklyRecurrence] + + + class azure.mgmt.storagemover.types.UploadLimitWeeklyRecurrence(WeeklyRecurrence): + key "days": Required[list[Union[str, DayOfWeek]]] + key "endTime": Required[Time] + key "limitInMbps": Required[int] + key "startTime": Required[Time] + days: list[Union[str, DayOfWeek]] + end_time: Time + limit_in_mbps: int + start_time: Time + + + class azure.mgmt.storagemover.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + client_id: str + principal_id: str + + + class azure.mgmt.storagemover.types.WeeklyRecurrence(Recurrence): + key "days": Required[list[Union[str, DayOfWeek]]] + key "endTime": Required[Time] + key "startTime": Required[Time] + days: list[Union[str, DayOfWeek]] + end_time: Time + start_time: Time + + +``` \ No newline at end of file diff --git a/sdk/storagemover/azure-mgmt-storagemover/api.metadata.yml b/sdk/storagemover/azure-mgmt-storagemover/api.metadata.yml new file mode 100644 index 000000000000..161f343e0cae --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 64f025e0cb180ae8d6e2e4eca509b4bf6a154895c53cc36df7e2478610c21c5d +parserVersion: 0.3.30 +pythonVersion: 3.13.14 diff --git a/sdk/storagemover/azure-mgmt-storagemover/apiview-properties.json b/sdk/storagemover/azure-mgmt-storagemover/apiview-properties.json index 11efb2ba46bc..d8da3db8534a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/apiview-properties.json +++ b/sdk/storagemover/azure-mgmt-storagemover/apiview-properties.json @@ -80,8 +80,10 @@ "azure.mgmt.storagemover.models.EndpointType": "Microsoft.StorageMover.EndpointType", "azure.mgmt.storagemover.models.EndpointKind": "Microsoft.StorageMover.EndpointKind", "azure.mgmt.storagemover.models.NfsVersion": "Microsoft.StorageMover.NfsVersion", + "azure.mgmt.storagemover.models.NfsMountSourceType": "Microsoft.StorageMover.NfsMountSourceType", "azure.mgmt.storagemover.models.CredentialType": "Microsoft.StorageMover.CredentialType", "azure.mgmt.storagemover.models.S3WithHmacSourceType": "Microsoft.StorageMover.S3WithHmacSourceType", + "azure.mgmt.storagemover.models.SmbMountSourceType": "Microsoft.StorageMover.SmbMountSourceType", "azure.mgmt.storagemover.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.storagemover.models.JobType": "Microsoft.StorageMover.JobType", "azure.mgmt.storagemover.models.CopyMode": "Microsoft.StorageMover.CopyMode", @@ -149,6 +151,8 @@ "azure.mgmt.storagemover.aio.operations.JobDefinitionsOperations.start_job": "Microsoft.StorageMover.JobDefinitions.startJob", "azure.mgmt.storagemover.operations.JobDefinitionsOperations.stop_job": "Microsoft.StorageMover.JobDefinitions.stopJob", "azure.mgmt.storagemover.aio.operations.JobDefinitionsOperations.stop_job": "Microsoft.StorageMover.JobDefinitions.stopJob", + "azure.mgmt.storagemover.operations.JobDefinitionsOperations.reconcile_job": "Microsoft.StorageMover.JobDefinitions.reconcileJob", + "azure.mgmt.storagemover.aio.operations.JobDefinitionsOperations.reconcile_job": "Microsoft.StorageMover.JobDefinitions.reconcileJob", "azure.mgmt.storagemover.operations.ConnectionsOperations.create_or_update": "Microsoft.StorageMover.Connections.createOrUpdate", "azure.mgmt.storagemover.aio.operations.ConnectionsOperations.create_or_update": "Microsoft.StorageMover.Connections.createOrUpdate", "azure.mgmt.storagemover.operations.ConnectionsOperations.get": "Microsoft.StorageMover.Connections.get", @@ -161,5 +165,6 @@ "azure.mgmt.storagemover.aio.operations.JobRunsOperations.get": "Microsoft.StorageMover.JobRuns.get", "azure.mgmt.storagemover.operations.JobRunsOperations.list": "Microsoft.StorageMover.JobRuns.list", "azure.mgmt.storagemover.aio.operations.JobRunsOperations.list": "Microsoft.StorageMover.JobRuns.list" - } + }, + "CrossLanguageVersion": "3f52fe18b277" } \ No newline at end of file diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_client.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_client.py index 4523f1c693f6..564af4ef49eb 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_client.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -30,6 +30,11 @@ StorageMoversOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -63,9 +68,9 @@ class StorageMoverMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2025-12-01". - Default value is "2025-12-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-05-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_configuration.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_configuration.py index 287d7fa9afcf..b146deb161a2 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_configuration.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_configuration.py @@ -33,9 +33,9 @@ class StorageMoverMgmtClientConfiguration: # pylint: disable=too-many-instance- :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2025-12-01". - Default value is "2025-12-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-05-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +47,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-12-01") + api_version: str = kwargs.pop("api_version", "2026-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/model_base.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/model_base.py index 7b7f8ba67b53..0f2c5bdfe70f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/model_base.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -420,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +624,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,62 +867,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -667,8 +887,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -693,6 +1022,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -721,7 +1053,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -1067,6 +1399,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1079,6 +1412,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1098,7 +1432,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1111,7 +1448,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1157,6 +1498,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1166,6 +1508,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1190,6 +1533,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1201,10 +1594,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1226,7 +1625,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1238,12 +1639,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1252,6 +1648,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1259,7 +1656,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1268,13 +1665,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1286,8 +1686,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1308,11 +1709,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1323,6 +1742,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/serialization.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/serialization.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_version.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_version.py index 246b0e84ae3d..3807abe8298d 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_version.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.1.0" +VERSION = "3.2.0" diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_client.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_client.py index 7378b9461080..b1d832784486 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_client.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -30,6 +30,11 @@ StorageMoversOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -63,9 +68,9 @@ class StorageMoverMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2025-12-01". - Default value is "2025-12-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-05-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_configuration.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_configuration.py index 9786173cedd1..5a5a907248ca 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_configuration.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/_configuration.py @@ -33,9 +33,9 @@ class StorageMoverMgmtClientConfiguration: # pylint: disable=too-many-instance- :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2025-12-01". - Default value is "2025-12-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-05-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +47,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-12-01") + api_version: str = kwargs.pop("api_version", "2026-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/operations/_operations.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/operations/_operations.py index 90227af31716..b7d5b147df44 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/operations/_operations.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -56,6 +56,7 @@ build_job_definitions_delete_request, build_job_definitions_get_request, build_job_definitions_list_request, + build_job_definitions_reconcile_job_request, build_job_definitions_start_job_request, build_job_definitions_stop_job_request, build_job_definitions_update_request, @@ -78,7 +79,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list @@ -146,7 +146,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -308,7 +311,7 @@ async def create_or_update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: JSON, + storage_mover: _types.StorageMover, *, content_type: str = "application/json", **kwargs: Any @@ -321,7 +324,7 @@ async def create_or_update( :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str :param storage_mover: Required. - :type storage_mover: JSON + :type storage_mover: ~azure.mgmt.storagemover.types.StorageMover :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -362,7 +365,7 @@ async def create_or_update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: Union[_models.StorageMover, JSON, IO[bytes]], + storage_mover: Union[_models.StorageMover, _types.StorageMover, IO[bytes]], **kwargs: Any ) -> _models.StorageMover: """Creates or updates a top-level Storage Mover resource. @@ -372,8 +375,9 @@ async def create_or_update( :type resource_group_name: str :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str - :param storage_mover: Is one of the following types: StorageMover, JSON, IO[bytes] Required. - :type storage_mover: ~azure.mgmt.storagemover.models.StorageMover or JSON or IO[bytes] + :param storage_mover: Is either a StorageMover type or a IO[bytes] type. Required. + :type storage_mover: ~azure.mgmt.storagemover.models.StorageMover or + ~azure.mgmt.storagemover.types.StorageMover or IO[bytes] :return: StorageMover. The StorageMover is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.StorageMover :raises ~azure.core.exceptions.HttpResponseError: @@ -478,7 +482,7 @@ async def update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: JSON, + storage_mover: _types.StorageMoverUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -492,7 +496,7 @@ async def update( :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str :param storage_mover: Required. - :type storage_mover: JSON + :type storage_mover: ~azure.mgmt.storagemover.types.StorageMoverUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -534,7 +538,7 @@ async def update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: Union[_models.StorageMoverUpdateParameters, JSON, IO[bytes]], + storage_mover: Union[_models.StorageMoverUpdateParameters, _types.StorageMoverUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.StorageMover: """Updates properties for a Storage Mover resource. Properties not specified in the request body @@ -545,10 +549,10 @@ async def update( :type resource_group_name: str :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str - :param storage_mover: Is one of the following types: StorageMoverUpdateParameters, JSON, - IO[bytes] Required. - :type storage_mover: ~azure.mgmt.storagemover.models.StorageMoverUpdateParameters or JSON or - IO[bytes] + :param storage_mover: Is either a StorageMoverUpdateParameters type or a IO[bytes] type. + Required. + :type storage_mover: ~azure.mgmt.storagemover.models.StorageMoverUpdateParameters or + ~azure.mgmt.storagemover.types.StorageMoverUpdateParameters or IO[bytes] :return: StorageMover. The StorageMover is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.StorageMover :raises ~azure.core.exceptions.HttpResponseError: @@ -792,7 +796,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -882,7 +889,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1054,7 +1064,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: JSON, + agent: _types.Agent, *, content_type: str = "application/json", **kwargs: Any @@ -1070,7 +1080,7 @@ async def create_or_update( :param agent_name: The name of the Agent resource. Required. :type agent_name: str :param agent: Required. - :type agent: JSON + :type agent: ~azure.mgmt.storagemover.types.Agent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1116,7 +1126,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: Union[_models.Agent, JSON, IO[bytes]], + agent: Union[_models.Agent, _types.Agent, IO[bytes]], **kwargs: Any ) -> _models.Agent: """Creates or updates an Agent resource, which references a hybrid compute machine that can run @@ -1129,8 +1139,9 @@ async def create_or_update( :type storage_mover_name: str :param agent_name: The name of the Agent resource. Required. :type agent_name: str - :param agent: Is one of the following types: Agent, JSON, IO[bytes] Required. - :type agent: ~azure.mgmt.storagemover.models.Agent or JSON or IO[bytes] + :param agent: Is either a Agent type or a IO[bytes] type. Required. + :type agent: ~azure.mgmt.storagemover.models.Agent or ~azure.mgmt.storagemover.types.Agent or + IO[bytes] :return: Agent. The Agent is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Agent :raises ~azure.core.exceptions.HttpResponseError: @@ -1239,7 +1250,7 @@ async def update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: JSON, + agent: _types.AgentUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -1254,7 +1265,7 @@ async def update( :param agent_name: The name of the Agent resource. Required. :type agent_name: str :param agent: Required. - :type agent: JSON + :type agent: ~azure.mgmt.storagemover.types.AgentUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1299,7 +1310,7 @@ async def update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: Union[_models.AgentUpdateParameters, JSON, IO[bytes]], + agent: Union[_models.AgentUpdateParameters, _types.AgentUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Agent: """Creates or updates an Agent resource. @@ -1311,8 +1322,9 @@ async def update( :type storage_mover_name: str :param agent_name: The name of the Agent resource. Required. :type agent_name: str - :param agent: Is one of the following types: AgentUpdateParameters, JSON, IO[bytes] Required. - :type agent: ~azure.mgmt.storagemover.models.AgentUpdateParameters or JSON or IO[bytes] + :param agent: Is either a AgentUpdateParameters type or a IO[bytes] type. Required. + :type agent: ~azure.mgmt.storagemover.models.AgentUpdateParameters or + ~azure.mgmt.storagemover.types.AgentUpdateParameters or IO[bytes] :return: Agent. The Agent is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Agent :raises ~azure.core.exceptions.HttpResponseError: @@ -1564,7 +1576,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1736,7 +1751,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: JSON, + endpoint: _types.Endpoint, *, content_type: str = "application/json", **kwargs: Any @@ -1752,7 +1767,7 @@ async def create_or_update( :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str :param endpoint: Required. - :type endpoint: JSON + :type endpoint: ~azure.mgmt.storagemover.types.Endpoint :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1798,7 +1813,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: Union[_models.Endpoint, JSON, IO[bytes]], + endpoint: Union[_models.Endpoint, _types.Endpoint, IO[bytes]], **kwargs: Any ) -> _models.Endpoint: """Creates or updates an Endpoint resource, which represents a data transfer source or @@ -1811,8 +1826,9 @@ async def create_or_update( :type storage_mover_name: str :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str - :param endpoint: Is one of the following types: Endpoint, JSON, IO[bytes] Required. - :type endpoint: ~azure.mgmt.storagemover.models.Endpoint or JSON or IO[bytes] + :param endpoint: Is either a Endpoint type or a IO[bytes] type. Required. + :type endpoint: ~azure.mgmt.storagemover.models.Endpoint or + ~azure.mgmt.storagemover.types.Endpoint or IO[bytes] :return: Endpoint. The Endpoint is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Endpoint :raises ~azure.core.exceptions.HttpResponseError: @@ -1922,7 +1938,7 @@ async def update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: JSON, + endpoint: _types.EndpointBaseUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -1938,7 +1954,7 @@ async def update( :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str :param endpoint: Required. - :type endpoint: JSON + :type endpoint: ~azure.mgmt.storagemover.types.EndpointBaseUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1984,7 +2000,7 @@ async def update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: Union[_models.EndpointBaseUpdateParameters, JSON, IO[bytes]], + endpoint: Union[_models.EndpointBaseUpdateParameters, _types.EndpointBaseUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Endpoint: """Updates properties for an Endpoint resource. Properties not specified in the request body will @@ -1997,10 +2013,9 @@ async def update( :type storage_mover_name: str :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str - :param endpoint: Is one of the following types: EndpointBaseUpdateParameters, JSON, IO[bytes] - Required. - :type endpoint: ~azure.mgmt.storagemover.models.EndpointBaseUpdateParameters or JSON or - IO[bytes] + :param endpoint: Is either a EndpointBaseUpdateParameters type or a IO[bytes] type. Required. + :type endpoint: ~azure.mgmt.storagemover.models.EndpointBaseUpdateParameters or + ~azure.mgmt.storagemover.types.EndpointBaseUpdateParameters or IO[bytes] :return: Endpoint. The Endpoint is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Endpoint :raises ~azure.core.exceptions.HttpResponseError: @@ -2254,7 +2269,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2425,7 +2443,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: JSON, + project: _types.Project, *, content_type: str = "application/json", **kwargs: Any @@ -2440,7 +2458,7 @@ async def create_or_update( :param project_name: The name of the Project resource. Required. :type project_name: str :param project: Required. - :type project: JSON + :type project: ~azure.mgmt.storagemover.types.Project :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2485,7 +2503,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: Union[_models.Project, JSON, IO[bytes]], + project: Union[_models.Project, _types.Project, IO[bytes]], **kwargs: Any ) -> _models.Project: """Creates or updates a Project resource, which is a logical grouping of related jobs. @@ -2497,8 +2515,9 @@ async def create_or_update( :type storage_mover_name: str :param project_name: The name of the Project resource. Required. :type project_name: str - :param project: Is one of the following types: Project, JSON, IO[bytes] Required. - :type project: ~azure.mgmt.storagemover.models.Project or JSON or IO[bytes] + :param project: Is either a Project type or a IO[bytes] type. Required. + :type project: ~azure.mgmt.storagemover.models.Project or + ~azure.mgmt.storagemover.types.Project or IO[bytes] :return: Project. The Project is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Project :raises ~azure.core.exceptions.HttpResponseError: @@ -2608,7 +2627,7 @@ async def update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: JSON, + project: _types.ProjectUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -2624,7 +2643,7 @@ async def update( :param project_name: The name of the Project resource. Required. :type project_name: str :param project: Required. - :type project: JSON + :type project: ~azure.mgmt.storagemover.types.ProjectUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2670,7 +2689,7 @@ async def update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: Union[_models.ProjectUpdateParameters, JSON, IO[bytes]], + project: Union[_models.ProjectUpdateParameters, _types.ProjectUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Project: """Updates properties for a Project resource. Properties not specified in the request body will be @@ -2683,9 +2702,9 @@ async def update( :type storage_mover_name: str :param project_name: The name of the Project resource. Required. :type project_name: str - :param project: Is one of the following types: ProjectUpdateParameters, JSON, IO[bytes] - Required. - :type project: ~azure.mgmt.storagemover.models.ProjectUpdateParameters or JSON or IO[bytes] + :param project: Is either a ProjectUpdateParameters type or a IO[bytes] type. Required. + :type project: ~azure.mgmt.storagemover.models.ProjectUpdateParameters or + ~azure.mgmt.storagemover.types.ProjectUpdateParameters or IO[bytes] :return: Project. The Project is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Project :raises ~azure.core.exceptions.HttpResponseError: @@ -2939,7 +2958,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3123,7 +3145,7 @@ async def create_or_update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: JSON, + job_definition: _types.JobDefinition, *, content_type: str = "application/json", **kwargs: Any @@ -3141,7 +3163,7 @@ async def create_or_update( :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str :param job_definition: Required. - :type job_definition: JSON + :type job_definition: ~azure.mgmt.storagemover.types.JobDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3191,7 +3213,7 @@ async def create_or_update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: Union[_models.JobDefinition, JSON, IO[bytes]], + job_definition: Union[_models.JobDefinition, _types.JobDefinition, IO[bytes]], **kwargs: Any ) -> _models.JobDefinition: """Creates or updates a Job Definition resource, which contains configuration for a single unit of @@ -3206,8 +3228,9 @@ async def create_or_update( :type project_name: str :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str - :param job_definition: Is one of the following types: JobDefinition, JSON, IO[bytes] Required. - :type job_definition: ~azure.mgmt.storagemover.models.JobDefinition or JSON or IO[bytes] + :param job_definition: Is either a JobDefinition type or a IO[bytes] type. Required. + :type job_definition: ~azure.mgmt.storagemover.models.JobDefinition or + ~azure.mgmt.storagemover.types.JobDefinition or IO[bytes] :return: JobDefinition. The JobDefinition is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.JobDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -3322,7 +3345,7 @@ async def update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: JSON, + job_definition: _types.JobDefinitionUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -3340,7 +3363,7 @@ async def update( :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str :param job_definition: Required. - :type job_definition: JSON + :type job_definition: ~azure.mgmt.storagemover.types.JobDefinitionUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3390,7 +3413,7 @@ async def update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: Union[_models.JobDefinitionUpdateParameters, JSON, IO[bytes]], + job_definition: Union[_models.JobDefinitionUpdateParameters, _types.JobDefinitionUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.JobDefinition: """Updates properties for a Job Definition resource. Properties not specified in the request body @@ -3405,10 +3428,10 @@ async def update( :type project_name: str :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str - :param job_definition: Is one of the following types: JobDefinitionUpdateParameters, JSON, - IO[bytes] Required. - :type job_definition: ~azure.mgmt.storagemover.models.JobDefinitionUpdateParameters or JSON or - IO[bytes] + :param job_definition: Is either a JobDefinitionUpdateParameters type or a IO[bytes] type. + Required. + :type job_definition: ~azure.mgmt.storagemover.models.JobDefinitionUpdateParameters or + ~azure.mgmt.storagemover.types.JobDefinitionUpdateParameters or IO[bytes] :return: JobDefinition. The JobDefinition is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.JobDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -3680,7 +3703,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3889,6 +3915,104 @@ async def stop_job( return deserialized # type: ignore + @distributed_trace_async + @api_version_validation( + method_added_on="2026-05-01", + params_added_on={ + "2026-05-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "storage_mover_name", + "project_name", + "job_definition_name", + "accept", + ] + }, + api_versions_list=["2026-05-01"], + ) + async def reconcile_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> _models.JobRunResourceId: + """Post action to reconcile the running job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_mover_name: The name of the Storage Mover resource. Required. + :type storage_mover_name: str + :param project_name: The name of the Project resource. Required. + :type project_name: str + :param job_definition_name: The name of the Job Definition resource. Required. + :type job_definition_name: str + :return: JobRunResourceId. The JobRunResourceId is compatible with MutableMapping + :rtype: ~azure.mgmt.storagemover.models.JobRunResourceId + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobRunResourceId] = kwargs.pop("cls", None) + + _request = build_job_definitions_reconcile_job_request( + resource_group_name=resource_group_name, + storage_mover_name=storage_mover_name, + project_name=project_name, + job_definition_name=job_definition_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobRunResourceId, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class ConnectionsOperations: """ @@ -3943,7 +4067,7 @@ async def create_or_update( resource_group_name: str, storage_mover_name: str, connection_name: str, - connection: JSON, + connection: _types.Connection, *, content_type: str = "application/json", **kwargs: Any @@ -3958,7 +4082,7 @@ async def create_or_update( :param connection_name: The name of the Connection resource. Required. :type connection_name: str :param connection: Required. - :type connection: JSON + :type connection: ~azure.mgmt.storagemover.types.Connection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4011,14 +4135,14 @@ async def create_or_update( "accept", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) async def create_or_update( self, resource_group_name: str, storage_mover_name: str, connection_name: str, - connection: Union[_models.Connection, JSON, IO[bytes]], + connection: Union[_models.Connection, _types.Connection, IO[bytes]], **kwargs: Any ) -> _models.Connection: """Creates or updates a Connection resource. @@ -4030,8 +4154,9 @@ async def create_or_update( :type storage_mover_name: str :param connection_name: The name of the Connection resource. Required. :type connection_name: str - :param connection: Is one of the following types: Connection, JSON, IO[bytes] Required. - :type connection: ~azure.mgmt.storagemover.models.Connection or JSON or IO[bytes] + :param connection: Is either a Connection type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.storagemover.models.Connection or + ~azure.mgmt.storagemover.types.Connection or IO[bytes] :return: Connection. The Connection is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Connection :raises ~azure.core.exceptions.HttpResponseError: @@ -4117,7 +4242,7 @@ async def create_or_update( "accept", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) async def get( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -4199,7 +4324,7 @@ async def get( params_added_on={ "2025-08-01": ["api_version", "subscription_id", "resource_group_name", "storage_mover_name", "accept"] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def list( self, resource_group_name: str, storage_mover_name: str, **kwargs: Any @@ -4257,7 +4382,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4310,7 +4438,7 @@ async def get_next(next_link=None): "connection_name", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) async def _delete_initial( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -4386,7 +4514,7 @@ async def _delete_initial( "connection_name", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) async def begin_delete( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -4622,7 +4750,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/__init__.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/__init__.py index c2ed987b5ec9..be9ed401e8af 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/__init__.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/__init__.py @@ -102,10 +102,12 @@ JobType, ManagedServiceIdentityType, Minute, + NfsMountSourceType, NfsVersion, Origin, ProvisioningState, S3WithHmacSourceType, + SmbMountSourceType, TriggerType, ) from ._patch import __all__ as _patch_all @@ -198,10 +200,12 @@ "JobType", "ManagedServiceIdentityType", "Minute", + "NfsMountSourceType", "NfsVersion", "Origin", "ProvisioningState", "S3WithHmacSourceType", + "SmbMountSourceType", "TriggerType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_enums.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_enums.py index 4e63a17759d6..2762db5b157a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_enums.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_enums.py @@ -153,6 +153,8 @@ class Frequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ONETIME.""" NONE = "None" """No schedule frequency. The job definition will not run on a schedule.""" + HOURLY = "Hourly" + """HOURLY.""" class JobRunScanStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -196,6 +198,8 @@ class JobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ON_PREM_TO_CLOUD.""" CLOUD_TO_CLOUD = "CloudToCloud" """CLOUD_TO_CLOUD.""" + ON_PREM_TO_CLOUD_AGENT_LESS = "OnPremToCloudAgentLess" + """ON_PREM_TO_CLOUD_AGENT_LESS.""" class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -224,6 +228,15 @@ class Minute(int, Enum, metaclass=CaseInsensitiveEnumMeta): """THIRTY.""" +class NfsMountSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Source type to differentiate NFSMount and FSX-EFS endpoints. Default is NFSMount.""" + + NFS_MOUNT = "NfsMount" + """NFS_MOUNT.""" + FSXEFS = "FSX-EFS" + """FSXEFS.""" + + class NfsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The NFS protocol version.""" @@ -233,6 +246,8 @@ class NfsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """NF_SV3.""" NF_SV4 = "NFSv4" """NF_SV4.""" + NF_SV4_1 = "NFSv4_1" + """NF_SV4_1.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -278,6 +293,15 @@ class S3WithHmacSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """OTHER.""" +class SmbMountSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Source type to differentiate SMBMount and FSX-SMB endpoints. Default is SMBMount.""" + + SMB_MOUNT = "SmbMount" + """SMB_MOUNT.""" + FSXSMB = "FSX-SMB" + """FSXSMB.""" + + class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of Job run trigger Manual or Scheduled.""" diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_models.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_models.py index 816b0f5c4c17..2c561334bd0c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_models.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/models/_models.py @@ -696,6 +696,19 @@ class AzureStorageBlobContainerEndpointProperties( :vartype blob_container_name: str :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.AZURE_STORAGE_BLOB_CONTAINER + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. When set to true, RBAC for the endpoint's managed + identity is granted on the customer's storage account so that authorization can be performed + entirely in the tenant where this endpoint lives. Defaults to false. Can be updated via PATCH. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Full ARM resource IDs of partner-tenant storage accounts that + are allowed to be the other side of a cross-tenant data transfer pair with this endpoint. For a + source endpoint this lists allowed target storage accounts; for a target endpoint this lists + allowed source storage accounts. The full list is replaced on PATCH (omit an entry to remove + it; include an entry to add it). Mutual presence in both endpoints' allow lists is re-validated + at every job run start, so removing an entry blocks future runs that reference the removed + storage account. + :vartype allowed_storage_accounts: list[str] """ storage_account_resource_id: str = rest_field(name="storageAccountResourceId", visibility=["read", "create"]) @@ -704,6 +717,22 @@ class AzureStorageBlobContainerEndpointProperties( """The name of the Storage blob container that is the target destination. Required.""" endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER.""" + enable_cross_tenant_transfer: Optional[bool] = rest_field( + name="enableCrossTenantTransfer", visibility=["read", "create", "update", "delete", "query"] + ) + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + When set to true, RBAC for the endpoint's managed identity is granted on the customer's storage + account so that authorization can be performed entirely in the tenant where this endpoint + lives. Defaults to false. Can be updated via PATCH.""" + allowed_storage_accounts: Optional[list[str]] = rest_field( + name="allowedStorageAccounts", visibility=["read", "create", "update", "delete", "query"] + ) + """Full ARM resource IDs of partner-tenant storage accounts that are allowed to be the other side + of a cross-tenant data transfer pair with this endpoint. For a source endpoint this lists + allowed target storage accounts; for a target endpoint this lists allowed source storage + accounts. The full list is replaced on PATCH (omit an entry to remove it; include an entry to + add it). Mutual presence in both endpoints' allow lists is re-validated at every job run start, + so removing an entry blocks future runs that reference the removed storage account.""" @overload def __init__( @@ -713,6 +742,8 @@ def __init__( blob_container_name: str, description: Optional[str] = None, endpoint_kind: Optional[Union[str, "_models.EndpointKind"]] = None, + enable_cross_tenant_transfer: Optional[bool] = None, + allowed_storage_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -736,16 +767,37 @@ class AzureStorageBlobContainerEndpointUpdateProperties( :vartype description: str :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.AZURE_STORAGE_BLOB_CONTAINER + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. Defaults to false. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Replaces the list of partner-tenant storage account ARM IDs + allowed to be the other side of a cross-tenant data transfer pair with this endpoint. Omit an + entry to remove it; include an entry to add it. Removing an entry blocks future job runs that + reference that storage account. + :vartype allowed_storage_accounts: list[str] """ endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER.""" + enable_cross_tenant_transfer: Optional[bool] = rest_field( + name="enableCrossTenantTransfer", visibility=["read", "create", "update", "delete", "query"] + ) + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + Defaults to false.""" + allowed_storage_accounts: Optional[list[str]] = rest_field( + name="allowedStorageAccounts", visibility=["read", "create", "update", "delete", "query"] + ) + """Replaces the list of partner-tenant storage account ARM IDs allowed to be the other side of a + cross-tenant data transfer pair with this endpoint. Omit an entry to remove it; include an + entry to add it. Removing an entry blocks future job runs that reference that storage account.""" @overload def __init__( self, *, description: Optional[str] = None, + enable_cross_tenant_transfer: Optional[bool] = None, + allowed_storage_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -862,6 +914,19 @@ class AzureStorageSmbFileShareEndpointProperties( :vartype file_share_name: str :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.AZURE_STORAGE_SMB_FILE_SHARE + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. When set to true, RBAC for the endpoint's managed + identity is granted on the customer's storage account so that authorization can be performed + entirely in the tenant where this endpoint lives. Defaults to false. Can be updated via PATCH. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Full ARM resource IDs of partner-tenant storage accounts that + are allowed to be the other side of a cross-tenant data transfer pair with this endpoint. For a + source endpoint this lists allowed target storage accounts; for a target endpoint this lists + allowed source storage accounts. The full list is replaced on PATCH (omit an entry to remove + it; include an entry to add it). Mutual presence in both endpoints' allow lists is re-validated + at every job run start, so removing an entry blocks future runs that reference the removed + storage account. + :vartype allowed_storage_accounts: list[str] """ storage_account_resource_id: str = rest_field(name="storageAccountResourceId", visibility=["read", "create"]) @@ -870,6 +935,22 @@ class AzureStorageSmbFileShareEndpointProperties( """The name of the Azure Storage file share. Required.""" endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE.""" + enable_cross_tenant_transfer: Optional[bool] = rest_field( + name="enableCrossTenantTransfer", visibility=["read", "create", "update", "delete", "query"] + ) + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + When set to true, RBAC for the endpoint's managed identity is granted on the customer's storage + account so that authorization can be performed entirely in the tenant where this endpoint + lives. Defaults to false. Can be updated via PATCH.""" + allowed_storage_accounts: Optional[list[str]] = rest_field( + name="allowedStorageAccounts", visibility=["read", "create", "update", "delete", "query"] + ) + """Full ARM resource IDs of partner-tenant storage accounts that are allowed to be the other side + of a cross-tenant data transfer pair with this endpoint. For a source endpoint this lists + allowed target storage accounts; for a target endpoint this lists allowed source storage + accounts. The full list is replaced on PATCH (omit an entry to remove it; include an entry to + add it). Mutual presence in both endpoints' allow lists is re-validated at every job run start, + so removing an entry blocks future runs that reference the removed storage account.""" @overload def __init__( @@ -879,6 +960,8 @@ def __init__( file_share_name: str, description: Optional[str] = None, endpoint_kind: Optional[Union[str, "_models.EndpointKind"]] = None, + enable_cross_tenant_transfer: Optional[bool] = None, + allowed_storage_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -902,16 +985,37 @@ class AzureStorageSmbFileShareEndpointUpdateProperties( :vartype description: str :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.AZURE_STORAGE_SMB_FILE_SHARE + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. Defaults to false. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Replaces the list of partner-tenant storage account ARM IDs + allowed to be the other side of a cross-tenant data transfer pair with this endpoint. Omit an + entry to remove it; include an entry to add it. Removing an entry blocks future job runs that + reference that storage account. + :vartype allowed_storage_accounts: list[str] """ endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE.""" + enable_cross_tenant_transfer: Optional[bool] = rest_field( + name="enableCrossTenantTransfer", visibility=["read", "create", "update", "delete", "query"] + ) + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + Defaults to false.""" + allowed_storage_accounts: Optional[list[str]] = rest_field( + name="allowedStorageAccounts", visibility=["read", "create", "update", "delete", "query"] + ) + """Replaces the list of partner-tenant storage account ARM IDs allowed to be the other side of a + cross-tenant data transfer pair with this endpoint. Omit an entry to remove it; include an + entry to add it. Removing an entry blocks future job runs that reference that storage account.""" @overload def __init__( self, *, description: Optional[str] = None, + enable_cross_tenant_transfer: Optional[bool] = None, + allowed_storage_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -1235,6 +1339,11 @@ class JobDefinition(ProxyResource): "schedule", "data_integrity_validation", "preserve_permissions", + "is_cross_tenant_job", + "cross_tenant_endpoint_tenant_id", + "cross_tenant_endpoint_resource_id", + "sync_mode", + "mover_synced_until", ] @overload @@ -1279,7 +1388,8 @@ class JobDefinitionProperties(_Model): :ivar description: A description for the Job Definition. OnPremToCloud is for migrating data from on-premises to cloud. CloudToCloud is for migrating data between cloud to cloud. :vartype description: str - :ivar job_type: The type of the Job. Known values are: "OnPremToCloud" and "CloudToCloud". + :ivar job_type: The type of the Job. Known values are: "OnPremToCloud", "CloudToCloud", and + "OnPremToCloudAgentLess". :vartype job_type: str or ~azure.mgmt.storagemover.models.JobType :ivar copy_mode: Strategy to use for copy. Required. Known values are: "Additive" and "Mirror". :vartype copy_mode: str or ~azure.mgmt.storagemover.models.CopyMode @@ -1325,6 +1435,23 @@ class JobDefinitionProperties(_Model): ~azure.mgmt.storagemover.models.DataIntegrityValidation :ivar preserve_permissions: Boolean to preserve permissions or not. :vartype preserve_permissions: bool + :ivar is_cross_tenant_job: Indicates that this Job Definition is a cross-tenant job where the + counterpart endpoint resides in a different Azure AD tenant. When true, + ``crossTenantEndpointTenantId`` and ``crossTenantEndpointResourceId`` must be provided. + Defaults to false. Cannot be modified after the Job Definition is created. + :vartype is_cross_tenant_job: bool + :ivar cross_tenant_endpoint_tenant_id: The Azure AD tenant ID of the cross-tenant source + endpoint. Required when ``isCrossTenantJob`` is true. Cannot be modified after the Job + Definition is created. + :vartype cross_tenant_endpoint_tenant_id: str + :ivar cross_tenant_endpoint_resource_id: Full ARM resource ID of the cross-tenant (foreign) + endpoint. On the source-tenant copy this is the TARGET endpoint; on the target-tenant copy this + is the SOURCE endpoint. + :vartype cross_tenant_endpoint_resource_id: str + :ivar sync_mode: The synchronization mode for the Job Definition. + :vartype sync_mode: str + :ivar mover_synced_until: The last time the mover was synchronized. + :vartype mover_synced_until: ~datetime.datetime """ description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1333,7 +1460,8 @@ class JobDefinitionProperties(_Model): job_type: Optional[Union[str, "_models.JobType"]] = rest_field( name="jobType", visibility=["read", "create", "update", "delete", "query"] ) - """The type of the Job. Known values are: \"OnPremToCloud\" and \"CloudToCloud\".""" + """The type of the Job. Known values are: \"OnPremToCloud\", \"CloudToCloud\", and + \"OnPremToCloudAgentLess\".""" copy_mode: Union[str, "_models.CopyMode"] = rest_field( name="copyMode", visibility=["read", "create", "update", "delete", "query"] ) @@ -1386,6 +1514,27 @@ class JobDefinitionProperties(_Model): name="preservePermissions", visibility=["read", "create", "update", "delete", "query"] ) """Boolean to preserve permissions or not.""" + is_cross_tenant_job: Optional[bool] = rest_field(name="isCrossTenantJob", visibility=["read", "create"]) + """Indicates that this Job Definition is a cross-tenant job where the counterpart endpoint resides + in a different Azure AD tenant. When true, ``crossTenantEndpointTenantId`` and + ``crossTenantEndpointResourceId`` must be provided. Defaults to false. Cannot be modified after + the Job Definition is created.""" + cross_tenant_endpoint_tenant_id: Optional[str] = rest_field( + name="crossTenantEndpointTenantId", visibility=["read", "create"] + ) + """The Azure AD tenant ID of the cross-tenant source endpoint. Required when ``isCrossTenantJob`` + is true. Cannot be modified after the Job Definition is created.""" + cross_tenant_endpoint_resource_id: Optional[str] = rest_field( + name="crossTenantEndpointResourceId", visibility=["read", "create"] + ) + """Full ARM resource ID of the cross-tenant (foreign) endpoint. On the source-tenant copy this is + the TARGET endpoint; on the target-tenant copy this is the SOURCE endpoint.""" + sync_mode: Optional[str] = rest_field(name="syncMode", visibility=["read", "create", "update", "delete", "query"]) + """The synchronization mode for the Job Definition.""" + mover_synced_until: Optional[datetime.datetime] = rest_field( + name="moverSyncedUntil", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The last time the mover was synchronized.""" @overload def __init__( @@ -1404,6 +1553,11 @@ def __init__( schedule: Optional["_models.ScheduleInfo"] = None, data_integrity_validation: Optional[Union[str, "_models.DataIntegrityValidation"]] = None, preserve_permissions: Optional[bool] = None, + is_cross_tenant_job: Optional[bool] = None, + cross_tenant_endpoint_tenant_id: Optional[str] = None, + cross_tenant_endpoint_resource_id: Optional[str] = None, + sync_mode: Optional[str] = None, + mover_synced_until: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -1446,6 +1600,8 @@ class JobDefinitionUpdateParameters(_Model): "connections", "data_integrity_validation", "schedule", + "sync_mode", + "mover_synced_until", ] @overload @@ -1501,6 +1657,10 @@ class JobDefinitionUpdateProperties(_Model): ~azure.mgmt.storagemover.models.DataIntegrityValidation :ivar schedule: Schedule information for the Job Definition. :vartype schedule: ~azure.mgmt.storagemover.models.ScheduleInfo + :ivar sync_mode: The synchronization mode for the Job Definition. + :vartype sync_mode: str + :ivar mover_synced_until: The last time the mover was synchronized. + :vartype mover_synced_until: ~datetime.datetime """ description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1520,6 +1680,12 @@ class JobDefinitionUpdateProperties(_Model): \"None\".""" schedule: Optional["_models.ScheduleInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Schedule information for the Job Definition.""" + sync_mode: Optional[str] = rest_field(name="syncMode", visibility=["read", "create", "update", "delete", "query"]) + """The synchronization mode for the Job Definition.""" + mover_synced_until: Optional[datetime.datetime] = rest_field( + name="moverSyncedUntil", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The last time the mover was synchronized.""" @overload def __init__( @@ -1531,6 +1697,8 @@ def __init__( connections: Optional[list[str]] = None, data_integrity_validation: Optional[Union[str, "_models.DataIntegrityValidation"]] = None, schedule: Optional["_models.ScheduleInfo"] = None, + sync_mode: Optional[str] = None, + mover_synced_until: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -1954,12 +2122,16 @@ class NfsMountEndpointProperties(EndpointBaseProperties, discriminator="NfsMount :vartype provisioning_state: str or ~azure.mgmt.storagemover.models.ProvisioningState :ivar host: The host name or IP address of the server exporting the file system. Required. :vartype host: str - :ivar nfs_version: The NFS protocol version. Known values are: "NFSauto", "NFSv3", and "NFSv4". + :ivar nfs_version: The NFS protocol version. Known values are: "NFSauto", "NFSv3", "NFSv4", and + "NFSv4_1". :vartype nfs_version: str or ~azure.mgmt.storagemover.models.NfsVersion :ivar export: The directory being exported from the server. Required. :vartype export: str :ivar endpoint_type: The Endpoint resource type. Required. NFS_MOUNT. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.NFS_MOUNT + :ivar source_type: Source type to differentiate NFSMount and FSX-SMB endpoints. Default is + NFSMount. Known values are: "NfsMount" and "FSX-EFS". + :vartype source_type: str or ~azure.mgmt.storagemover.models.NfsMountSourceType """ host: str = rest_field(visibility=["read", "create"]) @@ -1967,11 +2139,16 @@ class NfsMountEndpointProperties(EndpointBaseProperties, discriminator="NfsMount nfs_version: Optional[Union[str, "_models.NfsVersion"]] = rest_field( name="nfsVersion", visibility=["read", "create"] ) - """The NFS protocol version. Known values are: \"NFSauto\", \"NFSv3\", and \"NFSv4\".""" + """The NFS protocol version. Known values are: \"NFSauto\", \"NFSv3\", \"NFSv4\", and \"NFSv4_1\".""" export: str = rest_field(visibility=["read", "create"]) """The directory being exported from the server. Required.""" endpoint_type: Literal[EndpointType.NFS_MOUNT] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. NFS_MOUNT.""" + source_type: Optional[Union[str, "_models.NfsMountSourceType"]] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Source type to differentiate NFSMount and FSX-SMB endpoints. Default is NFSMount. Known values + are: \"NfsMount\" and \"FSX-EFS\".""" @overload def __init__( @@ -1982,6 +2159,7 @@ def __init__( description: Optional[str] = None, endpoint_kind: Optional[Union[str, "_models.EndpointKind"]] = None, nfs_version: Optional[Union[str, "_models.NfsVersion"]] = None, + source_type: Optional[Union[str, "_models.NfsMountSourceType"]] = None, ) -> None: ... @overload @@ -2439,7 +2617,7 @@ class ScheduleInfo(_Model): """Schedule information for the Job Definition. :ivar frequency: Type of schedule — Monthly, Weekly, or Daily. Known values are: "Monthly", - "Weekly", "Daily", "Onetime", and "None". + "Weekly", "Daily", "Onetime", "None", and "Hourly". :vartype frequency: str or ~azure.mgmt.storagemover.models.Frequency :ivar is_active: Whether the schedule is currently active. :vartype is_active: bool @@ -2455,13 +2633,15 @@ class ScheduleInfo(_Model): :vartype cron_expression: str :ivar end_date: End time of the schedule (in UTC). :vartype end_date: ~datetime.datetime + :ivar repeat_interval: Repeat interval used for sub-daily schedules. + :vartype repeat_interval: str """ frequency: Optional[Union[str, "_models.Frequency"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Type of schedule — Monthly, Weekly, or Daily. Known values are: \"Monthly\", \"Weekly\", - \"Daily\", \"Onetime\", and \"None\".""" + \"Daily\", \"Onetime\", \"None\", and \"Hourly\".""" is_active: Optional[bool] = rest_field(name="isActive", visibility=["read", "create", "update", "delete", "query"]) """Whether the schedule is currently active.""" execution_time: Optional["_models.SchedulerTime"] = rest_field( @@ -2488,6 +2668,10 @@ class ScheduleInfo(_Model): name="endDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """End time of the schedule (in UTC).""" + repeat_interval: Optional[str] = rest_field( + name="repeatInterval", visibility=["read", "create", "update", "delete", "query"] + ) + """Repeat interval used for sub-daily schedules.""" @overload def __init__( @@ -2501,6 +2685,7 @@ def __init__( days_of_month: Optional[list[int]] = None, cron_expression: Optional[str] = None, end_date: Optional[datetime.datetime] = None, + repeat_interval: Optional[str] = None, ) -> None: ... @overload @@ -2574,6 +2759,9 @@ class SmbMountEndpointProperties(EndpointBaseProperties, discriminator="SmbMount :vartype credentials: ~azure.mgmt.storagemover.models.AzureKeyVaultSmbCredentials :ivar endpoint_type: The Endpoint resource type. Required. SMB_MOUNT. :vartype endpoint_type: str or ~azure.mgmt.storagemover.models.SMB_MOUNT + :ivar source_type: Source type to differentiate SMBMount and FSX-SMB endpoints. Default is + SMBMount. Known values are: "SmbMount" and "FSX-SMB". + :vartype source_type: str or ~azure.mgmt.storagemover.models.SmbMountSourceType """ host: str = rest_field(visibility=["read", "create"]) @@ -2586,6 +2774,11 @@ class SmbMountEndpointProperties(EndpointBaseProperties, discriminator="SmbMount """The Azure Key Vault secret URIs which store the required credentials to access the SMB share.""" endpoint_type: Literal[EndpointType.SMB_MOUNT] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The Endpoint resource type. Required. SMB_MOUNT.""" + source_type: Optional[Union[str, "_models.SmbMountSourceType"]] = rest_field( + name="sourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """Source type to differentiate SMBMount and FSX-SMB endpoints. Default is SMBMount. Known values + are: \"SmbMount\" and \"FSX-SMB\".""" @overload def __init__( @@ -2596,6 +2789,7 @@ def __init__( description: Optional[str] = None, endpoint_kind: Optional[Union[str, "_models.EndpointKind"]] = None, credentials: Optional["_models.AzureKeyVaultSmbCredentials"] = None, + source_type: Optional[Union[str, "_models.SmbMountSourceType"]] = None, ) -> None: ... @overload diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/operations/_operations.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/operations/_operations.py index 860e2384b364..7177a0afd8c8 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/operations/_operations.py +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import StorageMoverMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -51,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +71,7 @@ def build_storage_movers_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +100,7 @@ def build_storage_movers_create_or_update_request( # pylint: disable=name-too-l _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +131,7 @@ def build_storage_movers_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +160,7 @@ def build_storage_movers_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}" path_format_arguments = { @@ -182,7 +181,7 @@ def build_storage_movers_list_request(resource_group_name: str, subscription_id: _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-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -209,7 +208,7 @@ def build_storage_movers_list_by_subscription_request( # pylint: disable=name-t _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-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +234,7 @@ def build_agents_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +264,7 @@ def build_agents_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -297,7 +296,7 @@ def build_agents_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +326,7 @@ def build_agents_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/agents/{agentName}" path_format_arguments = { @@ -351,7 +350,7 @@ def build_agents_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -379,7 +378,7 @@ def build_endpoints_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -409,7 +408,7 @@ def build_endpoints_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -441,7 +440,7 @@ def build_endpoints_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -471,7 +470,7 @@ def build_endpoints_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/endpoints/{endpointName}" path_format_arguments = { @@ -495,7 +494,7 @@ def build_endpoints_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -523,7 +522,7 @@ def build_projects_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -553,7 +552,7 @@ def build_projects_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -585,7 +584,7 @@ def build_projects_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -615,7 +614,7 @@ def build_projects_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/projects/{projectName}" path_format_arguments = { @@ -639,7 +638,7 @@ def build_projects_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -672,7 +671,7 @@ def build_job_definitions_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -708,7 +707,7 @@ def build_job_definitions_create_or_update_request( # pylint: disable=name-too- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -746,7 +745,7 @@ def build_job_definitions_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -782,7 +781,7 @@ def build_job_definitions_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/projects/{projectName}/jobDefinitions/{jobDefinitionName}" path_format_arguments = { @@ -807,7 +806,7 @@ def build_job_definitions_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -841,7 +840,7 @@ def build_job_definitions_start_job_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -876,7 +875,7 @@ def build_job_definitions_stop_job_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -900,6 +899,41 @@ def build_job_definitions_stop_job_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_job_definitions_reconcile_job_request( # pylint: disable=name-too-long + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/projects/{projectName}/jobDefinitions/{jobDefinitionName}/reconcileJob" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "storageMoverName": _SERIALIZER.url("storage_mover_name", storage_mover_name, "str"), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "jobDefinitionName": _SERIALIZER.url("job_definition_name", job_definition_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_connections_create_or_update_request( # pylint: disable=name-too-long resource_group_name: str, storage_mover_name: str, connection_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -907,7 +941,7 @@ def build_connections_create_or_update_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -938,7 +972,7 @@ def build_connections_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -967,7 +1001,7 @@ def build_connections_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -994,7 +1028,7 @@ def build_connections_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageMover/storageMovers/{storageMoverName}/connections/{connectionName}" path_format_arguments = { @@ -1024,7 +1058,7 @@ def build_job_runs_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", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1060,7 +1094,7 @@ def build_job_runs_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1148,7 +1182,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1310,7 +1347,7 @@ def create_or_update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: JSON, + storage_mover: _types.StorageMover, *, content_type: str = "application/json", **kwargs: Any @@ -1323,7 +1360,7 @@ def create_or_update( :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str :param storage_mover: Required. - :type storage_mover: JSON + :type storage_mover: ~azure.mgmt.storagemover.types.StorageMover :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1364,7 +1401,7 @@ def create_or_update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: Union[_models.StorageMover, JSON, IO[bytes]], + storage_mover: Union[_models.StorageMover, _types.StorageMover, IO[bytes]], **kwargs: Any ) -> _models.StorageMover: """Creates or updates a top-level Storage Mover resource. @@ -1374,8 +1411,9 @@ def create_or_update( :type resource_group_name: str :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str - :param storage_mover: Is one of the following types: StorageMover, JSON, IO[bytes] Required. - :type storage_mover: ~azure.mgmt.storagemover.models.StorageMover or JSON or IO[bytes] + :param storage_mover: Is either a StorageMover type or a IO[bytes] type. Required. + :type storage_mover: ~azure.mgmt.storagemover.models.StorageMover or + ~azure.mgmt.storagemover.types.StorageMover or IO[bytes] :return: StorageMover. The StorageMover is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.StorageMover :raises ~azure.core.exceptions.HttpResponseError: @@ -1480,7 +1518,7 @@ def update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: JSON, + storage_mover: _types.StorageMoverUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -1494,7 +1532,7 @@ def update( :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str :param storage_mover: Required. - :type storage_mover: JSON + :type storage_mover: ~azure.mgmt.storagemover.types.StorageMoverUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1536,7 +1574,7 @@ def update( self, resource_group_name: str, storage_mover_name: str, - storage_mover: Union[_models.StorageMoverUpdateParameters, JSON, IO[bytes]], + storage_mover: Union[_models.StorageMoverUpdateParameters, _types.StorageMoverUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.StorageMover: """Updates properties for a Storage Mover resource. Properties not specified in the request body @@ -1547,10 +1585,10 @@ def update( :type resource_group_name: str :param storage_mover_name: The name of the Storage Mover resource. Required. :type storage_mover_name: str - :param storage_mover: Is one of the following types: StorageMoverUpdateParameters, JSON, - IO[bytes] Required. - :type storage_mover: ~azure.mgmt.storagemover.models.StorageMoverUpdateParameters or JSON or - IO[bytes] + :param storage_mover: Is either a StorageMoverUpdateParameters type or a IO[bytes] type. + Required. + :type storage_mover: ~azure.mgmt.storagemover.models.StorageMoverUpdateParameters or + ~azure.mgmt.storagemover.types.StorageMoverUpdateParameters or IO[bytes] :return: StorageMover. The StorageMover is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.StorageMover :raises ~azure.core.exceptions.HttpResponseError: @@ -1790,7 +1828,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1880,7 +1921,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2050,7 +2094,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: JSON, + agent: _types.Agent, *, content_type: str = "application/json", **kwargs: Any @@ -2066,7 +2110,7 @@ def create_or_update( :param agent_name: The name of the Agent resource. Required. :type agent_name: str :param agent: Required. - :type agent: JSON + :type agent: ~azure.mgmt.storagemover.types.Agent :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2112,7 +2156,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: Union[_models.Agent, JSON, IO[bytes]], + agent: Union[_models.Agent, _types.Agent, IO[bytes]], **kwargs: Any ) -> _models.Agent: """Creates or updates an Agent resource, which references a hybrid compute machine that can run @@ -2125,8 +2169,9 @@ def create_or_update( :type storage_mover_name: str :param agent_name: The name of the Agent resource. Required. :type agent_name: str - :param agent: Is one of the following types: Agent, JSON, IO[bytes] Required. - :type agent: ~azure.mgmt.storagemover.models.Agent or JSON or IO[bytes] + :param agent: Is either a Agent type or a IO[bytes] type. Required. + :type agent: ~azure.mgmt.storagemover.models.Agent or ~azure.mgmt.storagemover.types.Agent or + IO[bytes] :return: Agent. The Agent is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Agent :raises ~azure.core.exceptions.HttpResponseError: @@ -2235,7 +2280,7 @@ def update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: JSON, + agent: _types.AgentUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -2250,7 +2295,7 @@ def update( :param agent_name: The name of the Agent resource. Required. :type agent_name: str :param agent: Required. - :type agent: JSON + :type agent: ~azure.mgmt.storagemover.types.AgentUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2295,7 +2340,7 @@ def update( resource_group_name: str, storage_mover_name: str, agent_name: str, - agent: Union[_models.AgentUpdateParameters, JSON, IO[bytes]], + agent: Union[_models.AgentUpdateParameters, _types.AgentUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Agent: """Creates or updates an Agent resource. @@ -2307,8 +2352,9 @@ def update( :type storage_mover_name: str :param agent_name: The name of the Agent resource. Required. :type agent_name: str - :param agent: Is one of the following types: AgentUpdateParameters, JSON, IO[bytes] Required. - :type agent: ~azure.mgmt.storagemover.models.AgentUpdateParameters or JSON or IO[bytes] + :param agent: Is either a AgentUpdateParameters type or a IO[bytes] type. Required. + :type agent: ~azure.mgmt.storagemover.models.AgentUpdateParameters or + ~azure.mgmt.storagemover.types.AgentUpdateParameters or IO[bytes] :return: Agent. The Agent is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Agent :raises ~azure.core.exceptions.HttpResponseError: @@ -2560,7 +2606,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2732,7 +2781,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: JSON, + endpoint: _types.Endpoint, *, content_type: str = "application/json", **kwargs: Any @@ -2748,7 +2797,7 @@ def create_or_update( :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str :param endpoint: Required. - :type endpoint: JSON + :type endpoint: ~azure.mgmt.storagemover.types.Endpoint :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2794,7 +2843,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: Union[_models.Endpoint, JSON, IO[bytes]], + endpoint: Union[_models.Endpoint, _types.Endpoint, IO[bytes]], **kwargs: Any ) -> _models.Endpoint: """Creates or updates an Endpoint resource, which represents a data transfer source or @@ -2807,8 +2856,9 @@ def create_or_update( :type storage_mover_name: str :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str - :param endpoint: Is one of the following types: Endpoint, JSON, IO[bytes] Required. - :type endpoint: ~azure.mgmt.storagemover.models.Endpoint or JSON or IO[bytes] + :param endpoint: Is either a Endpoint type or a IO[bytes] type. Required. + :type endpoint: ~azure.mgmt.storagemover.models.Endpoint or + ~azure.mgmt.storagemover.types.Endpoint or IO[bytes] :return: Endpoint. The Endpoint is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Endpoint :raises ~azure.core.exceptions.HttpResponseError: @@ -2918,7 +2968,7 @@ def update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: JSON, + endpoint: _types.EndpointBaseUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -2934,7 +2984,7 @@ def update( :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str :param endpoint: Required. - :type endpoint: JSON + :type endpoint: ~azure.mgmt.storagemover.types.EndpointBaseUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2980,7 +3030,7 @@ def update( resource_group_name: str, storage_mover_name: str, endpoint_name: str, - endpoint: Union[_models.EndpointBaseUpdateParameters, JSON, IO[bytes]], + endpoint: Union[_models.EndpointBaseUpdateParameters, _types.EndpointBaseUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Endpoint: """Updates properties for an Endpoint resource. Properties not specified in the request body will @@ -2993,10 +3043,9 @@ def update( :type storage_mover_name: str :param endpoint_name: The name of the Endpoint resource. Required. :type endpoint_name: str - :param endpoint: Is one of the following types: EndpointBaseUpdateParameters, JSON, IO[bytes] - Required. - :type endpoint: ~azure.mgmt.storagemover.models.EndpointBaseUpdateParameters or JSON or - IO[bytes] + :param endpoint: Is either a EndpointBaseUpdateParameters type or a IO[bytes] type. Required. + :type endpoint: ~azure.mgmt.storagemover.models.EndpointBaseUpdateParameters or + ~azure.mgmt.storagemover.types.EndpointBaseUpdateParameters or IO[bytes] :return: Endpoint. The Endpoint is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Endpoint :raises ~azure.core.exceptions.HttpResponseError: @@ -3248,7 +3297,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3419,7 +3471,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: JSON, + project: _types.Project, *, content_type: str = "application/json", **kwargs: Any @@ -3434,7 +3486,7 @@ def create_or_update( :param project_name: The name of the Project resource. Required. :type project_name: str :param project: Required. - :type project: JSON + :type project: ~azure.mgmt.storagemover.types.Project :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3479,7 +3531,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: Union[_models.Project, JSON, IO[bytes]], + project: Union[_models.Project, _types.Project, IO[bytes]], **kwargs: Any ) -> _models.Project: """Creates or updates a Project resource, which is a logical grouping of related jobs. @@ -3491,8 +3543,9 @@ def create_or_update( :type storage_mover_name: str :param project_name: The name of the Project resource. Required. :type project_name: str - :param project: Is one of the following types: Project, JSON, IO[bytes] Required. - :type project: ~azure.mgmt.storagemover.models.Project or JSON or IO[bytes] + :param project: Is either a Project type or a IO[bytes] type. Required. + :type project: ~azure.mgmt.storagemover.models.Project or + ~azure.mgmt.storagemover.types.Project or IO[bytes] :return: Project. The Project is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Project :raises ~azure.core.exceptions.HttpResponseError: @@ -3602,7 +3655,7 @@ def update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: JSON, + project: _types.ProjectUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -3618,7 +3671,7 @@ def update( :param project_name: The name of the Project resource. Required. :type project_name: str :param project: Required. - :type project: JSON + :type project: ~azure.mgmt.storagemover.types.ProjectUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3664,7 +3717,7 @@ def update( resource_group_name: str, storage_mover_name: str, project_name: str, - project: Union[_models.ProjectUpdateParameters, JSON, IO[bytes]], + project: Union[_models.ProjectUpdateParameters, _types.ProjectUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Project: """Updates properties for a Project resource. Properties not specified in the request body will be @@ -3677,9 +3730,9 @@ def update( :type storage_mover_name: str :param project_name: The name of the Project resource. Required. :type project_name: str - :param project: Is one of the following types: ProjectUpdateParameters, JSON, IO[bytes] - Required. - :type project: ~azure.mgmt.storagemover.models.ProjectUpdateParameters or JSON or IO[bytes] + :param project: Is either a ProjectUpdateParameters type or a IO[bytes] type. Required. + :type project: ~azure.mgmt.storagemover.models.ProjectUpdateParameters or + ~azure.mgmt.storagemover.types.ProjectUpdateParameters or IO[bytes] :return: Project. The Project is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Project :raises ~azure.core.exceptions.HttpResponseError: @@ -3931,7 +3984,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4115,7 +4171,7 @@ def create_or_update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: JSON, + job_definition: _types.JobDefinition, *, content_type: str = "application/json", **kwargs: Any @@ -4133,7 +4189,7 @@ def create_or_update( :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str :param job_definition: Required. - :type job_definition: JSON + :type job_definition: ~azure.mgmt.storagemover.types.JobDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4183,7 +4239,7 @@ def create_or_update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: Union[_models.JobDefinition, JSON, IO[bytes]], + job_definition: Union[_models.JobDefinition, _types.JobDefinition, IO[bytes]], **kwargs: Any ) -> _models.JobDefinition: """Creates or updates a Job Definition resource, which contains configuration for a single unit of @@ -4198,8 +4254,9 @@ def create_or_update( :type project_name: str :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str - :param job_definition: Is one of the following types: JobDefinition, JSON, IO[bytes] Required. - :type job_definition: ~azure.mgmt.storagemover.models.JobDefinition or JSON or IO[bytes] + :param job_definition: Is either a JobDefinition type or a IO[bytes] type. Required. + :type job_definition: ~azure.mgmt.storagemover.models.JobDefinition or + ~azure.mgmt.storagemover.types.JobDefinition or IO[bytes] :return: JobDefinition. The JobDefinition is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.JobDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -4314,7 +4371,7 @@ def update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: JSON, + job_definition: _types.JobDefinitionUpdateParameters, *, content_type: str = "application/json", **kwargs: Any @@ -4332,7 +4389,7 @@ def update( :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str :param job_definition: Required. - :type job_definition: JSON + :type job_definition: ~azure.mgmt.storagemover.types.JobDefinitionUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4382,7 +4439,7 @@ def update( storage_mover_name: str, project_name: str, job_definition_name: str, - job_definition: Union[_models.JobDefinitionUpdateParameters, JSON, IO[bytes]], + job_definition: Union[_models.JobDefinitionUpdateParameters, _types.JobDefinitionUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.JobDefinition: """Updates properties for a Job Definition resource. Properties not specified in the request body @@ -4397,10 +4454,10 @@ def update( :type project_name: str :param job_definition_name: The name of the Job Definition resource. Required. :type job_definition_name: str - :param job_definition: Is one of the following types: JobDefinitionUpdateParameters, JSON, - IO[bytes] Required. - :type job_definition: ~azure.mgmt.storagemover.models.JobDefinitionUpdateParameters or JSON or - IO[bytes] + :param job_definition: Is either a JobDefinitionUpdateParameters type or a IO[bytes] type. + Required. + :type job_definition: ~azure.mgmt.storagemover.models.JobDefinitionUpdateParameters or + ~azure.mgmt.storagemover.types.JobDefinitionUpdateParameters or IO[bytes] :return: JobDefinition. The JobDefinition is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.JobDefinition :raises ~azure.core.exceptions.HttpResponseError: @@ -4672,7 +4729,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4881,6 +4941,104 @@ def stop_job( return deserialized # type: ignore + @distributed_trace + @api_version_validation( + method_added_on="2026-05-01", + params_added_on={ + "2026-05-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "storage_mover_name", + "project_name", + "job_definition_name", + "accept", + ] + }, + api_versions_list=["2026-05-01"], + ) + def reconcile_job( + self, + resource_group_name: str, + storage_mover_name: str, + project_name: str, + job_definition_name: str, + **kwargs: Any + ) -> _models.JobRunResourceId: + """Post action to reconcile the running job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_mover_name: The name of the Storage Mover resource. Required. + :type storage_mover_name: str + :param project_name: The name of the Project resource. Required. + :type project_name: str + :param job_definition_name: The name of the Job Definition resource. Required. + :type job_definition_name: str + :return: JobRunResourceId. The JobRunResourceId is compatible with MutableMapping + :rtype: ~azure.mgmt.storagemover.models.JobRunResourceId + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobRunResourceId] = kwargs.pop("cls", None) + + _request = build_job_definitions_reconcile_job_request( + resource_group_name=resource_group_name, + storage_mover_name=storage_mover_name, + project_name=project_name, + job_definition_name=job_definition_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobRunResourceId, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + class ConnectionsOperations: """ @@ -4935,7 +5093,7 @@ def create_or_update( resource_group_name: str, storage_mover_name: str, connection_name: str, - connection: JSON, + connection: _types.Connection, *, content_type: str = "application/json", **kwargs: Any @@ -4950,7 +5108,7 @@ def create_or_update( :param connection_name: The name of the Connection resource. Required. :type connection_name: str :param connection: Required. - :type connection: JSON + :type connection: ~azure.mgmt.storagemover.types.Connection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5003,14 +5161,14 @@ def create_or_update( "accept", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def create_or_update( self, resource_group_name: str, storage_mover_name: str, connection_name: str, - connection: Union[_models.Connection, JSON, IO[bytes]], + connection: Union[_models.Connection, _types.Connection, IO[bytes]], **kwargs: Any ) -> _models.Connection: """Creates or updates a Connection resource. @@ -5022,8 +5180,9 @@ def create_or_update( :type storage_mover_name: str :param connection_name: The name of the Connection resource. Required. :type connection_name: str - :param connection: Is one of the following types: Connection, JSON, IO[bytes] Required. - :type connection: ~azure.mgmt.storagemover.models.Connection or JSON or IO[bytes] + :param connection: Is either a Connection type or a IO[bytes] type. Required. + :type connection: ~azure.mgmt.storagemover.models.Connection or + ~azure.mgmt.storagemover.types.Connection or IO[bytes] :return: Connection. The Connection is compatible with MutableMapping :rtype: ~azure.mgmt.storagemover.models.Connection :raises ~azure.core.exceptions.HttpResponseError: @@ -5109,7 +5268,7 @@ def create_or_update( "accept", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def get( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -5191,7 +5350,7 @@ def get( params_added_on={ "2025-08-01": ["api_version", "subscription_id", "resource_group_name", "storage_mover_name", "accept"] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def list(self, resource_group_name: str, storage_mover_name: str, **kwargs: Any) -> ItemPaged["_models.Connection"]: """Lists all Connections in a Storage Mover. @@ -5247,7 +5406,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5300,7 +5462,7 @@ def get_next(next_link=None): "connection_name", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def _delete_initial( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -5376,7 +5538,7 @@ def _delete_initial( "connection_name", ] }, - api_versions_list=["2025-08-01", "2025-12-01"], + api_versions_list=["2025-08-01", "2025-12-01", "2026-05-01"], ) def begin_delete( self, resource_group_name: str, storage_mover_name: str, connection_name: str, **kwargs: Any @@ -5612,7 +5774,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/types.py b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/types.py new file mode 100644 index 000000000000..4df4498ac9e4 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/azure/mgmt/storagemover/types.py @@ -0,0 +1,1563 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import CredentialType, EndpointType + +if TYPE_CHECKING: + from .models import ( + AgentStatus, + ConnectionStatus, + CopyMode, + CreatedByType, + DataIntegrityValidation, + DayOfWeek, + EndpointKind, + Frequency, + JobRunStatus, + JobType, + ManagedServiceIdentityType, + Minute, + NfsMountSourceType, + NfsVersion, + ProvisioningState, + S3WithHmacSourceType, + SmbMountSourceType, + ) + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + +class Agent(ProxyResource): + """The Agent resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Required. + :vartype properties: "AgentProperties" + """ + + properties: Required["AgentProperties"] + """Required.""" + + +class AgentProperties(TypedDict, total=False): + """AgentProperties. + + :ivar description: A description for the Agent. + :vartype description: str + :ivar agent_version: The Agent version. + :vartype agent_version: str + :ivar arc_resource_id: The fully qualified resource ID of the Hybrid Compute resource for the + Agent. Required. + :vartype arc_resource_id: str + :ivar arc_vm_uuid: The VM UUID of the Hybrid Compute resource for the Agent. Required. + :vartype arc_vm_uuid: str + :ivar agent_status: The Agent status. Known values are: "Registering", "Offline", "Online", + "Executing", "RequiresAttention", and "Unregistering". + :vartype agent_status: Union[str, "AgentStatus"] + :ivar last_status_update: The last updated time of the Agent status. + :vartype last_status_update: str + :ivar local_ip_address: Local IP address reported by the Agent. + :vartype local_ip_address: str + :ivar memory_in_mb: Available memory reported by the Agent, in MB. + :vartype memory_in_mb: int + :ivar number_of_cores: Available compute cores reported by the Agent. + :vartype number_of_cores: int + :ivar uptime_in_seconds: Uptime of the Agent in seconds. + :vartype uptime_in_seconds: int + :ivar time_zone: The agent's local time zone represented in Windows format. + :vartype time_zone: str + :ivar upload_limit_schedule: The WAN-link upload limit schedule that applies to any Job Run the + agent executes. Data plane operations (migrating files) are affected. Control plane operations + ensure seamless migration functionality and are not limited by this schedule. The schedule is + interpreted with the agent's local time. + :vartype upload_limit_schedule: "UploadLimitSchedule" + :ivar error_details: + :vartype error_details: "AgentPropertiesErrorDetails" + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + description: str + """A description for the Agent.""" + agentVersion: str + """The Agent version.""" + arcResourceId: Required[str] + """The fully qualified resource ID of the Hybrid Compute resource for the Agent. Required.""" + arcVmUuid: Required[str] + """The VM UUID of the Hybrid Compute resource for the Agent. Required.""" + agentStatus: Union[str, "AgentStatus"] + """The Agent status. Known values are: \"Registering\", \"Offline\", \"Online\", \"Executing\", + \"RequiresAttention\", and \"Unregistering\".""" + lastStatusUpdate: str + """The last updated time of the Agent status.""" + localIPAddress: str + """Local IP address reported by the Agent.""" + memoryInMB: int + """Available memory reported by the Agent, in MB.""" + numberOfCores: int + """Available compute cores reported by the Agent.""" + uptimeInSeconds: int + """Uptime of the Agent in seconds.""" + timeZone: str + """The agent's local time zone represented in Windows format.""" + uploadLimitSchedule: "UploadLimitSchedule" + """The WAN-link upload limit schedule that applies to any Job Run the agent executes. Data plane + operations (migrating files) are affected. Control plane operations ensure seamless migration + functionality and are not limited by this schedule. The schedule is interpreted with the + agent's local time.""" + errorDetails: "AgentPropertiesErrorDetails" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + + +class AgentPropertiesErrorDetails(TypedDict, total=False): + """AgentPropertiesErrorDetails. + + :ivar code: Error code reported by Agent. + :vartype code: str + :ivar message: Expanded description of reported error code. + :vartype message: str + """ + + code: str + """Error code reported by Agent.""" + message: str + """Expanded description of reported error code.""" + + +class AgentUpdateParameters(TypedDict, total=False): + """The Agent resource. + + :ivar properties: + :vartype properties: "AgentUpdateProperties" + """ + + properties: "AgentUpdateProperties" + + +class AgentUpdateProperties(TypedDict, total=False): + """AgentUpdateProperties. + + :ivar description: A description for the Agent. + :vartype description: str + :ivar upload_limit_schedule: The WAN-link upload limit schedule that applies to any Job Run the + agent executes. Data plane operations (migrating files) are affected. Control plane operations + ensure seamless migration functionality and are not limited by this schedule. The schedule is + interpreted with the agent's local time. + :vartype upload_limit_schedule: "UploadLimitSchedule" + """ + + description: str + """A description for the Agent.""" + uploadLimitSchedule: "UploadLimitSchedule" + """The WAN-link upload limit schedule that applies to any Job Run the agent executes. Data plane + operations (migrating files) are affected. Control plane operations ensure seamless migration + functionality and are not limited by this schedule. The schedule is interpreted with the + agent's local time.""" + + +class AzureKeyVaultS3WithHmacCredentials(TypedDict, total=False): + """The Azure Key Vault secret URIs which store the credentials. + + :ivar access_key_uri: The Azure Key Vault secret URI which stores the username. Use empty + string to clean-up existing value. + :vartype access_key_uri: str + :ivar secret_key_uri: The Azure Key Vault secret URI which stores the password. Use empty + string to clean-up existing value. + :vartype secret_key_uri: str + :ivar type: The Credentials type. Required. AZURE_KEY_VAULT_S3_WITH_HMAC. + :vartype type: Literal[CredentialType.AZURE_KEY_VAULT_S3_WITH_HMAC] + """ + + accessKeyUri: str + """The Azure Key Vault secret URI which stores the username. Use empty string to clean-up existing + value.""" + secretKeyUri: str + """The Azure Key Vault secret URI which stores the password. Use empty string to clean-up existing + value.""" + type: Required[Literal[CredentialType.AZURE_KEY_VAULT_S3_WITH_HMAC]] + """The Credentials type. Required. AZURE_KEY_VAULT_S3_WITH_HMAC.""" + + +class AzureKeyVaultSmbCredentials(TypedDict, total=False): + """The Azure Key Vault secret URIs which store the credentials. + + :ivar username_uri: The Azure Key Vault secret URI which stores the username. Use empty string + to clean-up existing value. + :vartype username_uri: str + :ivar password_uri: The Azure Key Vault secret URI which stores the password. Use empty string + to clean-up existing value. + :vartype password_uri: str + :ivar type: The Credentials type. Required. AZURE_KEY_VAULT_SMB. + :vartype type: Literal[CredentialType.AZURE_KEY_VAULT_SMB] + """ + + usernameUri: str + """The Azure Key Vault secret URI which stores the username. Use empty string to clean-up existing + value.""" + passwordUri: str + """The Azure Key Vault secret URI which stores the password. Use empty string to clean-up existing + value.""" + type: Required[Literal[CredentialType.AZURE_KEY_VAULT_SMB]] + """The Credentials type. Required. AZURE_KEY_VAULT_SMB.""" + + +class AzureMultiCloudConnectorEndpointProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure MultiCloudConnector endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar multi_cloud_connector_id: The Azure Resource ID of the MultiCloud Connector resource. + Required. + :vartype multi_cloud_connector_id: str + :ivar aws_s3_bucket_id: The AWS S3 bucket ARM resource Id. Required. + :vartype aws_s3_bucket_id: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_MULTI_CLOUD_CONNECTOR. + :vartype endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + multiCloudConnectorId: Required[str] + """The Azure Resource ID of the MultiCloud Connector resource. Required.""" + awsS3BucketId: Required[str] + """The AWS S3 bucket ARM resource Id. Required.""" + endpointType: Required[Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR]] + """The Endpoint resource type. Required. AZURE_MULTI_CLOUD_CONNECTOR.""" + + +class AzureMultiCloudConnectorEndpointUpdateProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage NFS file share endpoint to update. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_MULTI_CLOUD_CONNECTOR. + :vartype endpoint_type: Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR] + """ + + description: str + """A description for the Endpoint.""" + endpointType: Required[Literal[EndpointType.AZURE_MULTI_CLOUD_CONNECTOR]] + """The Endpoint resource type. Required. AZURE_MULTI_CLOUD_CONNECTOR.""" + + +class AzureStorageBlobContainerEndpointProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage blob container endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar storage_account_resource_id: The Azure Resource ID of the storage account that is the + target destination. Required. + :vartype storage_account_resource_id: str + :ivar blob_container_name: The name of the Storage blob container that is the target + destination. Required. + :vartype blob_container_name: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. When set to true, RBAC for the endpoint's managed + identity is granted on the customer's storage account so that authorization can be performed + entirely in the tenant where this endpoint lives. Defaults to false. Can be updated via PATCH. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Full ARM resource IDs of partner-tenant storage accounts that + are allowed to be the other side of a cross-tenant data transfer pair with this endpoint. For a + source endpoint this lists allowed target storage accounts; for a target endpoint this lists + allowed source storage accounts. The full list is replaced on PATCH (omit an entry to remove + it; include an entry to add it). Mutual presence in both endpoints' allow lists is re-validated + at every job run start, so removing an entry blocks future runs that reference the removed + storage account. + :vartype allowed_storage_accounts: list[str] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + storageAccountResourceId: Required[str] + """The Azure Resource ID of the storage account that is the target destination. Required.""" + blobContainerName: Required[str] + """The name of the Storage blob container that is the target destination. Required.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER]] + """The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER.""" + enableCrossTenantTransfer: bool + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + When set to true, RBAC for the endpoint's managed identity is granted on the customer's storage + account so that authorization can be performed entirely in the tenant where this endpoint + lives. Defaults to false. Can be updated via PATCH.""" + allowedStorageAccounts: list[str] + """Full ARM resource IDs of partner-tenant storage accounts that are allowed to be the other side + of a cross-tenant data transfer pair with this endpoint. For a source endpoint this lists + allowed target storage accounts; for a target endpoint this lists allowed source storage + accounts. The full list is replaced on PATCH (omit an entry to remove it; include an entry to + add it). Mutual presence in both endpoints' allow lists is re-validated at every job run start, + so removing an entry blocks future runs that reference the removed storage account.""" + + +class AzureStorageBlobContainerEndpointUpdateProperties(TypedDict, total=False): # pylint: disable=name-too-long + """AzureStorageBlobContainerEndpointUpdateProperties. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER] + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. Defaults to false. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Replaces the list of partner-tenant storage account ARM IDs + allowed to be the other side of a cross-tenant data transfer pair with this endpoint. Omit an + entry to remove it; include an entry to add it. Removing an entry blocks future job runs that + reference that storage account. + :vartype allowed_storage_accounts: list[str] + """ + + description: str + """A description for the Endpoint.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_BLOB_CONTAINER]] + """The Endpoint resource type. Required. AZURE_STORAGE_BLOB_CONTAINER.""" + enableCrossTenantTransfer: bool + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + Defaults to false.""" + allowedStorageAccounts: list[str] + """Replaces the list of partner-tenant storage account ARM IDs allowed to be the other side of a + cross-tenant data transfer pair with this endpoint. Omit an entry to remove it; include an + entry to add it. Removing an entry blocks future job runs that reference that storage account.""" + + +class AzureStorageNfsFileShareEndpointProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage NFS file share endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar storage_account_resource_id: The Azure Resource ID of the storage account. Required. + :vartype storage_account_resource_id: str + :ivar file_share_name: The name of the Azure Storage NFS file share. Required. + :vartype file_share_name: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_NFS_FILE_SHARE. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + storageAccountResourceId: Required[str] + """The Azure Resource ID of the storage account. Required.""" + fileShareName: Required[str] + """The name of the Azure Storage NFS file share. Required.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE]] + """The Endpoint resource type. Required. AZURE_STORAGE_NFS_FILE_SHARE.""" + + +class AzureStorageNfsFileShareEndpointUpdateProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage NFS file share endpoint to update. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_NFS_FILE_SHARE. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE] + """ + + description: str + """A description for the Endpoint.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_NFS_FILE_SHARE]] + """The Endpoint resource type. Required. AZURE_STORAGE_NFS_FILE_SHARE.""" + + +class AzureStorageSmbFileShareEndpointProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage SMB file share endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar storage_account_resource_id: The Azure Resource ID of the storage account. Required. + :vartype storage_account_resource_id: str + :ivar file_share_name: The name of the Azure Storage file share. Required. + :vartype file_share_name: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. When set to true, RBAC for the endpoint's managed + identity is granted on the customer's storage account so that authorization can be performed + entirely in the tenant where this endpoint lives. Defaults to false. Can be updated via PATCH. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Full ARM resource IDs of partner-tenant storage accounts that + are allowed to be the other side of a cross-tenant data transfer pair with this endpoint. For a + source endpoint this lists allowed target storage accounts; for a target endpoint this lists + allowed source storage accounts. The full list is replaced on PATCH (omit an entry to remove + it; include an entry to add it). Mutual presence in both endpoints' allow lists is re-validated + at every job run start, so removing an entry blocks future runs that reference the removed + storage account. + :vartype allowed_storage_accounts: list[str] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + storageAccountResourceId: Required[str] + """The Azure Resource ID of the storage account. Required.""" + fileShareName: Required[str] + """The name of the Azure Storage file share. Required.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE]] + """The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE.""" + enableCrossTenantTransfer: bool + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + When set to true, RBAC for the endpoint's managed identity is granted on the customer's storage + account so that authorization can be performed entirely in the tenant where this endpoint + lives. Defaults to false. Can be updated via PATCH.""" + allowedStorageAccounts: list[str] + """Full ARM resource IDs of partner-tenant storage accounts that are allowed to be the other side + of a cross-tenant data transfer pair with this endpoint. For a source endpoint this lists + allowed target storage accounts; for a target endpoint this lists allowed source storage + accounts. The full list is replaced on PATCH (omit an entry to remove it; include an entry to + add it). Mutual presence in both endpoints' allow lists is re-validated at every job run start, + so removing an entry blocks future runs that reference the removed storage account.""" + + +class AzureStorageSmbFileShareEndpointUpdateProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The properties of Azure Storage SMB file share endpoint to update. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_type: The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE. + :vartype endpoint_type: Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE] + :ivar enable_cross_tenant_transfer: Opt-in flag enabling this endpoint to be used as one side + of a cross-tenant data transfer pair. Defaults to false. + :vartype enable_cross_tenant_transfer: bool + :ivar allowed_storage_accounts: Replaces the list of partner-tenant storage account ARM IDs + allowed to be the other side of a cross-tenant data transfer pair with this endpoint. Omit an + entry to remove it; include an entry to add it. Removing an entry blocks future job runs that + reference that storage account. + :vartype allowed_storage_accounts: list[str] + """ + + description: str + """A description for the Endpoint.""" + endpointType: Required[Literal[EndpointType.AZURE_STORAGE_SMB_FILE_SHARE]] + """The Endpoint resource type. Required. AZURE_STORAGE_SMB_FILE_SHARE.""" + enableCrossTenantTransfer: bool + """Opt-in flag enabling this endpoint to be used as one side of a cross-tenant data transfer pair. + Defaults to false.""" + allowedStorageAccounts: list[str] + """Replaces the list of partner-tenant storage account ARM IDs allowed to be the other side of a + cross-tenant data transfer pair with this endpoint. Omit an entry to remove it; include an + entry to add it. Removing an entry blocks future job runs that reference that storage account.""" + + +class Connection(ProxyResource): + """The Connection resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Connection properties. Required. + :vartype properties: "ConnectionProperties" + """ + + properties: Required["ConnectionProperties"] + """Connection properties. Required.""" + + +class ConnectionProperties(TypedDict, total=False): + """Properties of the Connection resource. + + :ivar description: A description for the Connection. + :vartype description: str + :ivar connection_status: The connection status. Known values are: "Approved", "Rejected", + "Disconnected", "Pending", and "Stale". + :vartype connection_status: Union[str, "ConnectionStatus"] + :ivar private_link_service_id: The PrivateLinkServiceId for the connection. Required. + :vartype private_link_service_id: str + :ivar private_endpoint_name: The PrivateEndpointName associated with the connection. + :vartype private_endpoint_name: str + :ivar private_endpoint_resource_id: The privateEndpoint resource Id. + :vartype private_endpoint_resource_id: str + :ivar job_list: List of job definitions associated with this connection. + :vartype job_list: list[str] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + description: str + """A description for the Connection.""" + connectionStatus: Union[str, "ConnectionStatus"] + """The connection status. Known values are: \"Approved\", \"Rejected\", \"Disconnected\", + \"Pending\", and \"Stale\".""" + privateLinkServiceId: Required[str] + """The PrivateLinkServiceId for the connection. Required.""" + privateEndpointName: str + """The PrivateEndpointName associated with the connection.""" + privateEndpointResourceId: str + """The privateEndpoint resource Id.""" + jobList: list[str] + """List of job definitions associated with this connection.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + + +class Endpoint(ProxyResource): + """The Endpoint resource, which contains information about file sources and targets. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: The resource specific properties for the Storage Mover resource. Required. + :vartype properties: "EndpointBaseProperties" + :ivar identity: The managed service identity of the resource. This property is only available + on the latest version. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: Required["EndpointBaseProperties"] + """The resource specific properties for the Storage Mover resource. Required.""" + identity: "ManagedServiceIdentity" + """The managed service identity of the resource. This property is only available on the latest + version.""" + + +class EndpointBaseUpdateParameters(TypedDict, total=False): + """The Endpoint resource. + + :ivar properties: The Endpoint resource, which contains information about file sources and + targets. + :vartype properties: "EndpointBaseUpdateProperties" + :ivar identity: The managed system identity assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "EndpointBaseUpdateProperties" + """The Endpoint resource, which contains information about file sources and targets.""" + identity: "ManagedServiceIdentity" + """The managed system identity assigned to this resource.""" + + +class JobDefinition(ProxyResource): + """The Job Definition resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Job definition properties. Required. + :vartype properties: "JobDefinitionProperties" + """ + + properties: Required["JobDefinitionProperties"] + """Job definition properties. Required.""" + + +class JobDefinitionProperties(TypedDict, total=False): + """Job definition properties. + + :ivar description: A description for the Job Definition. OnPremToCloud is for migrating data + from on-premises to cloud. CloudToCloud is for migrating data between cloud to cloud. + :vartype description: str + :ivar job_type: The type of the Job. Known values are: "OnPremToCloud", "CloudToCloud", and + "OnPremToCloudAgentLess". + :vartype job_type: Union[str, "JobType"] + :ivar copy_mode: Strategy to use for copy. Required. Known values are: "Additive" and "Mirror". + :vartype copy_mode: Union[str, "CopyMode"] + :ivar source_name: The name of the source Endpoint. Required. + :vartype source_name: str + :ivar source_resource_id: Fully qualified resource ID of the source Endpoint. + :vartype source_resource_id: str + :ivar source_subpath: The subpath to use when reading from the source Endpoint. + :vartype source_subpath: str + :ivar target_name: The name of the target Endpoint. Required. + :vartype target_name: str + :ivar target_resource_id: Fully qualified resource ID of the target Endpoint. + :vartype target_resource_id: str + :ivar target_subpath: The subpath to use when writing to the target Endpoint. + :vartype target_subpath: str + :ivar latest_job_run_name: The name of the Job Run in a non-terminal state, if exists. + :vartype latest_job_run_name: str + :ivar latest_job_run_resource_id: The fully qualified resource ID of the Job Run in a + non-terminal state, if exists. + :vartype latest_job_run_resource_id: str + :ivar latest_job_run_status: The current status of the Job Run in a non-terminal state, if + exists. Known values are: "Queued", "Started", "Running", "CancelRequested", "Canceling", + "Canceled", "Failed", "Succeeded", and "PausedByBandwidthManagement". + :vartype latest_job_run_status: Union[str, "JobRunStatus"] + :ivar agent_name: Name of the Agent to assign for new Job Runs of this Job Definition. + :vartype agent_name: str + :ivar agent_resource_id: Fully qualified resource id of the Agent to assign for new Job Runs of + this Job Definition. + :vartype agent_resource_id: str + :ivar source_target_map: The list of cloud endpoints to migrate. + :vartype source_target_map: "JobDefinitionPropertiesSourceTargetMap" + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar connections: List of connections associated to this job. + :vartype connections: list[str] + :ivar schedule: Schedule information for the Job Definition. + :vartype schedule: "ScheduleInfo" + :ivar data_integrity_validation: The checksum validation mode for the job definition. Known + values are: "SaveVerifyFileMD5", "SaveFileMD5", and "None". + :vartype data_integrity_validation: Union[str, "DataIntegrityValidation"] + :ivar preserve_permissions: Boolean to preserve permissions or not. + :vartype preserve_permissions: bool + :ivar is_cross_tenant_job: Indicates that this Job Definition is a cross-tenant job where the + counterpart endpoint resides in a different Azure AD tenant. When true, + ``crossTenantEndpointTenantId`` and ``crossTenantEndpointResourceId`` must be provided. + Defaults to false. Cannot be modified after the Job Definition is created. + :vartype is_cross_tenant_job: bool + :ivar cross_tenant_endpoint_tenant_id: The Azure AD tenant ID of the cross-tenant source + endpoint. Required when ``isCrossTenantJob`` is true. Cannot be modified after the Job + Definition is created. + :vartype cross_tenant_endpoint_tenant_id: str + :ivar cross_tenant_endpoint_resource_id: Full ARM resource ID of the cross-tenant (foreign) + endpoint. On the source-tenant copy this is the TARGET endpoint; on the target-tenant copy this + is the SOURCE endpoint. + :vartype cross_tenant_endpoint_resource_id: str + :ivar sync_mode: The synchronization mode for the Job Definition. + :vartype sync_mode: str + :ivar mover_synced_until: The last time the mover was synchronized. + :vartype mover_synced_until: str + """ + + description: str + """A description for the Job Definition. OnPremToCloud is for migrating data from on-premises to + cloud. CloudToCloud is for migrating data between cloud to cloud.""" + jobType: Union[str, "JobType"] + """The type of the Job. Known values are: \"OnPremToCloud\", \"CloudToCloud\", and + \"OnPremToCloudAgentLess\".""" + copyMode: Required[Union[str, "CopyMode"]] + """Strategy to use for copy. Required. Known values are: \"Additive\" and \"Mirror\".""" + sourceName: Required[str] + """The name of the source Endpoint. Required.""" + sourceResourceId: str + """Fully qualified resource ID of the source Endpoint.""" + sourceSubpath: str + """The subpath to use when reading from the source Endpoint.""" + targetName: Required[str] + """The name of the target Endpoint. Required.""" + targetResourceId: str + """Fully qualified resource ID of the target Endpoint.""" + targetSubpath: str + """The subpath to use when writing to the target Endpoint.""" + latestJobRunName: str + """The name of the Job Run in a non-terminal state, if exists.""" + latestJobRunResourceId: str + """The fully qualified resource ID of the Job Run in a non-terminal state, if exists.""" + latestJobRunStatus: Union[str, "JobRunStatus"] + """The current status of the Job Run in a non-terminal state, if exists. Known values are: + \"Queued\", \"Started\", \"Running\", \"CancelRequested\", \"Canceling\", \"Canceled\", + \"Failed\", \"Succeeded\", and \"PausedByBandwidthManagement\".""" + agentName: str + """Name of the Agent to assign for new Job Runs of this Job Definition.""" + agentResourceId: str + """Fully qualified resource id of the Agent to assign for new Job Runs of this Job Definition.""" + sourceTargetMap: "JobDefinitionPropertiesSourceTargetMap" + """The list of cloud endpoints to migrate.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + connections: list[str] + """List of connections associated to this job.""" + schedule: "ScheduleInfo" + """Schedule information for the Job Definition.""" + dataIntegrityValidation: Union[str, "DataIntegrityValidation"] + """The checksum validation mode for the job definition. Known values are: \"SaveVerifyFileMD5\", + \"SaveFileMD5\", and \"None\".""" + preservePermissions: bool + """Boolean to preserve permissions or not.""" + isCrossTenantJob: bool + """Indicates that this Job Definition is a cross-tenant job where the counterpart endpoint resides + in a different Azure AD tenant. When true, ``crossTenantEndpointTenantId`` and + ``crossTenantEndpointResourceId`` must be provided. Defaults to false. Cannot be modified after + the Job Definition is created.""" + crossTenantEndpointTenantId: str + """The Azure AD tenant ID of the cross-tenant source endpoint. Required when ``isCrossTenantJob`` + is true. Cannot be modified after the Job Definition is created.""" + crossTenantEndpointResourceId: str + """Full ARM resource ID of the cross-tenant (foreign) endpoint. On the source-tenant copy this is + the TARGET endpoint; on the target-tenant copy this is the SOURCE endpoint.""" + syncMode: str + """The synchronization mode for the Job Definition.""" + moverSyncedUntil: str + """The last time the mover was synchronized.""" + + +class JobDefinitionPropertiesSourceTargetMap(TypedDict, total=False): + """JobDefinitionPropertiesSourceTargetMap. + + :ivar value: + :vartype value: list["SourceTargetMap"] + """ + + value: list["SourceTargetMap"] + + +class JobDefinitionUpdateParameters(TypedDict, total=False): + """The Job Definition resource. + + :ivar properties: Job definition properties. + :vartype properties: "JobDefinitionUpdateProperties" + """ + + properties: "JobDefinitionUpdateProperties" + """Job definition properties.""" + + +class JobDefinitionUpdateProperties(TypedDict, total=False): + """Job definition properties. + + :ivar description: A description for the Job Definition. + :vartype description: str + :ivar copy_mode: Strategy to use for copy. Known values are: "Additive" and "Mirror". + :vartype copy_mode: Union[str, "CopyMode"] + :ivar agent_name: Name of the Agent to assign for new Job Runs of this Job Definition. + :vartype agent_name: str + :ivar connections: List of connections associated to this job. + :vartype connections: list[str] + :ivar data_integrity_validation: Data Integrity Validation mode. Known values are: + "SaveVerifyFileMD5", "SaveFileMD5", and "None". + :vartype data_integrity_validation: Union[str, "DataIntegrityValidation"] + :ivar schedule: Schedule information for the Job Definition. + :vartype schedule: "ScheduleInfo" + :ivar sync_mode: The synchronization mode for the Job Definition. + :vartype sync_mode: str + :ivar mover_synced_until: The last time the mover was synchronized. + :vartype mover_synced_until: str + """ + + description: str + """A description for the Job Definition.""" + copyMode: Union[str, "CopyMode"] + """Strategy to use for copy. Known values are: \"Additive\" and \"Mirror\".""" + agentName: str + """Name of the Agent to assign for new Job Runs of this Job Definition.""" + connections: list[str] + """List of connections associated to this job.""" + dataIntegrityValidation: Union[str, "DataIntegrityValidation"] + """Data Integrity Validation mode. Known values are: \"SaveVerifyFileMD5\", \"SaveFileMD5\", and + \"None\".""" + schedule: "ScheduleInfo" + """Schedule information for the Job Definition.""" + syncMode: str + """The synchronization mode for the Job Definition.""" + moverSyncedUntil: str + """The last time the mover was synchronized.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class NfsMountEndpointProperties(TypedDict, total=False): + """The properties of NFS share endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar host: The host name or IP address of the server exporting the file system. Required. + :vartype host: str + :ivar nfs_version: The NFS protocol version. Known values are: "NFSauto", "NFSv3", "NFSv4", and + "NFSv4_1". + :vartype nfs_version: Union[str, "NfsVersion"] + :ivar export: The directory being exported from the server. Required. + :vartype export: str + :ivar endpoint_type: The Endpoint resource type. Required. NFS_MOUNT. + :vartype endpoint_type: Literal[EndpointType.NFS_MOUNT] + :ivar source_type: Source type to differentiate NFSMount and FSX-SMB endpoints. Default is + NFSMount. Known values are: "NfsMount" and "FSX-EFS". + :vartype source_type: Union[str, "NfsMountSourceType"] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + host: Required[str] + """The host name or IP address of the server exporting the file system. Required.""" + nfsVersion: Union[str, "NfsVersion"] + """The NFS protocol version. Known values are: \"NFSauto\", \"NFSv3\", \"NFSv4\", and \"NFSv4_1\".""" + export: Required[str] + """The directory being exported from the server. Required.""" + endpointType: Required[Literal[EndpointType.NFS_MOUNT]] + """The Endpoint resource type. Required. NFS_MOUNT.""" + sourceType: Union[str, "NfsMountSourceType"] + """Source type to differentiate NFSMount and FSX-SMB endpoints. Default is NFSMount. Known values + are: \"NfsMount\" and \"FSX-EFS\".""" + + +class NfsMountEndpointUpdateProperties(TypedDict, total=False): + """NfsMountEndpointUpdateProperties. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_type: The Endpoint resource type. Required. NFS_MOUNT. + :vartype endpoint_type: Literal[EndpointType.NFS_MOUNT] + """ + + description: str + """A description for the Endpoint.""" + endpointType: Required[Literal[EndpointType.NFS_MOUNT]] + """The Endpoint resource type. Required. NFS_MOUNT.""" + + +class Project(ProxyResource): + """The Project resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar properties: Project properties. + :vartype properties: "ProjectProperties" + """ + + properties: "ProjectProperties" + """Project properties.""" + + +class ProjectProperties(TypedDict, total=False): + """Project properties. + + :ivar description: A description for the Project. + :vartype description: str + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + description: str + """A description for the Project.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + + +class ProjectUpdateParameters(TypedDict, total=False): + """The Project resource. + + :ivar properties: Project properties. + :vartype properties: "ProjectUpdateProperties" + """ + + properties: "ProjectUpdateProperties" + """Project properties.""" + + +class ProjectUpdateProperties(TypedDict, total=False): + """Project properties. + + :ivar description: A description for the Project. + :vartype description: str + """ + + description: str + """A description for the Project.""" + + +class Recurrence(TypedDict, total=False): + """The schedule recurrence. + + :ivar start_time: The start time of the schedule recurrence. Full hour and 30-minute intervals + are supported. Required. + :vartype start_time: "Time" + :ivar end_time: The end time of the schedule recurrence. Full hour and 30-minute intervals are + supported. Required. + :vartype end_time: "Time" + """ + + startTime: Required["Time"] + """The start time of the schedule recurrence. Full hour and 30-minute intervals are supported. + Required.""" + endTime: Required["Time"] + """The end time of the schedule recurrence. Full hour and 30-minute intervals are supported. + Required.""" + + +class S3WithHmacEndpointProperties(TypedDict, total=False): + """The properties of S3WithHmac share endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar credentials: The Azure Key Vault credentials which stores the access key and secret key. + Use empty string to clean-up existing value. + :vartype credentials: "AzureKeyVaultS3WithHmacCredentials" + :ivar source_uri: The URI which points to the source. + :vartype source_uri: str + :ivar source_type: The source type of S3WithHmac endpoint. Known values are: "MINIO", "IBM", + "GCS", "ALIBABA", "DELL_EMC", and "OTHER". + :vartype source_type: Union[str, "S3WithHmacSourceType"] + :ivar other_source_type_description: The description for other source type of S3WithHmac + endpoint. + :vartype other_source_type_description: str + :ivar endpoint_type: The Endpoint resource type. Required. S3_WITH_HMAC. + :vartype endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + credentials: "AzureKeyVaultS3WithHmacCredentials" + """The Azure Key Vault credentials which stores the access key and secret key. Use empty string to + clean-up existing value.""" + sourceUri: str + """The URI which points to the source.""" + sourceType: Union[str, "S3WithHmacSourceType"] + """The source type of S3WithHmac endpoint. Known values are: \"MINIO\", \"IBM\", \"GCS\", + \"ALIBABA\", \"DELL_EMC\", and \"OTHER\".""" + otherSourceTypeDescription: str + """The description for other source type of S3WithHmac endpoint.""" + endpointType: Required[Literal[EndpointType.S3_WITH_HMAC]] + """The Endpoint resource type. Required. S3_WITH_HMAC.""" + + +class S3WithHmacEndpointUpdateProperties(TypedDict, total=False): + """S3WithHmacEndpointUpdateProperties. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar credentials: The Azure Key Vault secret URIs which store the required credentials to + access the S3. + :vartype credentials: "AzureKeyVaultS3WithHmacCredentials" + :ivar endpoint_type: The Endpoint resource type. Required. S3_WITH_HMAC. + :vartype endpoint_type: Literal[EndpointType.S3_WITH_HMAC] + """ + + description: str + """A description for the Endpoint.""" + credentials: "AzureKeyVaultS3WithHmacCredentials" + """The Azure Key Vault secret URIs which store the required credentials to access the S3.""" + endpointType: Required[Literal[EndpointType.S3_WITH_HMAC]] + """The Endpoint resource type. Required. S3_WITH_HMAC.""" + + +class ScheduleInfo(TypedDict, total=False): + """Schedule information for the Job Definition. + + :ivar frequency: Type of schedule — Monthly, Weekly, or Daily. Known values are: "Monthly", + "Weekly", "Daily", "Onetime", "None", and "Hourly". + :vartype frequency: Union[str, "Frequency"] + :ivar is_active: Whether the schedule is currently active. + :vartype is_active: bool + :ivar execution_time: Time of day to execute (hours and minutes). + :vartype execution_time: "SchedulerTime" + :ivar start_date: Specific one-time execution date and time. + :vartype start_date: str + :ivar days_of_week: Days of the week for weekly schedules. + :vartype days_of_week: list[str] + :ivar days_of_month: Days of the month for monthly schedules. + :vartype days_of_month: list[int] + :ivar cron_expression: Optional CRON expression for advanced scheduling. + :vartype cron_expression: str + :ivar end_date: End time of the schedule (in UTC). + :vartype end_date: str + :ivar repeat_interval: Repeat interval used for sub-daily schedules. + :vartype repeat_interval: str + """ + + frequency: Union[str, "Frequency"] + """Type of schedule — Monthly, Weekly, or Daily. Known values are: \"Monthly\", \"Weekly\", + \"Daily\", \"Onetime\", \"None\", and \"Hourly\".""" + isActive: bool + """Whether the schedule is currently active.""" + executionTime: "SchedulerTime" + """Time of day to execute (hours and minutes).""" + startDate: str + """Specific one-time execution date and time.""" + daysOfWeek: list[str] + """Days of the week for weekly schedules.""" + daysOfMonth: list[int] + """Days of the month for monthly schedules.""" + cronExpression: str + """Optional CRON expression for advanced scheduling.""" + endDate: str + """End time of the schedule (in UTC).""" + repeatInterval: str + """Repeat interval used for sub-daily schedules.""" + + +class SchedulerTime(TypedDict, total=False): + """The time of day. + + :ivar hour: The hour element of the time. Allowed values range from 0 (start of the selected + day) to 24 (end of the selected day). Hour value 24 cannot be combined with any other minute + value but 0. + :vartype hour: int + :ivar minute: The minute element of the time. Allowed values are 0 and 30. If not specified, + its value defaults to 0. Known values are: 0 and 30. + :vartype minute: Union[int, "Minute"] + """ + + hour: int + """The hour element of the time. Allowed values range from 0 (start of the selected day) to 24 + (end of the selected day). Hour value 24 cannot be combined with any other minute value but 0.""" + minute: Union[int, "Minute"] + """The minute element of the time. Allowed values are 0 and 30. If not specified, its value + defaults to 0. Known values are: 0 and 30.""" + + +class SmbMountEndpointProperties(TypedDict, total=False): + """The properties of SMB share endpoint. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar endpoint_kind: The Endpoint resource kind source or target. Known values are: "Source" + and "Target". + :vartype endpoint_kind: Union[str, "EndpointKind"] + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar host: The host name or IP address of the server exporting the file system. Required. + :vartype host: str + :ivar share_name: The name of the SMB share being exported from the server. Required. + :vartype share_name: str + :ivar credentials: The Azure Key Vault secret URIs which store the required credentials to + access the SMB share. + :vartype credentials: "AzureKeyVaultSmbCredentials" + :ivar endpoint_type: The Endpoint resource type. Required. SMB_MOUNT. + :vartype endpoint_type: Literal[EndpointType.SMB_MOUNT] + :ivar source_type: Source type to differentiate SMBMount and FSX-SMB endpoints. Default is + SMBMount. Known values are: "SmbMount" and "FSX-SMB". + :vartype source_type: Union[str, "SmbMountSourceType"] + """ + + description: str + """A description for the Endpoint.""" + endpointKind: Union[str, "EndpointKind"] + """The Endpoint resource kind source or target. Known values are: \"Source\" and \"Target\".""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + host: Required[str] + """The host name or IP address of the server exporting the file system. Required.""" + shareName: Required[str] + """The name of the SMB share being exported from the server. Required.""" + credentials: "AzureKeyVaultSmbCredentials" + """The Azure Key Vault secret URIs which store the required credentials to access the SMB share.""" + endpointType: Required[Literal[EndpointType.SMB_MOUNT]] + """The Endpoint resource type. Required. SMB_MOUNT.""" + sourceType: Union[str, "SmbMountSourceType"] + """Source type to differentiate SMBMount and FSX-SMB endpoints. Default is SMBMount. Known values + are: \"SmbMount\" and \"FSX-SMB\".""" + + +class SmbMountEndpointUpdateProperties(TypedDict, total=False): + """The properties of SMB share endpoint to update. + + :ivar description: A description for the Endpoint. + :vartype description: str + :ivar credentials: The Azure Key Vault secret URIs which store the required credentials to + access the SMB share. + :vartype credentials: "AzureKeyVaultSmbCredentials" + :ivar endpoint_type: The Endpoint resource type. Required. SMB_MOUNT. + :vartype endpoint_type: Literal[EndpointType.SMB_MOUNT] + """ + + description: str + """A description for the Endpoint.""" + credentials: "AzureKeyVaultSmbCredentials" + """The Azure Key Vault secret URIs which store the required credentials to access the SMB share.""" + endpointType: Required[Literal[EndpointType.SMB_MOUNT]] + """The Endpoint resource type. Required. SMB_MOUNT.""" + + +class SourceEndpoint(TypedDict, total=False): + """The source endpoint resource for source and target mapping. + + :ivar properties: The properties of the cloud source endpoint to migrate. + :vartype properties: "SourceEndpointProperties" + """ + + properties: "SourceEndpointProperties" + """The properties of the cloud source endpoint to migrate.""" + + +class SourceEndpointProperties(TypedDict, total=False): + """The properties of the cloud source endpoint to migrate. + + :ivar name: The name of the cloud source endpoint to migrate. + :vartype name: str + :ivar source_endpoint_resource_id: The fully qualified ARM resource ID of the cloud source + endpoint to migrate. + :vartype source_endpoint_resource_id: str + :ivar aws_s3_bucket_id: The fully qualified ARM resource ID of the AWS S3 bucket to migrate. + :vartype aws_s3_bucket_id: str + """ + + name: str + """The name of the cloud source endpoint to migrate.""" + sourceEndpointResourceId: str + """The fully qualified ARM resource ID of the cloud source endpoint to migrate.""" + awsS3BucketId: str + """The fully qualified ARM resource ID of the AWS S3 bucket to migrate.""" + + +class SourceTargetMap(TypedDict, total=False): + """The properties of cloud endpoints to migrate. + + :ivar source_endpoint: Required. + :vartype source_endpoint: "SourceEndpoint" + :ivar target_endpoint: Required. + :vartype target_endpoint: "TargetEndpoint" + """ + + sourceEndpoint: Required["SourceEndpoint"] + """Required.""" + targetEndpoint: Required["TargetEndpoint"] + """Required.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class StorageMover(TrackedResource): + """The Storage Mover resource, which is a container for a group of Agents, Projects, and + Endpoints. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource specific properties for the Storage Mover resource. + :vartype properties: "StorageMoverProperties" + """ + + properties: "StorageMoverProperties" + """The resource specific properties for the Storage Mover resource.""" + + +class StorageMoverProperties(TypedDict, total=False): + """The resource specific properties for the Storage Mover resource. + + :ivar description: A description for the Storage Mover. + :vartype description: str + :ivar provisioning_state: The provisioning state of this resource. Known values are: + "Succeeded", "Canceled", "Failed", and "Deleting". + :vartype provisioning_state: Union[str, "ProvisioningState"] + """ + + description: str + """A description for the Storage Mover.""" + provisioningState: Union[str, "ProvisioningState"] + """The provisioning state of this resource. Known values are: \"Succeeded\", \"Canceled\", + \"Failed\", and \"Deleting\".""" + + +class StorageMoverUpdateParameters(TypedDict, total=False): + """The Storage Mover resource. + + :ivar properties: The resource specific properties for the Storage Mover resource. + :vartype properties: "StorageMoverUpdateProperties" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: "StorageMoverUpdateProperties" + """The resource specific properties for the Storage Mover resource.""" + tags: dict[str, str] + """Resource tags.""" + + +class StorageMoverUpdateProperties(TypedDict, total=False): + """The resource specific properties for the Storage Mover resource. + + :ivar description: A description for the Storage Mover. + :vartype description: str + """ + + description: str + """A description for the Storage Mover.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class TargetEndpoint(TypedDict, total=False): + """The target endpoint resource for source and target mapping. + + :ivar properties: The properties of the cloud target endpoint to migrate. + :vartype properties: "TargetEndpointProperties" + """ + + properties: "TargetEndpointProperties" + """The properties of the cloud target endpoint to migrate.""" + + +class TargetEndpointProperties(TypedDict, total=False): + """The properties of the cloud target endpoint to migrate. + + :ivar name: The name of the cloud target endpoint to migrate. + :vartype name: str + :ivar target_endpoint_resource_id: The fully qualified ARM resource ID of the cloud target + endpoint to migrate. + :vartype target_endpoint_resource_id: str + :ivar azure_storage_account_resource_id: The fully qualified ARM resource ID of the Azure + Storage account. + :vartype azure_storage_account_resource_id: str + :ivar azure_storage_blob_container_name: The name of the Azure Storage blob container. + :vartype azure_storage_blob_container_name: str + """ + + name: str + """The name of the cloud target endpoint to migrate.""" + targetEndpointResourceId: str + """The fully qualified ARM resource ID of the cloud target endpoint to migrate.""" + azureStorageAccountResourceId: str + """The fully qualified ARM resource ID of the Azure Storage account.""" + azureStorageBlobContainerName: str + """The name of the Azure Storage blob container.""" + + +class Time(TypedDict, total=False): + """The time of day. + + :ivar hour: The hour element of the time. Allowed values range from 0 (start of the selected + day) to 24 (end of the selected day). Hour value 24 cannot be combined with any other minute + value but 0. Required. + :vartype hour: int + :ivar minute: The minute element of the time. Allowed values are 0 and 30. If not specified, + its value defaults to 0. Known values are: 0 and 30. + :vartype minute: Union[int, "Minute"] + """ + + hour: Required[int] + """The hour element of the time. Allowed values range from 0 (start of the selected day) to 24 + (end of the selected day). Hour value 24 cannot be combined with any other minute value but 0. + Required.""" + minute: Union[int, "Minute"] + """The minute element of the time. Allowed values are 0 and 30. If not specified, its value + defaults to 0. Known values are: 0 and 30.""" + + +class UploadLimitSchedule(TypedDict, total=False): + """The WAN-link upload limit schedule. Overlapping recurrences are not allowed. + + :ivar weekly_recurrences: The set of weekly repeating recurrences of the WAN-link upload limit + schedule. + :vartype weekly_recurrences: list["UploadLimitWeeklyRecurrence"] + """ + + weeklyRecurrences: list["UploadLimitWeeklyRecurrence"] + """The set of weekly repeating recurrences of the WAN-link upload limit schedule.""" + + +class WeeklyRecurrence(Recurrence): + """The weekly recurrence of the schedule. + + :ivar start_time: The start time of the schedule recurrence. Full hour and 30-minute intervals + are supported. Required. + :vartype start_time: "Time" + :ivar end_time: The end time of the schedule recurrence. Full hour and 30-minute intervals are + supported. Required. + :vartype end_time: "Time" + :ivar days: The set of days of week for the schedule recurrence. A day must not be specified + more than once in a recurrence. Required. + :vartype days: list[Union[str, "DayOfWeek"]] + """ + + days: Required[list[Union[str, "DayOfWeek"]]] + """The set of days of week for the schedule recurrence. A day must not be specified more than once + in a recurrence. Required.""" + + +class UploadLimitWeeklyRecurrence(WeeklyRecurrence): + """The weekly recurrence of the WAN-link upload limit schedule. The start time must be earlier in + the day than the end time. The recurrence must not span across multiple days. + + :ivar start_time: The start time of the schedule recurrence. Full hour and 30-minute intervals + are supported. Required. + :vartype start_time: "Time" + :ivar end_time: The end time of the schedule recurrence. Full hour and 30-minute intervals are + supported. Required. + :vartype end_time: "Time" + :ivar days: The set of days of week for the schedule recurrence. A day must not be specified + more than once in a recurrence. Required. + :vartype days: list[Union[str, "DayOfWeek"]] + :ivar limit_in_mbps: The WAN-link upload bandwidth (maximum data transfer rate) in megabits per + second. Value of 0 indicates no throughput is allowed and any running migration job is + effectively paused for the duration of this recurrence. Only data plane operations are governed + by this limit. Control plane operations ensure seamless functionality. The agent may exceed + this limit with control messages, if necessary. Required. + :vartype limit_in_mbps: int + """ + + limitInMbps: Required[int] + """The WAN-link upload bandwidth (maximum data transfer rate) in megabits per second. Value of 0 + indicates no throughput is allowed and any running migration job is effectively paused for the + duration of this recurrence. Only data plane operations are governed by this limit. Control + plane operations ensure seamless functionality. The agent may exceed this limit with control + messages, if necessary. Required.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +Credentials = Union[AzureKeyVaultS3WithHmacCredentials, AzureKeyVaultSmbCredentials] +EndpointBaseProperties = Union[ + AzureMultiCloudConnectorEndpointProperties, + AzureStorageBlobContainerEndpointProperties, + AzureStorageNfsFileShareEndpointProperties, + AzureStorageSmbFileShareEndpointProperties, + NfsMountEndpointProperties, + S3WithHmacEndpointProperties, + SmbMountEndpointProperties, +] +EndpointBaseUpdateProperties = Union[ + AzureMultiCloudConnectorEndpointUpdateProperties, + AzureStorageBlobContainerEndpointUpdateProperties, + AzureStorageNfsFileShareEndpointUpdateProperties, + AzureStorageSmbFileShareEndpointUpdateProperties, + NfsMountEndpointUpdateProperties, + S3WithHmacEndpointUpdateProperties, + SmbMountEndpointUpdateProperties, +] diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_maximum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_maximum_set.py index 25e3c685a3d3..833b5f072e5e 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_maximum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_maximum_set.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_CreateOrUpdate_MaximumSet.json +# x-ms-original-file: 2026-05-01/Agents_CreateOrUpdate_MaximumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_minimum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_minimum_set.py index 354869135739..8c7a8aa79414 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_minimum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_minimum_set.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_CreateOrUpdate_MinimumSet.json +# x-ms-original-file: 2026-05-01/Agents_CreateOrUpdate_MinimumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_upload_limit_schedule_overnight.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_upload_limit_schedule_overnight.py index b589c8016268..5bcdee23664a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_upload_limit_schedule_overnight.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_create_or_update_upload_limit_schedule_overnight.py @@ -61,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json +# x-ms-original-file: 2026-05-01/Agents_CreateOrUpdate_UploadLimitSchedule_Overnight.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_delete.py index e2ef9e98fcc9..57f779484b80 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/Agents_Delete.json +# x-ms-original-file: 2026-05-01/Agents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_maximum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_maximum_set.py index 93c6289f8d4b..8a798ad8c6c3 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_maximum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_maximum_set.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_Get_MaximumSet.json +# x-ms-original-file: 2026-05-01/Agents_Get_MaximumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_minimum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_minimum_set.py index 6511c151a7eb..83cc4c4ef15f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_minimum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_get_minimum_set.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_Get_MinimumSet.json +# x-ms-original-file: 2026-05-01/Agents_Get_MinimumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_maximum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_maximum_set.py index 171ccbda3409..3d2080065fc2 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_maximum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_maximum_set.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Agents_List_MaximumSet.json +# x-ms-original-file: 2026-05-01/Agents_List_MaximumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_minimum_set.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_minimum_set.py index fa4e0296b7d6..b858b7640527 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_minimum_set.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_list_minimum_set.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Agents_List_MinimumSet.json +# x-ms-original-file: 2026-05-01/Agents_List_MinimumSet.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_update.py index 8d35ec720d15..961aa4385d6a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/agents_update.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Agents_Update.json +# x-ms-original-file: 2026-05-01/Agents_Update.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_create_or_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_create_or_update.py index c34d1c17c8ee..eead0e2af44c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_create_or_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Connections_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01/Connections_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_delete.py index 3f1ea6861d6b..376080c3d449 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/Connections_Delete.json +# x-ms-original-file: 2026-05-01/Connections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_get.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_get.py index af23fb4c43fd..435b8a669f87 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_get.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Connections_Get.json +# x-ms-original-file: 2026-05-01/Connections_Get.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_list.py index ac13008d86a8..e3142327081c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/connections_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Connections_List.json +# x-ms-original-file: 2026-05-01/Connections_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_multi_cloud_connector.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_multi_cloud_connector.py index cbdec2cb2e43..b5998eb3ec59 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_multi_cloud_connector.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_multi_cloud_connector.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureMultiCloudConnector.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container.py index b35722582a7e..851c02d6cf9e 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureStorageBlobContainer.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container_cross_tenant.py new file mode 100644 index 000000000000..8bd2b49ade2a --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_blob_container_cross_tenant.py @@ -0,0 +1,57 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_create_or_update_azure_storage_blob_container_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.create_or_update( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + endpoint={ + "properties": { + "allowedStorageAccounts": [ + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa" + ], + "blobContainerName": "examples-blobcontainer", + "description": "Cross-tenant source Storage Blob Container Endpoint", + "enableCrossTenantTransfer": True, + "endpointKind": "Source", + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesourcesa", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureStorageBlobContainer_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_nfs_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_nfs_file_share.py index 337a8705a09a..abe1e8b2fb3a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_nfs_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_nfs_file_share.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureStorageNfsFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share.py index 96f29601b1f6..541061913ff5 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share_cross_tenant.py new file mode 100644 index 000000000000..3bf3814ec35d --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_azure_storage_smb_file_share_cross_tenant.py @@ -0,0 +1,57 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_create_or_update_azure_storage_smb_file_share_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.create_or_update( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + endpoint={ + "properties": { + "allowedStorageAccounts": [ + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa" + ], + "description": "Cross-tenant source Azure Storage SMB file share Endpoint", + "enableCrossTenantTransfer": True, + "endpointKind": "Source", + "endpointType": "AzureStorageSmbFileShare", + "fileShareName": "examples-fileshare", + "storageAccountResourceId": "/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesourcesa", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_AzureStorageSmbFileShare_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_nfs_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_nfs_mount.py index c8cefa17baa8..90e86745ff7f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_nfs_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_nfs_mount.py @@ -41,12 +41,13 @@ def main(): "endpointType": "NfsMount", "export": "examples-exportName", "host": "0.0.0.0", + "sourceType": "NfsMount", } }, ) print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_NfsMount.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_NfsMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_s3_with_hmac.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_s3_with_hmac.py index e74bdb9617fc..fec2017b905f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_s3_with_hmac.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_s3_with_hmac.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_S3WithHMAC.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_S3WithHMAC.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_smb_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_smb_mount.py index f4261f7ace9d..92426fee8d22 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_smb_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_create_or_update_smb_mount.py @@ -46,12 +46,13 @@ def main(): "endpointType": "SmbMount", "host": "0.0.0.0", "shareName": "examples-shareName", + "sourceType": "SmbMount", } }, ) print(response) -# x-ms-original-file: 2025-12-01/Endpoints_CreateOrUpdate_SmbMount.json +# x-ms-original-file: 2026-05-01/Endpoints_CreateOrUpdate_SmbMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_delete.py index 71a951ef31ea..0c389dfed7bb 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/Endpoints_Delete.json +# x-ms-original-file: 2026-05-01/Endpoints_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_multi_cloud_connector.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_multi_cloud_connector.py index bd8b2dea63aa..8f5411d7eabb 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_multi_cloud_connector.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_multi_cloud_connector.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_AzureMultiCloudConnector.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureMultiCloudConnector.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container.py index dec93a23fe74..aa4dfb00cc8b 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_AzureStorageBlobContainer.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureStorageBlobContainer.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container_cross_tenant.py new file mode 100644 index 000000000000..6ffc58bbb6bd --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_blob_container_cross_tenant.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_get_azure_storage_blob_container_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.get( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureStorageBlobContainer_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_nfs_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_nfs_file_share.py index c95b9eb3982b..bc10dd664a9d 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_nfs_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_nfs_file_share.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_AzureStorageNfsFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureStorageNfsFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share.py index e7bd0a1c7666..1e50c700f76b 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_AzureStorageSmbFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureStorageSmbFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share_cross_tenant.py new file mode 100644 index 000000000000..b2eb98896836 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_azure_storage_smb_file_share_cross_tenant.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_get_azure_storage_smb_file_share_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.get( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_Get_AzureStorageSmbFileShare_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_nfs_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_nfs_mount.py index fec504f17fa6..aae853095adf 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_nfs_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_nfs_mount.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_NfsMount.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_NfsMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_s3_with_hmac.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_s3_with_hmac.py index a30fc085d3dc..ffd5da909cbc 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_s3_with_hmac.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_s3_with_hmac.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_S3WithHMAC.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_S3WithHMAC.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_smb_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_smb_mount.py index 15464aefe606..9b1e65baa18e 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_smb_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_get_smb_mount.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Get_SmbMount.json +# x-ms-original-file: 2026-05-01/Endpoints_Get_SmbMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_list.py index 7cd2af04612a..97406d31fe64 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Endpoints_List.json +# x-ms-original-file: 2026-05-01/Endpoints_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_multi_cloud_connector.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_multi_cloud_connector.py index d6e0b40e7ba8..5ed7d593631a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_multi_cloud_connector.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_multi_cloud_connector.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_AzureMultiCloudConnector.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureMultiCloudConnector.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container.py index 0cbb10d77c66..828d74cbf30c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_AzureStorageBlobContainer.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureStorageBlobContainer.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container_cross_tenant.py new file mode 100644 index 000000000000..fd0ef91c75e3 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_blob_container_cross_tenant.py @@ -0,0 +1,55 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_update_azure_storage_blob_container_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + endpoint={ + "properties": { + "allowedStorageAccounts": [ + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa", + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa2", + ], + "description": "Updated cross-tenant source endpoint with refreshed allowed partner storage accounts", + "enableCrossTenantTransfer": True, + "endpointType": "AzureStorageBlobContainer", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureStorageBlobContainer_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_nfs_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_nfs_file_share.py index 694834e53f16..3662f2f78871 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_nfs_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_nfs_file_share.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_AzureStorageNfsFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureStorageNfsFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share.py index 0ffbd601f887..e2d5f49e7041 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_AzureStorageSmbFileShare.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureStorageSmbFileShare.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share_cross_tenant.py new file mode 100644 index 000000000000..f37dbd8763b9 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_azure_storage_smb_file_share_cross_tenant.py @@ -0,0 +1,55 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python endpoints_update_azure_storage_smb_file_share_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + endpoint_name="examples-endpointName", + endpoint={ + "properties": { + "allowedStorageAccounts": [ + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa", + "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.Storage/storageAccounts/partnertargetsa2", + ], + "description": "Updated cross-tenant source SMB file share endpoint with refreshed allowed partner storage accounts", + "enableCrossTenantTransfer": True, + "endpointType": "AzureStorageSmbFileShare", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-05-01/Endpoints_Update_AzureStorageSmbFileShare_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_nfs_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_nfs_mount.py index 7c5327bdb151..0a02b3c0b670 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_nfs_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_nfs_mount.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_NfsMount.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_NfsMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_s3_with_hmac.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_s3_with_hmac.py index c5b7154a715c..956913776de2 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_s3_with_hmac.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_s3_with_hmac.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_S3WithHMAC.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_S3WithHMAC.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_smb_mount.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_smb_mount.py index 136ca81ea07f..d91cd989988b 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_smb_mount.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/endpoints_update_smb_mount.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Endpoints_Update_SmbMount.json +# x-ms-original-file: 2026-05-01/Endpoints_Update_SmbMount.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update.py index 01769181fcaf..fa8a6b672b1f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update.py @@ -45,8 +45,11 @@ def main(): "copyMode": "Additive", "description": "Example Job Definition Description", "jobType": "OnPremToCloud", + "moverSyncedUntil": "2026-05-01T00:00:00Z", + "preservePermissions": False, "sourceName": "examples-sourceEndpointName", "sourceSubpath": "/", + "syncMode": "FullScan", "targetName": "examples-targetEndpointName", "targetSubpath": "/", } @@ -55,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01/JobDefinitions_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cloud_to_cloud.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cloud_to_cloud.py index 50f9296b7208..a61895f0eef9 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cloud_to_cloud.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cloud_to_cloud.py @@ -45,8 +45,10 @@ def main(): "copyMode": "Additive", "description": "Example Job Definition Description", "jobType": "CloudToCloud", + "moverSyncedUntil": "2026-05-01T00:00:00Z", "sourceName": "examples-sourceEndpointName", "sourceSubpath": "/", + "syncMode": "SnapshotBased", "targetName": "examples-targetEndpointName", "targetSubpath": "/", } @@ -55,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_CreateOrUpdate_CloudToCloud.json +# x-ms-original-file: 2026-05-01/JobDefinitions_CreateOrUpdate_CloudToCloud.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cross_tenant.py new file mode 100644 index 000000000000..cadc4a0cc48c --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_cross_tenant.py @@ -0,0 +1,60 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python job_definitions_create_or_update_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.job_definitions.create_or_update( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + project_name="examples-projectName", + job_definition_name="examples-jobDefinitionName", + job_definition={ + "properties": { + "agentName": "migration-agent", + "copyMode": "Additive", + "crossTenantEndpointResourceId": "/subscriptions/0a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809/resourceGroups/partner-rg/providers/Microsoft.StorageMover/storageMovers/partner-storageMover/endpoints/partner-targetEndpoint", + "crossTenantEndpointTenantId": "11111111-2222-3333-4444-555555555555", + "description": "Cross-tenant Blob-to-Blob copy job. JobDefinition lives in the source (host) tenant alongside the local source endpoint; the target endpoint lives in a partner (guest) tenant.", + "isCrossTenantJob": True, + "jobType": "CloudToCloud", + "sourceName": "examples-sourceEndpointName", + "sourceSubpath": "/", + "targetName": "partner-targetEndpoint", + "targetSubpath": "/", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-05-01/JobDefinitions_CreateOrUpdate_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_with_schedule.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_with_schedule.py index 10d5017e8d93..14b8f37af0c3 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_with_schedule.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_create_or_update_with_schedule.py @@ -51,7 +51,7 @@ def main(): "executionTime": {"hour": 9, "minute": 0}, "frequency": "Weekly", "isActive": True, - "startDate": "2025-12-01T00:00:00Z", + "startDate": "2026-05-01T00:00:00Z", }, "sourceName": "examples-sourceEndpointName", "sourceSubpath": "/", @@ -63,6 +63,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_CreateOrUpdate_With_Schedule.json +# x-ms-original-file: 2026-05-01/JobDefinitions_CreateOrUpdate_With_Schedule.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_delete.py index 05216cfced65..4cc2d59ba390 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/JobDefinitions_Delete.json +# x-ms-original-file: 2026-05-01/JobDefinitions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get.py index 9b625be2be03..a6ae3db6fc14 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_Get.json +# x-ms-original-file: 2026-05-01/JobDefinitions_Get.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant.py new file mode 100644 index 000000000000..74622e48860a --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python job_definitions_get_cross_tenant.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.job_definitions.get( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + project_name="examples-projectName", + job_definition_name="examples-jobDefinitionName", + ) + print(response) + + +# x-ms-original-file: 2026-05-01/JobDefinitions_Get_CrossTenant.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant_mirror.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant_mirror.py new file mode 100644 index 000000000000..15ee8a3b5e26 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_cross_tenant_mirror.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python job_definitions_get_cross_tenant_mirror.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.job_definitions.get( + resource_group_name="partner-rg", + storage_mover_name="partner-storageMover", + project_name="partner-projectName", + job_definition_name="examples-jobDefinitionName", + ) + print(response) + + +# x-ms-original-file: 2026-05-01/JobDefinitions_Get_CrossTenant_Mirror.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_with_schedule.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_with_schedule.py index 7732580b52d6..107392c2fd66 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_with_schedule.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_get_with_schedule.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_Get_With_Schedule.json +# x-ms-original-file: 2026-05-01/JobDefinitions_Get_With_Schedule.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_list.py index 726c5517d702..97c8a7a89dcb 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/JobDefinitions_List.json +# x-ms-original-file: 2026-05-01/JobDefinitions_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_reconcile_job.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_reconcile_job.py new file mode 100644 index 000000000000..0d44a8428123 --- /dev/null +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_reconcile_job.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.storagemover import StorageMoverMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-storagemover +# USAGE + python job_definitions_reconcile_job.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 = StorageMoverMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.job_definitions.reconcile_job( + resource_group_name="examples-rg", + storage_mover_name="examples-storageMoverName", + project_name="examples-projectName", + job_definition_name="examples-jobDefinitionName", + ) + print(response) + + +# x-ms-original-file: 2026-05-01/JobDefinitions_ReconcileJob.json +if __name__ == "__main__": + main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_start_job.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_start_job.py index d1a8b72903ab..76f5f191bd6f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_start_job.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_start_job.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_StartJob.json +# x-ms-original-file: 2026-05-01/JobDefinitions_StartJob.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_stop_job.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_stop_job.py index 4967fa14b70e..c788eeab7795 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_stop_job.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_stop_job.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_StopJob.json +# x-ms-original-file: 2026-05-01/JobDefinitions_StopJob.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_update.py index 5191da7747d7..16b2aa9d2031 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_definitions_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobDefinitions_Update.json +# x-ms-original-file: 2026-05-01/JobDefinitions_Update.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get.py index 3ec106223433..e9af09a8279a 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobRuns_Get.json +# x-ms-original-file: 2026-05-01/JobRuns_Get.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get_with_schedule.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get_with_schedule.py index 62d50a22c2a0..3cf78ce6e4b4 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get_with_schedule.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_get_with_schedule.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/JobRuns_Get_With_Schedule.json +# x-ms-original-file: 2026-05-01/JobRuns_Get_With_Schedule.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_list.py index 19fd3388be67..302b5685d39f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/job_runs_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/JobRuns_List.json +# x-ms-original-file: 2026-05-01/JobRuns_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/operations_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/operations_list.py index 50b820c9d2f3..49b0adb065e8 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/operations_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Operations_List.json +# x-ms-original-file: 2026-05-01/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_create_or_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_create_or_update.py index c058b134b1bd..bca02468c77d 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_create_or_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_create_or_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Projects_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01/Projects_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_delete.py index f946b745e395..e02c559e63f3 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/Projects_Delete.json +# x-ms-original-file: 2026-05-01/Projects_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_get.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_get.py index 9cd864a216d9..8088d722f4f1 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_get.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Projects_Get.json +# x-ms-original-file: 2026-05-01/Projects_Get.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_list.py index 7ba1922c0b64..659e0eea3002 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/Projects_List.json +# x-ms-original-file: 2026-05-01/Projects_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_update.py index c81b165ceb1e..e4587faeb8b3 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/projects_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/Projects_Update.json +# x-ms-original-file: 2026-05-01/Projects_Update.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_create_or_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_create_or_update.py index 6186322c9cf7..bf92c2110319 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_create_or_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_create_or_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/StorageMovers_CreateOrUpdate.json +# x-ms-original-file: 2026-05-01/StorageMovers_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_delete.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_delete.py index d31419607b02..3de43a5043c9 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_delete.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-12-01/StorageMovers_Delete.json +# x-ms-original-file: 2026-05-01/StorageMovers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_get.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_get.py index 74475f64f008..dec38586d3e2 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_get.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/StorageMovers_Get.json +# x-ms-original-file: 2026-05-01/StorageMovers_Get.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list.py index 515f1db1aadd..e030b35e78aa 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/StorageMovers_List.json +# x-ms-original-file: 2026-05-01/StorageMovers_List.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list_by_subscription.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list_by_subscription.py index b5bcbd15e88a..1a722e927bb1 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list_by_subscription.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-12-01/StorageMovers_ListBySubscription.json +# x-ms-original-file: 2026-05-01/StorageMovers_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_update.py b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_update.py index 103e84c18cc8..66a4651b9ed4 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_update.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_samples/storage_movers_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-12-01/StorageMovers_Update.json +# x-ms-original-file: 2026-05-01/StorageMovers_Update.json if __name__ == "__main__": main() diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations.py b/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations.py index bf4d64012245..c2e7c2faa435 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations.py @@ -47,12 +47,16 @@ def test_job_definitions_create_or_update(self, resource_group): "agentName": "str", "agentResourceId": "str", "connections": ["str"], + "crossTenantEndpointResourceId": "str", + "crossTenantEndpointTenantId": "str", "dataIntegrityValidation": "str", "description": "str", + "isCrossTenantJob": bool, "jobType": "str", "latestJobRunName": "str", "latestJobRunResourceId": "str", "latestJobRunStatus": "str", + "moverSyncedUntil": "2020-02-20 00:00:00", "preservePermissions": bool, "provisioningState": "str", "schedule": { @@ -63,6 +67,7 @@ def test_job_definitions_create_or_update(self, resource_group): "executionTime": {"hour": 0, "minute": 0}, "frequency": "str", "isActive": bool, + "repeatInterval": "str", "startDate": "2020-02-20 00:00:00", }, "sourceResourceId": "str", @@ -88,6 +93,7 @@ def test_job_definitions_create_or_update(self, resource_group): } ] }, + "syncMode": "str", "targetResourceId": "str", "targetSubpath": "str", }, @@ -123,6 +129,7 @@ def test_job_definitions_update(self, resource_group): "copyMode": "str", "dataIntegrityValidation": "str", "description": "str", + "moverSyncedUntil": "2020-02-20 00:00:00", "schedule": { "cronExpression": "str", "daysOfMonth": [0], @@ -131,8 +138,10 @@ def test_job_definitions_update(self, resource_group): "executionTime": {"hour": 0, "minute": 0}, "frequency": "str", "isActive": bool, + "repeatInterval": "str", "startDate": "2020-02-20 00:00:00", }, + "syncMode": "str", } }, ) @@ -190,3 +199,16 @@ def test_job_definitions_stop_job(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_definitions_reconcile_job(self, resource_group): + response = self.client.job_definitions.reconcile_job( + resource_group_name=resource_group.name, + storage_mover_name="str", + project_name="str", + job_definition_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations_async.py b/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations_async.py index 2833195eafac..1823f58b8b61 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations_async.py +++ b/sdk/storagemover/azure-mgmt-storagemover/generated_tests/test_storage_mover_mgmt_job_definitions_operations_async.py @@ -48,12 +48,16 @@ async def test_job_definitions_create_or_update(self, resource_group): "agentName": "str", "agentResourceId": "str", "connections": ["str"], + "crossTenantEndpointResourceId": "str", + "crossTenantEndpointTenantId": "str", "dataIntegrityValidation": "str", "description": "str", + "isCrossTenantJob": bool, "jobType": "str", "latestJobRunName": "str", "latestJobRunResourceId": "str", "latestJobRunStatus": "str", + "moverSyncedUntil": "2020-02-20 00:00:00", "preservePermissions": bool, "provisioningState": "str", "schedule": { @@ -64,6 +68,7 @@ async def test_job_definitions_create_or_update(self, resource_group): "executionTime": {"hour": 0, "minute": 0}, "frequency": "str", "isActive": bool, + "repeatInterval": "str", "startDate": "2020-02-20 00:00:00", }, "sourceResourceId": "str", @@ -89,6 +94,7 @@ async def test_job_definitions_create_or_update(self, resource_group): } ] }, + "syncMode": "str", "targetResourceId": "str", "targetSubpath": "str", }, @@ -124,6 +130,7 @@ async def test_job_definitions_update(self, resource_group): "copyMode": "str", "dataIntegrityValidation": "str", "description": "str", + "moverSyncedUntil": "2020-02-20 00:00:00", "schedule": { "cronExpression": "str", "daysOfMonth": [0], @@ -132,8 +139,10 @@ async def test_job_definitions_update(self, resource_group): "executionTime": {"hour": 0, "minute": 0}, "frequency": "str", "isActive": bool, + "repeatInterval": "str", "startDate": "2020-02-20 00:00:00", }, + "syncMode": "str", } }, ) @@ -193,3 +202,16 @@ async def test_job_definitions_stop_job(self, resource_group): # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_definitions_reconcile_job(self, resource_group): + response = await self.client.job_definitions.reconcile_job( + resource_group_name=resource_group.name, + storage_mover_name="str", + project_name="str", + job_definition_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/storagemover/azure-mgmt-storagemover/pyproject.toml b/sdk/storagemover/azure-mgmt-storagemover/pyproject.toml index b39e88739b3a..38bca870f8f4 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/pyproject.toml +++ b/sdk/storagemover/azure-mgmt-storagemover/pyproject.toml @@ -17,13 +17,13 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/conftest.py b/sdk/storagemover/azure-mgmt-storagemover/tests/conftest.py index 1996672f0528..f0e7213b0dc2 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/conftest.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/conftest.py @@ -43,8 +43,7 @@ def add_sanitizers(test_proxy): # sanitized zero-GUID in recordings, matching the value the test sources # build their cross-sub resource IDs from at playback time. storagemover_synthetics_subscription_id = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) add_general_regex_sanitizer( regex=storagemover_synthetics_subscription_id, diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_async_test.py index 344291d8fe96..9ab1aa684410 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_async_test.py @@ -1,4 +1,3 @@ - # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -47,6 +46,7 @@ def _assert_upload_limit_schedule(agent): assert recurrence.end_time.minute == 0 +@pytest.mark.live_test_only class TestStorageMoverMgmtAgentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_test.py index d753496acac9..d8b835152265 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_agents_operations_test.py @@ -45,6 +45,7 @@ def _assert_upload_limit_schedule(agent): assert recurrence.end_time.minute == 0 +@pytest.mark.live_test_only class TestStorageMoverMgmtAgentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_async_test.py index 8397e2fda8c2..1dd35c8dad95 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_async_test.py @@ -8,6 +8,7 @@ See the sync sibling (test_storage_mover_mgmt_connections_operations_test.py) for the full rationale. """ + import os import pytest @@ -23,8 +24,7 @@ # The subscription id is read from the environment for live runs and defaults to # the sanitized zero-GUID so the real subscription is never committed. SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) REAL_PRIVATE_LINK_SERVICE_ID = ( f"/subscriptions/{SYNTHETICS_SUBSCRIPTION_ID}" @@ -33,6 +33,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtConnectionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) @@ -45,17 +46,22 @@ async def test_create_get_list_update_delete(self, resource_group): connection_name = "testconn1" await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) # Create created = await self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionDesc", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionDesc", + } + }, ) # See sync sibling for why we compare by PLS name suffix instead of full ARM ID. pls_id_suffix = "/providers/Microsoft.Network/privateLinkServices/test-pls-wcs" @@ -65,7 +71,9 @@ async def test_create_get_list_update_delete(self, resource_group): # Get fetched = await self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ) assert fetched.name == connection_name assert fetched.id == created.id @@ -73,27 +81,39 @@ async def test_create_get_list_update_delete(self, resource_group): # NOTE: do not assert on `connection_status` — see sync sibling docstring. # List - items = [c async for c in self.client.connections.list( - resource_group_name=rg, storage_mover_name=sm_name, - )] + items = [ + c + async for c in self.client.connections.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ] assert len(items) >= 1 assert connection_name in [c.name for c in items] # Update — see sync sibling docstring for why we don't assert on the response. await self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionDescUpdate", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionDescUpdate", + } + }, ) # Delete + 404 verification poller = await self.client.connections.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ) await poller.result() with pytest.raises(ResourceNotFoundError): await self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_test.py index dfd10f360894..5475fa2e08b4 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_connections_operations_test.py @@ -20,6 +20,7 @@ async. Approval is covered by matrix row #31 (``JobDefinitionJobRunTests.StartC2CJobWithPrivateSourceTest``). """ + import os import pytest @@ -37,8 +38,7 @@ # The subscription id is read from the environment for live runs and defaults to # the sanitized zero-GUID so the real subscription is never committed. SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) REAL_PRIVATE_LINK_SERVICE_ID = ( f"/subscriptions/{SYNTHETICS_SUBSCRIPTION_ID}" @@ -47,6 +47,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtConnectionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) @@ -59,17 +60,22 @@ def test_create_get_list_update_delete(self, resource_group): connection_name = "testconn1" self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) # Create created = self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionDesc", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionDesc", + } + }, ) # Playback note: the test runner's subscription ID is sanitized to all-zeros # in recordings, so we assert by PLS name suffix (resource-path-stable across @@ -81,7 +87,9 @@ def test_create_get_list_update_delete(self, resource_group): # Get fetched = self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ) assert fetched.name == connection_name assert fetched.id == created.id @@ -89,9 +97,12 @@ def test_create_get_list_update_delete(self, resource_group): # NOTE: do not assert on `connection_status` — see module docstring. # List - items = list(self.client.connections.list( - resource_group_name=rg, storage_mover_name=sm_name, - )) + items = list( + self.client.connections.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ) assert len(items) >= 1 assert connection_name in [c.name for c in items] @@ -102,18 +113,26 @@ def test_create_get_list_update_delete(self, resource_group): # (test_storage_mover_connection_scenarios) also calls update without # post-update verification for the same reason. self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionDescUpdate", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionDescUpdate", + } + }, ) # Delete + 404 verification self.client.connections.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_async_test.py index 7302dae38c27..6acf739d97d9 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_async_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET EndpointTests at: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario/EndpointTests.cs """ + import os import pytest @@ -27,8 +29,7 @@ # real subscription is never committed to the repo (recordings are sanitized to # this same value). SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) MULTI_CLOUD_CONNECTOR_ID = ( f"/subscriptions/{SYNTHETICS_SUBSCRIPTION_ID}" @@ -49,19 +50,23 @@ def _account_id(rg): ) +@pytest.mark.live_test_only class TestStorageMoverMgmtEndpointsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) async def _create_storage_mover(self, rg, sm_name): await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) async def _delete_endpoint(self, rg, sm_name, endpoint_name): poller = await self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) await poller.result() @@ -80,53 +85,69 @@ async def test_create_update_get_delete(self, resource_group): fs_name = "fsendpoint-1" c = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "description": "New container endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "description": "New container endpoint", + } + }, ) assert c.name == c_name assert c.properties.endpoint_type == "AzureStorageBlobContainer" c_get = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name, ) assert c_get.name == c_name nfs = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=nfs_name, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "nfsVersion": "NFSv3", - "description": "New NFS endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=nfs_name, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "nfsVersion": "NFSv3", + "description": "New NFS endpoint", + } + }, ) assert nfs.properties.host == "10.0.0.1" assert nfs.properties.export == "/" nfs_get = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=nfs_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=nfs_name, ) assert nfs_get.properties.host == "10.0.0.1" smb = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "credentials": { - "type": "AzureKeyVaultSmb", - "usernameUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", - "passwordUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", - }, - "description": "New Smb mount endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "credentials": { + "type": "AzureKeyVaultSmb", + "usernameUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", + "passwordUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", + }, + "description": "New Smb mount endpoint", + } + }, ) assert smb.properties.share_name == "testshare" @@ -138,7 +159,9 @@ async def test_create_update_get_delete(self, resource_group): # satisfies the check. The .NET test omits identity entirely and would also # fail today against this api-version. smb_updated = await self.client.endpoints.update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, endpoint={ "identity": {"type": "None"}, "properties": { @@ -158,33 +181,47 @@ async def test_create_update_get_delete(self, resource_group): await self._delete_endpoint(rg, sm_name, smb_name) fs = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=fs_name, - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "description": "new file share endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=fs_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "description": "new file share endpoint", + } + }, ) assert fs.properties.file_share_name == "testfileshare" fs_get = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=fs_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=fs_name, ) assert fs_get.properties.description == "new file share endpoint" - items = [e async for e in self.client.endpoints.list( - resource_group_name=rg, storage_mover_name=sm_name, - )] + items = [ + e + async for e in self.client.endpoints.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ] assert len(items) > 1 with pytest.raises(ResourceNotFoundError): await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name + "111", + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name + "111", ) with pytest.raises(ResourceNotFoundError): await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, ) # ----- EndpointTests.MultiCloudConnectorEndpointCreateGetDeleteTest ----- @@ -198,19 +235,25 @@ async def test_multi_cloud_connector_create_get_delete(self, resource_group): endpoint_name = "mcc-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "description": "Test multi-cloud connector endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "description": "Test multi-cloud connector endpoint", + } + }, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureMultiCloudConnector" endpoint = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.properties.description == "Test multi-cloud connector endpoint" assert endpoint.properties.multi_cloud_connector_id is not None @@ -219,7 +262,9 @@ async def test_multi_cloud_connector_create_get_delete(self, resource_group): await self._delete_endpoint(rg, sm_name, endpoint_name) with pytest.raises(ResourceNotFoundError): await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) # ----- EndpointTests.S3WithHmacEndpointCreateGetDeleteTest ----- @@ -235,42 +280,54 @@ async def test_s3_with_hmac_create_get_delete(self, resource_group): await self._create_storage_mover(rg, sm_name) endpoint_name = "s3hmac-1" - body = {"properties": { - "endpointType": "S3WithHMAC", - "sourceUri": "https://s3.example.com/bucket", - "sourceType": "MINIO", - "description": "Test S3 with HMAC endpoint", - "credentials": { - "type": "AzureKeyVaultS3WithHMAC", - "accessKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey", - "secretKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey", - }, - }} + body = { + "properties": { + "endpointType": "S3WithHMAC", + "sourceUri": "https://s3.example.com/bucket", + "sourceType": "MINIO", + "description": "Test S3 with HMAC endpoint", + "credentials": { + "type": "AzureKeyVaultS3WithHMAC", + "accessKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey", + "secretKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey", + }, + } + } endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, endpoint=body, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "S3WithHMAC" endpoint = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.source_uri == "https://s3.example.com/bucket" assert endpoint.properties.source_type == "MINIO" assert endpoint.properties.description == "Test S3 with HMAC endpoint" assert endpoint.properties.credentials is not None - assert endpoint.properties.credentials.access_key_uri == \ - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey" - assert endpoint.properties.credentials.secret_key_uri == \ - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey" + assert ( + endpoint.properties.credentials.access_key_uri + == "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey" + ) + assert ( + endpoint.properties.credentials.secret_key_uri + == "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey" + ) await self._delete_endpoint(rg, sm_name, endpoint_name) with pytest.raises(ResourceNotFoundError): await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) # ----- valid-EndpointKind tests ----- @@ -284,14 +341,18 @@ async def test_nfs_mount_kind_source(self, resource_group): endpoint_name = "nfs-src-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "endpointKind": "Source", - "description": "NFS source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "endpointKind": "Source", + "description": "NFS source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -305,14 +366,18 @@ async def test_smb_mount_kind_source(self, resource_group): endpoint_name = "smb-src-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "endpointKind": "Source", - "description": "SMB source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "endpointKind": "Source", + "description": "SMB source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -326,14 +391,18 @@ async def test_multi_cloud_connector_kind_source(self, resource_group): endpoint_name = "mcc-src-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "Multi-cloud connector source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "Multi-cloud connector source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -347,14 +416,18 @@ async def test_blob_container_kind_source(self, resource_group): endpoint_name = "blob-src-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "endpointKind": "Source", - "description": "Blob container source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "endpointKind": "Source", + "description": "Blob container source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -368,14 +441,18 @@ async def test_blob_container_kind_target(self, resource_group): endpoint_name = "blob-tgt-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "endpointKind": "Target", - "description": "Blob container target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "endpointKind": "Target", + "description": "Blob container target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -389,14 +466,18 @@ async def test_smb_file_share_kind_target(self, resource_group): endpoint_name = "smbfs-tgt-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "endpointKind": "Target", - "description": "SMB file share target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "endpointKind": "Target", + "description": "SMB file share target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -410,14 +491,18 @@ async def test_nfs_file_share_kind_target(self, resource_group): endpoint_name = "nfsfs-tgt-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "endpointKind": "Target", - "description": "NFS file share target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "endpointKind": "Target", + "description": "NFS file share target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" await self._delete_endpoint(rg, sm_name, endpoint_name) @@ -433,13 +518,17 @@ async def test_nfs_mount_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="nfs-tgt-1", - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="nfs-tgt-1", + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -451,13 +540,17 @@ async def test_smb_mount_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="smb-tgt-1", - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="smb-tgt-1", + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -469,13 +562,17 @@ async def test_multi_cloud_connector_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="mcc-tgt-1", - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="mcc-tgt-1", + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -487,13 +584,17 @@ async def test_smb_file_share_kind_source_fails(self, resource_group): with pytest.raises(HttpResponseError): await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="smbfs-src-1", - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "endpointKind": "Source", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="smbfs-src-1", + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "endpointKind": "Source", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -505,13 +606,17 @@ async def test_nfs_file_share_kind_source_fails(self, resource_group): with pytest.raises(HttpResponseError): await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="nfsfs-src-1", - endpoint={"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "endpointKind": "Source", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="nfsfs-src-1", + endpoint={ + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "endpointKind": "Source", + } + }, ) # ----- EndpointTests.NfsFileShareEndpointCreateGetDeleteTest ----- @@ -525,19 +630,25 @@ async def test_nfs_file_share_create_get_delete(self, resource_group): endpoint_name = "nfsfs-1" endpoint = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "description": "Test NFS file share endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "description": "Test NFS file share endpoint", + } + }, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureStorageNfsFileShare" endpoint = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.properties.file_share_name == "testnfsfileshare" assert endpoint.properties.description == "Test NFS file share endpoint" @@ -545,5 +656,7 @@ async def test_nfs_file_share_create_get_delete(self, resource_group): await self._delete_endpoint(rg, sm_name, endpoint_name) with pytest.raises(ResourceNotFoundError): await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_test.py index 1f14927d581c..e73c8ff495d6 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_endpoints_operations_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET EndpointTests at: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario/EndpointTests.cs """ + import os import pytest @@ -26,8 +28,7 @@ # real subscription is never committed to the repo (recordings are sanitized to # this same value). SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) MULTI_CLOUD_CONNECTOR_ID = ( f"/subscriptions/{SYNTHETICS_SUBSCRIPTION_ID}" @@ -49,13 +50,15 @@ def _account_id(rg): ) +@pytest.mark.live_test_only class TestStorageMoverMgmtEndpointsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) def _create_storage_mover(self, rg, sm_name): self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) @@ -75,33 +78,43 @@ def test_create_update_get_delete(self, resource_group): # --- Container endpoint --- c = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "description": "New container endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "description": "New container endpoint", + } + }, ) assert c.name == c_name assert c.properties.endpoint_type == "AzureStorageBlobContainer" c_get = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name, ) assert c_get.name == c_name assert c_get.properties.endpoint_type == "AzureStorageBlobContainer" # --- NFS mount endpoint --- nfs = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=nfs_name, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "nfsVersion": "NFSv3", - "description": "New NFS endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=nfs_name, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "nfsVersion": "NFSv3", + "description": "New NFS endpoint", + } + }, ) assert nfs.name == nfs_name assert nfs.properties.endpoint_type == "NfsMount" @@ -109,25 +122,31 @@ def test_create_update_get_delete(self, resource_group): assert nfs.properties.host == "10.0.0.1" nfs_get = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=nfs_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=nfs_name, ) assert nfs_get.properties.host == "10.0.0.1" assert nfs_get.properties.export == "/" # --- SMB mount endpoint with credentials --- smb = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "credentials": { - "type": "AzureKeyVaultSmb", - "usernameUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", - "passwordUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", - }, - "description": "New Smb mount endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "credentials": { + "type": "AzureKeyVaultSmb", + "usernameUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-username", + "passwordUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-password", + }, + "description": "New Smb mount endpoint", + } + }, ) assert smb.name == smb_name assert smb.properties.endpoint_type == "SmbMount" @@ -143,7 +162,9 @@ def test_create_update_get_delete(self, resource_group): # satisfies the check. The .NET test omits identity entirely and would also # fail today against this api-version. smb_updated = self.client.endpoints.update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, endpoint={ "identity": {"type": "None"}, "properties": { @@ -163,42 +184,57 @@ def test_create_update_get_delete(self, resource_group): assert smb_updated.properties.share_name == "testshare" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, ).result() # --- Azure Storage SMB FileShare endpoint --- fs = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=fs_name, - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "description": "new file share endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=fs_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "description": "new file share endpoint", + } + }, ) assert fs.name == fs_name assert fs.properties.endpoint_type == "AzureStorageSmbFileShare" assert fs.properties.file_share_name == "testfileshare" fs_get = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=fs_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=fs_name, ) assert fs_get.properties.file_share_name == "testfileshare" assert fs_get.properties.description == "new file share endpoint" # --- list + missing-endpoint check --- - items = list(self.client.endpoints.list( - resource_group_name=rg, storage_mover_name=sm_name, - )) + items = list( + self.client.endpoints.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ) assert len(items) > 1 with pytest.raises(ResourceNotFoundError): self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=c_name + "111", + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=c_name + "111", ) with pytest.raises(ResourceNotFoundError): self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=smb_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=smb_name, ) # ----- EndpointTests.MultiCloudConnectorEndpointCreateGetDeleteTest ----- @@ -211,22 +247,28 @@ def test_multi_cloud_connector_create_get_delete(self, resource_group): self._create_storage_mover(rg, sm_name) endpoint_name = "mcc-1" - body = {"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "description": "Test multi-cloud connector endpoint", - }} + body = { + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "description": "Test multi-cloud connector endpoint", + } + } endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, endpoint=body, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureMultiCloudConnector" endpoint = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.description == "Test multi-cloud connector endpoint" @@ -234,11 +276,15 @@ def test_multi_cloud_connector_create_get_delete(self, resource_group): assert endpoint.properties.aws_s3_bucket_id is not None self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) # ----- EndpointTests.S3WithHmacEndpointCreateGetDeleteTest ----- @@ -254,44 +300,58 @@ def test_s3_with_hmac_create_get_delete(self, resource_group): self._create_storage_mover(rg, sm_name) endpoint_name = "s3hmac-1" - body = {"properties": { - "endpointType": "S3WithHMAC", - "sourceUri": "https://s3.example.com/bucket", - "sourceType": "MINIO", - "description": "Test S3 with HMAC endpoint", - "credentials": { - "type": "AzureKeyVaultS3WithHMAC", - "accessKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey", - "secretKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey", - }, - }} + body = { + "properties": { + "endpointType": "S3WithHMAC", + "sourceUri": "https://s3.example.com/bucket", + "sourceType": "MINIO", + "description": "Test S3 with HMAC endpoint", + "credentials": { + "type": "AzureKeyVaultS3WithHMAC", + "accessKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey", + "secretKeyUri": "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey", + }, + } + } endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, endpoint=body, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "S3WithHMAC" endpoint = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.source_uri == "https://s3.example.com/bucket" assert endpoint.properties.source_type == "MINIO" assert endpoint.properties.description == "Test S3 with HMAC endpoint" assert endpoint.properties.credentials is not None - assert endpoint.properties.credentials.access_key_uri == \ - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey" - assert endpoint.properties.credentials.secret_key_uri == \ - "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey" + assert ( + endpoint.properties.credentials.access_key_uri + == "https://examples-azureKeyVault.vault.azure.net/secrets/examples-accesskey" + ) + assert ( + endpoint.properties.credentials.secret_key_uri + == "https://examples-azureKeyVault.vault.azure.net/secrets/examples-secretkey" + ) self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) # ----- EndpointTests valid-EndpointKind tests ----- @@ -305,19 +365,25 @@ def test_nfs_mount_kind_source(self, resource_group): endpoint_name = "nfs-src-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "endpointKind": "Source", - "description": "NFS source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "endpointKind": "Source", + "description": "NFS source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -329,19 +395,25 @@ def test_smb_mount_kind_source(self, resource_group): endpoint_name = "smb-src-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "endpointKind": "Source", - "description": "SMB source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "endpointKind": "Source", + "description": "SMB source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -353,19 +425,25 @@ def test_multi_cloud_connector_kind_source(self, resource_group): endpoint_name = "mcc-src-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "Multi-cloud connector source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "Multi-cloud connector source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -377,19 +455,25 @@ def test_blob_container_kind_source(self, resource_group): endpoint_name = "blob-src-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "endpointKind": "Source", - "description": "Blob container source endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "endpointKind": "Source", + "description": "Blob container source endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Source" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -401,19 +485,25 @@ def test_blob_container_kind_target(self, resource_group): endpoint_name = "blob-tgt-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": _account_id(rg), - "blobContainerName": CONTAINER_NAME, - "endpointKind": "Target", - "description": "Blob container target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": _account_id(rg), + "blobContainerName": CONTAINER_NAME, + "endpointKind": "Target", + "description": "Blob container target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -425,19 +515,25 @@ def test_smb_file_share_kind_target(self, resource_group): endpoint_name = "smbfs-tgt-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "endpointKind": "Target", - "description": "SMB file share target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "endpointKind": "Target", + "description": "SMB file share target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -449,19 +545,25 @@ def test_nfs_file_share_kind_target(self, resource_group): endpoint_name = "nfsfs-tgt-1" endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "endpointKind": "Target", - "description": "NFS file share target endpoint", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "endpointKind": "Target", + "description": "NFS file share target endpoint", + } + }, ) assert endpoint.properties.endpoint_kind == "Target" self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() # ----- EndpointTests invalid-EndpointKind tests ----- @@ -475,13 +577,17 @@ def test_nfs_mount_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="nfs-tgt-1", - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="nfs-tgt-1", + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -493,13 +599,17 @@ def test_smb_mount_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="smb-tgt-1", - endpoint={"properties": { - "endpointType": "SmbMount", - "host": "10.0.0.1", - "shareName": "testshare", - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="smb-tgt-1", + endpoint={ + "properties": { + "endpointType": "SmbMount", + "host": "10.0.0.1", + "shareName": "testshare", + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -511,13 +621,17 @@ def test_multi_cloud_connector_kind_target_fails(self, resource_group): with pytest.raises(HttpResponseError): self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="mcc-tgt-1", - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_S3_BUCKET_ID, - "endpointKind": "Target", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="mcc-tgt-1", + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_S3_BUCKET_ID, + "endpointKind": "Target", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -529,13 +643,17 @@ def test_smb_file_share_kind_source_fails(self, resource_group): with pytest.raises(HttpResponseError): self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="smbfs-src-1", - endpoint={"properties": { - "endpointType": "AzureStorageSmbFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testfileshare", - "endpointKind": "Source", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="smbfs-src-1", + endpoint={ + "properties": { + "endpointType": "AzureStorageSmbFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testfileshare", + "endpointKind": "Source", + } + }, ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -547,13 +665,17 @@ def test_nfs_file_share_kind_source_fails(self, resource_group): with pytest.raises(HttpResponseError): self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name="nfsfs-src-1", - endpoint={"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "endpointKind": "Source", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name="nfsfs-src-1", + endpoint={ + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "endpointKind": "Source", + } + }, ) # ----- EndpointTests.NfsFileShareEndpointCreateGetDeleteTest ----- @@ -566,22 +688,28 @@ def test_nfs_file_share_create_get_delete(self, resource_group): self._create_storage_mover(rg, sm_name) endpoint_name = "nfsfs-1" - body = {"properties": { - "endpointType": "AzureStorageNfsFileShare", - "storageAccountResourceId": _account_id(rg), - "fileShareName": "testnfsfileshare", - "description": "Test NFS file share endpoint", - }} + body = { + "properties": { + "endpointType": "AzureStorageNfsFileShare", + "storageAccountResourceId": _account_id(rg), + "fileShareName": "testnfsfileshare", + "description": "Test NFS file share endpoint", + } + } endpoint = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, endpoint=body, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureStorageNfsFileShare" endpoint = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.file_share_name == "testnfsfileshare" @@ -589,9 +717,13 @@ def test_nfs_file_share_create_get_delete(self, resource_group): assert endpoint.properties.storage_account_resource_id is not None self.client.endpoints.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_async_test.py index a71536fd49bf..b429dda34e77 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_async_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -19,6 +20,7 @@ use `pytest.importorskip` so collection skips this whole module cleanly in that environment. """ + import asyncio import os import uuid @@ -55,38 +57,46 @@ # The subscription id is read from the environment for live runs and defaults to # the sanitized zero-GUID so the real subscription is never committed. SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) PLS_RESOURCE_GROUP = "E2E-Management-RGsyn" PLS_NAME = "test-pls-wcs" REAL_PRIVATE_LINK_SERVICE_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID - + "/resourceGroups/" + PLS_RESOURCE_GROUP - + "/providers/Microsoft.Network/privateLinkServices/" + PLS_NAME + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + + "/resourceGroups/" + + PLS_RESOURCE_GROUP + + "/providers/Microsoft.Network/privateLinkServices/" + + PLS_NAME ) STORAGE_ACCOUNT_RG = "CP_Mover_IN_WCUS" STORAGE_ACCOUNT_NAME = "cpmoveraccount" STORAGE_ACCOUNT_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID - + "/resourceGroups/" + STORAGE_ACCOUNT_RG - + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + + "/resourceGroups/" + + STORAGE_ACCOUNT_RG + + "/providers/Microsoft.Storage/storageAccounts/" + + STORAGE_ACCOUNT_NAME ) MULTI_CLOUD_CONNECTOR_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/E2E-Management-RGsyn" + "/providers/Microsoft.HybridConnectivity/publicCloudConnectors/e2e-sm-rp-connector" ) PRIVATE_S3_BUCKET_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/aws_640698235822" + "/providers/Microsoft.AWSConnector/s3Buckets/e2e-sm-rp-private-bucket" ) AWS_PUBLIC_S3_BUCKET_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/aws_640698235822" + "/providers/Microsoft.AWSConnector/s3Buckets/e2e-sm-rp-bucket" ) @@ -94,35 +104,47 @@ STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID = "ba92f5b4-2d11-453d-a403-e96b0029c9fe" +@pytest.mark.live_test_only class TestStorageMoverMgmtJobDefinitionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) async def _provision_parents(self, rg, sm_name, project_name, source_endpoint, target_endpoint): await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "nfsVersion": "NFSv3", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "nfsVersion": "NFSv3", + } + }, ) await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, - "blobContainerName": "testcontainer", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, + "blobContainerName": "testcontainer", + } + }, ) # ----- JobDefinitionJobRunTests.JobDefinitionJobRunTest (matrix row #10) ----- @@ -160,33 +182,40 @@ async def test_job_definition_job_run(self, resource_group, **kwargs): container_created = False rbac_created = False - container_scope = ( - STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name - ) + container_scope = STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name try: await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": WCUS_LOCATION}, ) await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_PUBLIC_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "publicMccSourceForJobRun", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_PUBLIC_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "publicMccSourceForJobRun", + } + }, ) target = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, endpoint={ "identity": {"type": "SystemAssigned"}, "properties": { @@ -197,44 +226,54 @@ async def test_job_definition_job_run(self, resource_group, **kwargs): }, }, ) - assert target.identity is not None and target.identity.principal_id, ( - "Target blob endpoint did not get an auto-assigned MSI principalId" - ) + assert ( + target.identity is not None and target.identity.principal_id + ), "Target blob endpoint did not get an auto-assigned MSI principalId" target_msi_principal_id = target.identity.principal_id await storage_client.blob_containers.create( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, - container_name=container_name, blob_container={}, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, + container_name=container_name, + blob_container={}, ) container_created = True role_definition_id = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/providers/Microsoft.Authorization/roleDefinitions/" + STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID ) await authorization_client.role_assignments.create( - scope=container_scope, role_assignment_name=role_assignment_name, - parameters={"properties": { - "roleDefinitionId": role_definition_id, - "principalId": target_msi_principal_id, - "principalType": "ServicePrincipal", - }}, + scope=container_scope, + role_assignment_name=role_assignment_name, + parameters={ + "properties": { + "roleDefinitionId": role_definition_id, + "principalId": target_msi_principal_id, + "principalType": "ServicePrincipal", + } + }, ) rbac_created = True jd = await self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, - job_definition={"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "jobType": "CloudToCloud", - "sourceSubpath": "/", - "targetSubpath": "/", - "description": "JobDefForJobRunTest", - }}, + job_definition={ + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "jobType": "CloudToCloud", + "sourceSubpath": "/", + "targetSubpath": "/", + "description": "JobDefForJobRunTest", + } + }, ) assert jd.name == jd_name assert jd.properties.source_name == source_endpoint @@ -242,19 +281,28 @@ async def test_job_definition_job_run(self, resource_group, **kwargs): assert jd.properties.copy_mode == "Additive" jd_get = await self.client.job_definitions.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert jd_get.id == jd.id - items = [j async for j in self.client.job_definitions.list( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - )] + items = [ + j + async for j in self.client.job_definitions.list( + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + ) + ] assert len(items) >= 1 assert jd_name in [j.name for j in items] start_result = await self.client.job_definitions.start_job( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert start_result.job_run_resource_id, "start_job did not return jobRunResourceId" @@ -264,27 +312,27 @@ async def test_job_definition_job_run(self, resource_group, **kwargs): final_status = None for _ in range(60): run = await self.client.job_runs.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_run_name=job_run_name, - ) - current_status = ( - getattr(run.properties, "status", None) if run.properties is not None else None + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_run_name=job_run_name, ) + current_status = getattr(run.properties, "status", None) if run.properties is not None else None if current_status in terminal_states: final_status = current_status break if self.is_live: await asyncio.sleep(30) - assert final_status is not None, ( - "Job run did not reach a terminal state within 30 min" - ) - assert final_status == "Succeeded", ( - "Expected job-run to Succeed with public bucket + target MSI RBAC, " - "got: " + str(final_status) - ) + assert final_status is not None, "Job run did not reach a terminal state within 30 min" + assert ( + final_status == "Succeeded" + ), "Expected job-run to Succeed with public bucket + target MSI RBAC, " "got: " + str(final_status) jd_poller = await self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) await jd_poller.result() @@ -293,14 +341,16 @@ async def test_job_definition_job_run(self, resource_group, **kwargs): if rbac_created: try: await authorization_client.role_assignments.delete( - scope=container_scope, role_assignment_name=role_assignment_name, + scope=container_scope, + role_assignment_name=role_assignment_name, ) except Exception: # noqa: BLE001 pass if container_created: try: await storage_client.blob_containers.delete( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, container_name=container_name, ) except Exception: # noqa: BLE001 @@ -326,31 +376,32 @@ async def test_create_with_weekly_schedule(self, resource_group, **kwargs): jd_name = "jobdef-sched-wk" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - end_date = variables.setdefault( - "schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with weekly schedule", - "dataIntegrityValidation": "SaveVerifyFileMD5", - "schedule": { - "frequency": "Weekly", - "isActive": True, - "executionTime": {"hour": 2}, - "startDate": start_date, - "endDate": end_date, - "daysOfWeek": ["Monday", "Wednesday", "Friday"], - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + end_date = variables.setdefault("schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with weekly schedule", + "dataIntegrityValidation": "SaveVerifyFileMD5", + "schedule": { + "frequency": "Weekly", + "isActive": True, + "executionTime": {"hour": 2}, + "startDate": start_date, + "endDate": end_date, + "daysOfWeek": ["Monday", "Wednesday", "Friday"], + }, + } + } jd = await self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.description == "Job definition with weekly schedule" @@ -360,13 +411,17 @@ async def test_create_with_weekly_schedule(self, resource_group, **kwargs): assert len(jd.properties.schedule.days_of_week) == 3 jd = await self.client.job_definitions.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert jd.properties.schedule.frequency == "Weekly" poller = await self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) await poller.result() @@ -386,31 +441,32 @@ async def test_create_with_daily_schedule_and_preserve_permissions(self, resourc jd_name = "jobdef-sched-daily" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - end_date = variables.setdefault( - "schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Mirror", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with daily schedule", - "dataIntegrityValidation": "None", - "preservePermissions": True, - "schedule": { - "frequency": "Daily", - "isActive": True, - "executionTime": {"hour": 0}, - "startDate": start_date, - "endDate": end_date, - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + end_date = variables.setdefault("schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Mirror", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with daily schedule", + "dataIntegrityValidation": "None", + "preservePermissions": True, + "schedule": { + "frequency": "Daily", + "isActive": True, + "executionTime": {"hour": 0}, + "startDate": start_date, + "endDate": end_date, + }, + } + } jd = await self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.copy_mode == "Mirror" @@ -418,7 +474,9 @@ async def test_create_with_daily_schedule_and_preserve_permissions(self, resourc assert jd.properties.schedule.is_active is True poller = await self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) await poller.result() @@ -438,32 +496,37 @@ async def test_create_with_onetime_schedule(self, resource_group, **kwargs): jd_name = "jobdef-sched-once" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with one-time schedule", - "schedule": { - "frequency": "Onetime", - "isActive": True, - "executionTime": {"hour": 10}, - "startDate": start_date, - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with one-time schedule", + "schedule": { + "frequency": "Onetime", + "isActive": True, + "executionTime": {"hour": 10}, + "startDate": start_date, + }, + } + } jd = await self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.schedule.frequency == "Onetime" assert jd.properties.schedule.is_active is True poller = await self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) await poller.result() @@ -513,26 +576,31 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) connection_created = False container_created = False rbac_created = False - container_scope = ( - STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name - ) + container_scope = STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name try: await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": WCUS_LOCATION}, ) await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) connection = await self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionForPrivateBucketJobRun", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionForPrivateBucketJobRun", + } + }, ) connection_created = True pe_resource_id = connection.properties.private_endpoint_resource_id @@ -541,7 +609,8 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) pe_connection_name = None for _ in range(10): async for pec in network_client.private_link_services.list_private_endpoint_connections( - resource_group_name=PLS_RESOURCE_GROUP, service_name=PLS_NAME, + resource_group_name=PLS_RESOURCE_GROUP, + service_name=PLS_NAME, ): pec_pe_id = (pec.private_endpoint.id if pec.private_endpoint else "") or "" if pec_pe_id.lower() == pe_resource_id.lower(): @@ -551,32 +620,37 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) break if self.is_live: await asyncio.sleep(15) - assert pe_connection_name, ( - "PE-connection for {} did not appear on PLS {} within 150s".format( - pe_resource_id, PLS_NAME, - ) + assert pe_connection_name, "PE-connection for {} did not appear on PLS {} within 150s".format( + pe_resource_id, + PLS_NAME, ) await network_client.private_link_services.update_private_endpoint_connection( - resource_group_name=PLS_RESOURCE_GROUP, service_name=PLS_NAME, + resource_group_name=PLS_RESOURCE_GROUP, + service_name=PLS_NAME, pe_connection_name=pe_connection_name, - parameters={"properties": { - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "approved by storage-mover SDK live test", - "actionsRequired": "None", - }, - }}, + parameters={ + "properties": { + "privateLinkServiceConnectionState": { + "status": "Approved", + "description": "approved by storage-mover SDK live test", + "actionsRequired": "None", + }, + } + }, ) approved = False for _ in range(10): conn_show = await self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, connection_name=connection_name, ) - if (conn_show.properties is not None - and getattr(conn_show.properties, "connection_status", None) == "Approved"): + if ( + conn_show.properties is not None + and getattr(conn_show.properties, "connection_status", None) == "Approved" + ): approved = True break if self.is_live: @@ -584,7 +658,9 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) assert approved, "Storage Mover Connection did not reach Approved within 300s" target = await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, endpoint={ "identity": {"type": "SystemAssigned"}, "properties": { @@ -595,60 +671,76 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) }, }, ) - assert target.identity is not None and target.identity.principal_id, ( - "Target blob endpoint did not get an auto-assigned MSI principalId" - ) + assert ( + target.identity is not None and target.identity.principal_id + ), "Target blob endpoint did not get an auto-assigned MSI principalId" target_msi_principal_id = target.identity.principal_id await storage_client.blob_containers.create( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, - container_name=container_name, blob_container={}, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, + container_name=container_name, + blob_container={}, ) container_created = True role_definition_id = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/providers/Microsoft.Authorization/roleDefinitions/" + STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID ) await authorization_client.role_assignments.create( - scope=container_scope, role_assignment_name=role_assignment_name, - parameters={"properties": { - "roleDefinitionId": role_definition_id, - "principalId": target_msi_principal_id, - "principalType": "ServicePrincipal", - }}, + scope=container_scope, + role_assignment_name=role_assignment_name, + parameters={ + "properties": { + "roleDefinitionId": role_definition_id, + "principalId": target_msi_principal_id, + "principalType": "ServicePrincipal", + } + }, ) rbac_created = True await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": PRIVATE_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "privateMccSourceForJobRunWait", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": PRIVATE_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "privateMccSourceForJobRunWait", + } + }, ) await self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, - job_definition={"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "jobType": "CloudToCloud", - "sourceSubpath": "/", - "targetSubpath": "/", - "connections": [connection.id], - "description": "JobDefForJobRunWaitTest", - }}, + job_definition={ + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "jobType": "CloudToCloud", + "sourceSubpath": "/", + "targetSubpath": "/", + "connections": [connection.id], + "description": "JobDefForJobRunWaitTest", + } + }, ) start_result = await self.client.job_definitions.start_job( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, ) assert start_result.job_run_resource_id, "start_job did not return jobRunResourceId" @@ -658,27 +750,27 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) final_status = None for _ in range(60): run = await self.client.job_runs.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=job_definition_name, job_run_name=job_run_name, - ) - current_status = ( - getattr(run.properties, "status", None) if run.properties is not None else None + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=job_definition_name, + job_run_name=job_run_name, ) + current_status = getattr(run.properties, "status", None) if run.properties is not None else None if current_status in terminal_states: final_status = current_status break if self.is_live: await asyncio.sleep(30) - assert final_status is not None, ( - "Job run did not reach a terminal state within 30 min" - ) - assert final_status == "Succeeded", ( - "Expected job-run to Succeed with approved connection + target MSI RBAC, " - "got: " + str(final_status) - ) + assert final_status is not None, "Job run did not reach a terminal state within 30 min" + assert ( + final_status == "Succeeded" + ), "Expected job-run to Succeed with approved connection + target MSI RBAC, " "got: " + str(final_status) jd_poller = await self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, ) await jd_poller.result() @@ -687,14 +779,16 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) if rbac_created: try: await authorization_client.role_assignments.delete( - scope=container_scope, role_assignment_name=role_assignment_name, + scope=container_scope, + role_assignment_name=role_assignment_name, ) except Exception: # noqa: BLE001 pass if container_created: try: await storage_client.blob_containers.delete( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, container_name=container_name, ) except Exception: # noqa: BLE001 @@ -702,7 +796,8 @@ async def test_start_c2c_job_with_private_source(self, resource_group, **kwargs) if connection_created: try: conn_del_poller = await self.client.connections.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, connection_name=connection_name, ) await conn_del_poller.result() diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_test.py index 0ac8c4eed0bd..76343d2a9a78 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_definitions_operations_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -13,6 +14,7 @@ private-bucket CloudToCloud E2E using the shared `test-pls-wcs` PLS, mirroring RP `Storage-XDataMove-RP/test/E2ETest/C2CTest/StartJobTest.cs::StartC2CJobWithPrivateSourceAsyncSuccessPathTest`. """ + import os import uuid from datetime import datetime, timedelta, timezone @@ -36,6 +38,7 @@ from azure.mgmt.storage import StorageManagementClient import azure.mgmt.network.aio # noqa: F401 (modernization signal) import azure.mgmt.storage.aio # noqa: F401 (modernization signal) + _CROSS_SUB_CLIENTS_MODERN = True except ImportError: AuthorizationManagementClient = None # type: ignore[assignment] @@ -70,38 +73,46 @@ # The subscription id is read from the environment for live runs and defaults to # the sanitized zero-GUID so the real subscription is never committed. SYNTHETICS_SUBSCRIPTION_ID = ( - os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") - or "00000000-0000-0000-0000-000000000000" + os.environ.get("STORAGEMOVER_SYNTHETICS_SUBSCRIPTION_ID") or "00000000-0000-0000-0000-000000000000" ) PLS_RESOURCE_GROUP = "E2E-Management-RGsyn" PLS_NAME = "test-pls-wcs" REAL_PRIVATE_LINK_SERVICE_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID - + "/resourceGroups/" + PLS_RESOURCE_GROUP - + "/providers/Microsoft.Network/privateLinkServices/" + PLS_NAME + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + + "/resourceGroups/" + + PLS_RESOURCE_GROUP + + "/providers/Microsoft.Network/privateLinkServices/" + + PLS_NAME ) STORAGE_ACCOUNT_RG = "CP_Mover_IN_WCUS" STORAGE_ACCOUNT_NAME = "cpmoveraccount" STORAGE_ACCOUNT_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID - + "/resourceGroups/" + STORAGE_ACCOUNT_RG - + "/providers/Microsoft.Storage/storageAccounts/" + STORAGE_ACCOUNT_NAME + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + + "/resourceGroups/" + + STORAGE_ACCOUNT_RG + + "/providers/Microsoft.Storage/storageAccounts/" + + STORAGE_ACCOUNT_NAME ) MULTI_CLOUD_CONNECTOR_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/E2E-Management-RGsyn" + "/providers/Microsoft.HybridConnectivity/publicCloudConnectors/e2e-sm-rp-connector" ) PRIVATE_S3_BUCKET_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/aws_640698235822" + "/providers/Microsoft.AWSConnector/s3Buckets/e2e-sm-rp-private-bucket" ) AWS_PUBLIC_S3_BUCKET_ID = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/resourceGroups/aws_640698235822" + "/providers/Microsoft.AWSConnector/s3Buckets/e2e-sm-rp-bucket" ) @@ -110,35 +121,47 @@ STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID = "ba92f5b4-2d11-453d-a403-e96b0029c9fe" +@pytest.mark.live_test_only class TestStorageMoverMgmtJobDefinitionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) def _provision_parents(self, rg, sm_name, project_name, source_endpoint, target_endpoint): self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "NfsMount", - "host": "10.0.0.1", - "export": "/", - "nfsVersion": "NFSv3", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "NfsMount", + "host": "10.0.0.1", + "export": "/", + "nfsVersion": "NFSv3", + } + }, ) self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, - "blobContainerName": "testcontainer", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, + "blobContainerName": "testcontainer", + } + }, ) # ----- JobDefinitionJobRunTests.JobDefinitionJobRunTest (matrix row #10) ----- @@ -175,47 +198,56 @@ def test_job_definition_job_run(self, resource_group, **kwargs): role_assignment_name = variables.setdefault("role_assignment_id", str(uuid.uuid4())) storage_client = self.create_client_from_credential( - StorageManagementClient, self.get_credential(StorageManagementClient), + StorageManagementClient, + self.get_credential(StorageManagementClient), subscription_id=SYNTHETICS_SUBSCRIPTION_ID, api_version="2025-06-01", ) authorization_client = self.create_client_from_credential( - AuthorizationManagementClient, self.get_credential(AuthorizationManagementClient), + AuthorizationManagementClient, + self.get_credential(AuthorizationManagementClient), subscription_id=SYNTHETICS_SUBSCRIPTION_ID, ) container_created = False rbac_created = False - container_scope = ( - STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name - ) + container_scope = STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name try: # Provision mover + project (WCUS — required by cpmoveraccount). self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": WCUS_LOCATION}, ) self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) # Source MCC endpoint over the PUBLIC AWS S3 bucket. self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": AWS_PUBLIC_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "publicMccSourceForJobRun", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": AWS_PUBLIC_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "publicMccSourceForJobRun", + } + }, ) # Target blob endpoint with explicit SystemAssigned MSI. target = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, endpoint={ "identity": {"type": "SystemAssigned"}, "properties": { @@ -226,47 +258,57 @@ def test_job_definition_job_run(self, resource_group, **kwargs): }, }, ) - assert target.identity is not None and target.identity.principal_id, ( - "Target blob endpoint did not get an auto-assigned MSI principalId" - ) + assert ( + target.identity is not None and target.identity.principal_id + ), "Target blob endpoint did not get an auto-assigned MSI principalId" target_msi_principal_id = target.identity.principal_id # Cross-sub: create target container. storage_client.blob_containers.create( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, - container_name=container_name, blob_container={}, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, + container_name=container_name, + blob_container={}, ) container_created = True # Cross-sub: grant target MSI Storage Blob Data Contributor on container scope. role_definition_id = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/providers/Microsoft.Authorization/roleDefinitions/" + STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID ) authorization_client.role_assignments.create( - scope=container_scope, role_assignment_name=role_assignment_name, - parameters={"properties": { - "roleDefinitionId": role_definition_id, - "principalId": target_msi_principal_id, - "principalType": "ServicePrincipal", - }}, + scope=container_scope, + role_assignment_name=role_assignment_name, + parameters={ + "properties": { + "roleDefinitionId": role_definition_id, + "principalId": target_msi_principal_id, + "principalType": "ServicePrincipal", + } + }, ) rbac_created = True # Create the job definition (C2C, no `connections` since no PLS). jd = self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, - job_definition={"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "jobType": "CloudToCloud", - "sourceSubpath": "/", - "targetSubpath": "/", - "description": "JobDefForJobRunTest", - }}, + job_definition={ + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "jobType": "CloudToCloud", + "sourceSubpath": "/", + "targetSubpath": "/", + "description": "JobDefForJobRunTest", + } + }, ) # CRUD assertions (mirrors .NET matrix #10 spec). assert jd.name == jd_name @@ -275,20 +317,28 @@ def test_job_definition_job_run(self, resource_group, **kwargs): assert jd.properties.copy_mode == "Additive" jd_get = self.client.job_definitions.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert jd_get.id == jd.id - items = list(self.client.job_definitions.list( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - )) + items = list( + self.client.job_definitions.list( + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + ) + ) assert len(items) >= 1 assert jd_name in [j.name for j in items] # Start the job. start_result = self.client.job_definitions.start_job( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert start_result.job_run_resource_id, "start_job did not return jobRunResourceId" @@ -299,26 +349,26 @@ def test_job_definition_job_run(self, resource_group, **kwargs): final_status = None for _ in range(60): run = self.client.job_runs.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_run_name=job_run_name, - ) - current_status = ( - getattr(run.properties, "status", None) if run.properties is not None else None + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_run_name=job_run_name, ) + current_status = getattr(run.properties, "status", None) if run.properties is not None else None if current_status in terminal_states: final_status = current_status break self.sleep(30) - assert final_status is not None, ( - "Job run did not reach a terminal state within 30 min" - ) - assert final_status == "Succeeded", ( - "Expected job-run to Succeed with public bucket + target MSI RBAC, " - "got: " + str(final_status) - ) + assert final_status is not None, "Job run did not reach a terminal state within 30 min" + assert ( + final_status == "Succeeded" + ), "Expected job-run to Succeed with public bucket + target MSI RBAC, " "got: " + str(final_status) self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ).result() @@ -326,14 +376,16 @@ def test_job_definition_job_run(self, resource_group, **kwargs): if rbac_created: try: authorization_client.role_assignments.delete( - scope=container_scope, role_assignment_name=role_assignment_name, + scope=container_scope, + role_assignment_name=role_assignment_name, ) except Exception: # noqa: BLE001 pass if container_created: try: storage_client.blob_containers.delete( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, container_name=container_name, ) except Exception: # noqa: BLE001 @@ -356,31 +408,32 @@ def test_create_with_weekly_schedule(self, resource_group, **kwargs): jd_name = "jobdef-sched-wk" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - end_date = variables.setdefault( - "schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with weekly schedule", - "dataIntegrityValidation": "SaveVerifyFileMD5", - "schedule": { - "frequency": "Weekly", - "isActive": True, - "executionTime": {"hour": 2}, - "startDate": start_date, - "endDate": end_date, - "daysOfWeek": ["Monday", "Wednesday", "Friday"], - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + end_date = variables.setdefault("schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with weekly schedule", + "dataIntegrityValidation": "SaveVerifyFileMD5", + "schedule": { + "frequency": "Weekly", + "isActive": True, + "executionTime": {"hour": 2}, + "startDate": start_date, + "endDate": end_date, + "daysOfWeek": ["Monday", "Wednesday", "Friday"], + }, + } + } jd = self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.source_name == source_endpoint @@ -395,13 +448,17 @@ def test_create_with_weekly_schedule(self, resource_group, **kwargs): assert len(jd.properties.schedule.days_of_week) == 3 jd = self.client.job_definitions.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ) assert jd.properties.schedule.frequency == "Weekly" self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ).result() @@ -422,31 +479,32 @@ def test_create_with_daily_schedule_and_preserve_permissions(self, resource_grou jd_name = "jobdef-sched-daily" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - end_date = variables.setdefault( - "schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Mirror", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with daily schedule", - "dataIntegrityValidation": "None", - "preservePermissions": True, - "schedule": { - "frequency": "Daily", - "isActive": True, - "executionTime": {"hour": 0}, - "startDate": start_date, - "endDate": end_date, - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + end_date = variables.setdefault("schedule_end", (now + timedelta(days=30)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Mirror", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with daily schedule", + "dataIntegrityValidation": "None", + "preservePermissions": True, + "schedule": { + "frequency": "Daily", + "isActive": True, + "executionTime": {"hour": 0}, + "startDate": start_date, + "endDate": end_date, + }, + } + } jd = self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.copy_mode == "Mirror" @@ -455,7 +513,9 @@ def test_create_with_daily_schedule_and_preserve_permissions(self, resource_grou assert jd.properties.schedule.is_active is True self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ).result() @@ -476,25 +536,28 @@ def test_create_with_onetime_schedule(self, resource_group, **kwargs): jd_name = "jobdef-sched-once" variables = kwargs.pop("variables", {}) now = datetime.now(timezone.utc) - start_date = variables.setdefault( - "schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ") - ) - body = {"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "description": "Job definition with one-time schedule", - "schedule": { - "frequency": "Onetime", - "isActive": True, - "executionTime": {"hour": 10}, - "startDate": start_date, - }, - }} + start_date = variables.setdefault("schedule_start", (now + timedelta(days=1)).strftime("%Y-%m-%dT%H:%M:%SZ")) + body = { + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "description": "Job definition with one-time schedule", + "schedule": { + "frequency": "Onetime", + "isActive": True, + "executionTime": {"hour": 10}, + "startDate": start_date, + }, + } + } jd = self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=jd_name, job_definition=body, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=jd_name, + job_definition=body, ) assert jd.name == jd_name assert jd.properties.schedule is not None @@ -502,7 +565,9 @@ def test_create_with_onetime_schedule(self, resource_group, **kwargs): assert jd.properties.schedule.is_active is True self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=jd_name, ).result() @@ -567,29 +632,34 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): connection_created = False container_created = False rbac_created = False - container_scope = ( - STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name - ) + container_scope = STORAGE_ACCOUNT_ID + "/blobServices/default/containers/" + container_name try: # 1. Self-provision storage mover + project. self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": WCUS_LOCATION}, ) self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) # 2. Create the Storage Mover Connection. The RP synchronously provisions # a private endpoint on the PLS in Pending state and returns its id. connection = self.client.connections.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, connection_name=connection_name, - connection={"properties": { - "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, - "description": "ConnectionForPrivateBucketJobRun", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + connection_name=connection_name, + connection={ + "properties": { + "privateLinkServiceId": REAL_PRIVATE_LINK_SERVICE_ID, + "description": "ConnectionForPrivateBucketJobRun", + } + }, ) connection_created = True pe_resource_id = connection.properties.private_endpoint_resource_id @@ -600,7 +670,8 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): pe_connection_name = None for _ in range(10): for pec in network_client.private_link_services.list_private_endpoint_connections( - resource_group_name=PLS_RESOURCE_GROUP, service_name=PLS_NAME, + resource_group_name=PLS_RESOURCE_GROUP, + service_name=PLS_NAME, ): pec_pe_id = (pec.private_endpoint.id if pec.private_endpoint else "") or "" if pec_pe_id.lower() == pe_resource_id.lower(): @@ -609,22 +680,24 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): if pe_connection_name: break self.sleep(15) - assert pe_connection_name, ( - "PE-connection for {} did not appear on PLS {} within 150s".format( - pe_resource_id, PLS_NAME, - ) + assert pe_connection_name, "PE-connection for {} did not appear on PLS {} within 150s".format( + pe_resource_id, + PLS_NAME, ) network_client.private_link_services.update_private_endpoint_connection( - resource_group_name=PLS_RESOURCE_GROUP, service_name=PLS_NAME, + resource_group_name=PLS_RESOURCE_GROUP, + service_name=PLS_NAME, pe_connection_name=pe_connection_name, - parameters={"properties": { - "privateLinkServiceConnectionState": { - "status": "Approved", - "description": "approved by storage-mover SDK live test", - "actionsRequired": "None", - }, - }}, + parameters={ + "properties": { + "privateLinkServiceConnectionState": { + "status": "Approved", + "description": "approved by storage-mover SDK live test", + "actionsRequired": "None", + }, + } + }, ) # 4. Poll Storage Mover Connection until connection_status == Approved. @@ -632,11 +705,14 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): approved = False for _ in range(10): conn_show = self.client.connections.get( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, connection_name=connection_name, ) - if (conn_show.properties is not None - and getattr(conn_show.properties, "connection_status", None) == "Approved"): + if ( + conn_show.properties is not None + and getattr(conn_show.properties, "connection_status", None) == "Approved" + ): approved = True break self.sleep(30) @@ -647,7 +723,9 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): # (which auto-injects identity), the raw SDK PUT does not set identity # by default. Capture principalId so we can grant data-plane RBAC. target = self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=target_endpoint, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=target_endpoint, endpoint={ "identity": {"type": "SystemAssigned"}, "properties": { @@ -658,66 +736,82 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): }, }, ) - assert target.identity is not None and target.identity.principal_id, ( - "Target blob endpoint did not get an auto-assigned MSI principalId" - ) + assert ( + target.identity is not None and target.identity.principal_id + ), "Target blob endpoint did not get an auto-assigned MSI principalId" target_msi_principal_id = target.identity.principal_id # 6. Cross-sub: create the target blob container under cpmoveraccount. storage_client.blob_containers.create( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, - container_name=container_name, blob_container={}, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, + container_name=container_name, + blob_container={}, ) container_created = True # 7. Cross-sub: grant the endpoint MSI Storage Blob Data Contributor on # the container scope. role_definition_id = ( - "/subscriptions/" + SYNTHETICS_SUBSCRIPTION_ID + "/subscriptions/" + + SYNTHETICS_SUBSCRIPTION_ID + "/providers/Microsoft.Authorization/roleDefinitions/" + STORAGE_BLOB_DATA_CONTRIBUTOR_ROLE_DEF_GUID ) authorization_client.role_assignments.create( - scope=container_scope, role_assignment_name=role_assignment_name, - parameters={"properties": { - "roleDefinitionId": role_definition_id, - "principalId": target_msi_principal_id, - "principalType": "ServicePrincipal", - }}, + scope=container_scope, + role_assignment_name=role_assignment_name, + parameters={ + "properties": { + "roleDefinitionId": role_definition_id, + "principalId": target_msi_principal_id, + "principalType": "ServicePrincipal", + } + }, ) rbac_created = True # 8. Source MCC endpoint over the PRIVATE AWS S3 bucket. self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=source_endpoint, - endpoint={"properties": { - "endpointType": "AzureMultiCloudConnector", - "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, - "awsS3BucketId": PRIVATE_S3_BUCKET_ID, - "endpointKind": "Source", - "description": "privateMccSourceForJobRunWait", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=source_endpoint, + endpoint={ + "properties": { + "endpointType": "AzureMultiCloudConnector", + "multiCloudConnectorId": MULTI_CLOUD_CONNECTOR_ID, + "awsS3BucketId": PRIVATE_S3_BUCKET_ID, + "endpointKind": "Source", + "description": "privateMccSourceForJobRunWait", + } + }, ) # 9. C2C job definition wired to the approved connection. self.client.job_definitions.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, - job_definition={"properties": { - "copyMode": "Additive", - "sourceName": source_endpoint, - "targetName": target_endpoint, - "jobType": "CloudToCloud", - "sourceSubpath": "/", - "targetSubpath": "/", - "connections": [connection.id], - "description": "JobDefForJobRunWaitTest", - }}, + job_definition={ + "properties": { + "copyMode": "Additive", + "sourceName": source_endpoint, + "targetName": target_endpoint, + "jobType": "CloudToCloud", + "sourceSubpath": "/", + "targetSubpath": "/", + "connections": [connection.id], + "description": "JobDefForJobRunWaitTest", + } + }, ) # 10. Start the job. The RP returns the job-run resource id; extract basename. start_result = self.client.job_definitions.start_job( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, ) assert start_result.job_run_resource_id, "start_job did not return jobRunResourceId" @@ -728,27 +822,27 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): final_status = None for _ in range(60): run = self.client.job_runs.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - job_definition_name=job_definition_name, job_run_name=job_run_name, - ) - current_status = ( - getattr(run.properties, "status", None) if run.properties is not None else None + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + job_definition_name=job_definition_name, + job_run_name=job_run_name, ) + current_status = getattr(run.properties, "status", None) if run.properties is not None else None if current_status in terminal_states: final_status = current_status break self.sleep(30) - assert final_status is not None, ( - "Job run did not reach a terminal state within 30 min" - ) - assert final_status == "Succeeded", ( - "Expected job-run to Succeed with approved connection + target MSI RBAC, " - "got: " + str(final_status) - ) + assert final_status is not None, "Job run did not reach a terminal state within 30 min" + assert ( + final_status == "Succeeded" + ), "Expected job-run to Succeed with approved connection + target MSI RBAC, " "got: " + str(final_status) # Cleanup the job definition (other resources rolled back in finally). self.client.job_definitions.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, job_definition_name=job_definition_name, ).result() @@ -759,14 +853,16 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): if rbac_created: try: authorization_client.role_assignments.delete( - scope=container_scope, role_assignment_name=role_assignment_name, + scope=container_scope, + role_assignment_name=role_assignment_name, ) except Exception: # noqa: BLE001 pass if container_created: try: storage_client.blob_containers.delete( - resource_group_name=STORAGE_ACCOUNT_RG, account_name=STORAGE_ACCOUNT_NAME, + resource_group_name=STORAGE_ACCOUNT_RG, + account_name=STORAGE_ACCOUNT_NAME, container_name=container_name, ) except Exception: # noqa: BLE001 @@ -774,7 +870,8 @@ def test_start_c2c_job_with_private_source(self, resource_group, **kwargs): if connection_created: try: self.client.connections.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, connection_name=connection_name, ).result() except Exception: # noqa: BLE001 diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_async_test.py index 825f57178fec..71d588e48b16 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_async_test.py @@ -23,6 +23,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtJobRunsOperationsAsync(AzureMgmtRecordedTestCase): """Read-only coverage for job_runs (list + get). diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_test.py index 183d9df2013e..50c12c99a2cd 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_job_runs_operations_test.py @@ -22,6 +22,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtJobRunsOperations(AzureMgmtRecordedTestCase): """Read-only coverage for job_runs (list + get). diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_async_test.py index ca0f6ac6652d..a3825fee072b 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_async_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET ProjectCollectionTests + ProjectResourceTests at: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario """ + import pytest from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.storagemover.aio import StorageMoverMgmtClient @@ -18,13 +20,15 @@ AZURE_LOCATION = "eastus" +@pytest.mark.live_test_only class TestStorageMoverMgmtProjectsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) async def _create_storage_mover(self, rg, sm_name): return await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) @@ -37,7 +41,9 @@ async def test_create_get_exists(self, resource_group): project_name = "project-col1" project = await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) assert project.name == project_name @@ -45,20 +51,28 @@ async def test_create_get_exists(self, resource_group): assert project.type.lower() == "microsoft.storagemover/storagemovers/projects" project = await self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert project.name == project_name - items = [p async for p in self.client.projects.list( - resource_group_name=rg, storage_mover_name=sm_name, - )] + items = [ + p + async for p in self.client.projects.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ] assert len(items) >= 1 names = [p.name for p in items] assert project_name in names with pytest.raises(ResourceNotFoundError): await self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name + "111", + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name + "111", ) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @@ -70,27 +84,37 @@ async def test_get_update_delete(self, resource_group): project_name = "project-res1" created = await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) fetched = await self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert fetched.name == created.name assert fetched.id == created.id updated = await self.client.projects.update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={"properties": {"description": "This is an updated project"}}, ) assert updated.properties.description == "This is an updated project" poller = await self.client.projects.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) await poller.result() with pytest.raises(ResourceNotFoundError): await self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_test.py index 5951575214e3..81e3d7117f2c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_projects_operations_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET ProjectCollectionTests + ProjectResourceTests at: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario """ + import pytest from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.storagemover import StorageMoverMgmtClient @@ -17,13 +19,15 @@ AZURE_LOCATION = "eastus" +@pytest.mark.live_test_only class TestStorageMoverMgmtProjectsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) def _create_storage_mover(self, rg, sm_name): return self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) @@ -38,7 +42,9 @@ def test_create_get_exists(self, resource_group): project_name = "project-col1" project = self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) assert project.name == project_name @@ -46,25 +52,37 @@ def test_create_get_exists(self, resource_group): assert project.type.lower() == "microsoft.storagemover/storagemovers/projects" project = self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert project.name == project_name assert project.properties.description is None - items = list(self.client.projects.list( - resource_group_name=rg, storage_mover_name=sm_name, - )) + items = list( + self.client.projects.list( + resource_group_name=rg, + storage_mover_name=sm_name, + ) + ) assert len(items) >= 1 names = [p.name for p in items] assert project_name in names # Existence via get - assert self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, - ).name == project_name + assert ( + self.client.projects.get( + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, + ).name + == project_name + ) with pytest.raises(ResourceNotFoundError): self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name + "111", + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name + "111", ) # ----- ProjectResourceTests.GetUpdateDeleteTest ----- @@ -78,27 +96,37 @@ def test_get_update_delete(self, resource_group): project_name = "project-res1" created = self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) fetched = self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert fetched.name == created.name assert fetched.properties.description == created.properties.description assert fetched.id == created.id updated = self.client.projects.update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={"properties": {"description": "This is an updated project"}}, ) assert updated.properties.description == "This is an updated project" self.client.projects.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_async_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_async_test.py index 32afee96e60c..495961da0a5c 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_async_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_async_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET StorageMoverCollectionTests + StorageMoverResourceTests at: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario """ + import pytest from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.storagemover.aio import StorageMoverMgmtClient @@ -23,6 +25,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtStorageMoversOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient, is_async=True) @@ -75,7 +78,8 @@ async def test_get_storage_mover(self, resource_group): sm_name = "testsm-get1" created = await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION, "tags": {"k": "v"}}, ) @@ -101,20 +105,27 @@ async def test_get_storage_mover_endpoint(self, resource_group): endpoint_name = "testblobendpoint" await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) await self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, - "blobContainerName": "testcontainer", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, + "blobContainerName": "testcontainer", + } + }, ) endpoint = await self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureStorageBlobContainer" @@ -127,16 +138,21 @@ async def test_get_storage_mover_project(self, resource_group): project_name = "testproj1" await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) await self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) project = await self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert project.name == project_name @@ -147,40 +163,46 @@ async def test_update_add_set_remove_tag_delete(self, resource_group): sm_name = "testsm-updel" sm = await self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) assert sm.name == sm_name assert sm.location == AZURE_LOCATION sm = await self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"properties": {"description": "This is an updated storage mover"}}, ) assert sm.properties.description == "This is an updated storage mover" # Subscription policies may inject extra tags, so only assert on the tag we set. sm = await self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag1": "val1"}}, ) assert sm.tags.get("tag1") == "val1" sm = await self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag2": "val2", "tag3": "val3"}}, ) assert sm.tags.get("tag2") == "val2" assert sm.tags.get("tag3") == "val3" sm = await self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag3": "val3"}}, ) assert sm.tags.get("tag3") == "val3" poller = await self.client.storage_movers.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, ) await poller.result() with pytest.raises(ResourceNotFoundError): diff --git a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_test.py b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_test.py index c1b6865a86e8..8657892b1daf 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_test.py +++ b/sdk/storagemover/azure-mgmt-storagemover/tests/test_storage_mover_mgmt_storage_movers_operations_test.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ Mirrors .NET StorageMoverCollectionTests + StorageMoverResourceTests at: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storagemover/Azure.ResourceManager.StorageMover/tests/Scenario """ + import pytest from azure.core.exceptions import ResourceNotFoundError from azure.mgmt.storagemover import StorageMoverMgmtClient @@ -22,6 +24,7 @@ ) +@pytest.mark.live_test_only class TestStorageMoverMgmtStorageMoversOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(StorageMoverMgmtClient) @@ -112,20 +115,27 @@ def test_get_storage_mover_endpoint(self, resource_group): endpoint_name = "testblobendpoint" self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) self.client.endpoints.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, - endpoint={"properties": { - "endpointType": "AzureStorageBlobContainer", - "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, - "blobContainerName": "testcontainer", - }}, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, + endpoint={ + "properties": { + "endpointType": "AzureStorageBlobContainer", + "storageAccountResourceId": FAKE_STORAGE_ACCOUNT_ID, + "blobContainerName": "testcontainer", + } + }, ) endpoint = self.client.endpoints.get( - resource_group_name=rg, storage_mover_name=sm_name, endpoint_name=endpoint_name, + resource_group_name=rg, + storage_mover_name=sm_name, + endpoint_name=endpoint_name, ) assert endpoint.name == endpoint_name assert endpoint.properties.endpoint_type == "AzureStorageBlobContainer" @@ -140,16 +150,21 @@ def test_get_storage_mover_project(self, resource_group): project_name = "testproj1" self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) self.client.projects.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, project={}, ) project = self.client.projects.get( - resource_group_name=rg, storage_mover_name=sm_name, project_name=project_name, + resource_group_name=rg, + storage_mover_name=sm_name, + project_name=project_name, ) assert project.name == project_name @@ -162,7 +177,8 @@ def test_update_add_set_remove_tag_delete(self, resource_group): sm_name = "testsm-updel" sm = self.client.storage_movers.create_or_update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"location": AZURE_LOCATION}, ) assert sm.name == sm_name @@ -170,7 +186,8 @@ def test_update_add_set_remove_tag_delete(self, resource_group): # Update description via PATCH sm = self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"properties": {"description": "This is an updated storage mover"}}, ) assert sm.properties.description == "This is an updated storage mover" @@ -178,14 +195,16 @@ def test_update_add_set_remove_tag_delete(self, resource_group): # Add a single tag (mirrors AddTagAsync) — Python SDK has no AddTag helper, so use update. # Subscription policies may inject extra tags, so only assert on the tag we set. sm = self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag1": "val1"}}, ) assert sm.tags.get("tag1") == "val1" # Set tags (mirrors SetTagsAsync — PATCH with a new tag map). sm = self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag2": "val2", "tag3": "val3"}}, ) assert sm.tags.get("tag2") == "val2" @@ -193,14 +212,16 @@ def test_update_add_set_remove_tag_delete(self, resource_group): # Remove a tag (mirrors RemoveTagAsync) — verify tag3 is still present. sm = self.client.storage_movers.update( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, storage_mover={"tags": {"tag3": "val3"}}, ) assert sm.tags.get("tag3") == "val3" # Delete and confirm 404 self.client.storage_movers.begin_delete( - resource_group_name=rg, storage_mover_name=sm_name, + resource_group_name=rg, + storage_mover_name=sm_name, ).result() with pytest.raises(ResourceNotFoundError): self.client.storage_movers.get(resource_group_name=rg, storage_mover_name=sm_name) diff --git a/sdk/storagemover/azure-mgmt-storagemover/tsp-location.yaml b/sdk/storagemover/azure-mgmt-storagemover/tsp-location.yaml index 4337c5d8b5aa..9cd4f0d0b90f 100644 --- a/sdk/storagemover/azure-mgmt-storagemover/tsp-location.yaml +++ b/sdk/storagemover/azure-mgmt-storagemover/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/storagemover/StorageMover.Management -commit: 55fc3e7d12df68485d19b10847f24c95579a06f4 +directory: specification/storagemover/resource-manager/Microsoft.StorageMover/StorageMover +commit: f89d3d95044e14c679785fa9e0d28c7c97af870a repo: Azure/azure-rest-api-specs additionalDirectories: