Skip to content

get_network_migration_definition async

get_network_migration_definition(
    network_migration_definition_id: NetworkMigrationDefinitionID,
    *,
    config_overrides: Optional[AsyncmgnClientConfig] = None,
) -> NetworkMigrationDefinition

Retrieves the details of a network migration definition including source and target configurations.

Parameters:

Raises:

Examples:

Sample GetNetworkMigrationDefinition call

>>> await client.get_network_migration_definition(network_migration_definition_id='nmd-01234567891234567')
Source code in docs_src/capo_mgn/_services/async_mgn.py
async def get_network_migration_definition(
    self,
    network_migration_definition_id: "capo_mgn.types.network_migration_definition_id.NetworkMigrationDefinitionID",
    *,
    config_overrides: Optional[AsyncmgnClientConfig] = None,
) -> "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition":
    """<p>Retrieves the details of a network migration definition including source and target configurations.</p>

    Args:
        network_migration_definition_id: <p>The unique identifier of the network migration definition to retrieve.</p>

    Raises:
        capo_mgn.errors.access_denied_exception.AccessDeniedException: <p>Operation denied due to a file permission or access check error.</p>
        capo_mgn.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found exception.</p>
        capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample GetNetworkMigrationDefinition call

        >>> await client.get_network_migration_definition(network_migration_definition_id='nmd-01234567891234567')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mgn.types.get_network_migration_definition_request.GetNetworkMigrationDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition"
    ]:
        import capo_mgn._operations.application_migration_service.get_network_migration_definition

        (
            output,
            http_response,
        ) = await capo_mgn._operations.application_migration_service.get_network_migration_definition.async_get_network_migration_definition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition",
    ) -> dict[str, Any]:
        import capo_mgn.types.network_migration_definition

        return capo_mgn.types.network_migration_definition.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetNetworkMigrationDefinition", redact_output=_redact_output
        ),
    )
    input_: capo_mgn.types.get_network_migration_definition_request.GetNetworkMigrationDefinitionRequest = {
        "network_migration_definition_id": network_migration_definition_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output