Skip to content

list_network_migration_definitions

list_network_migration_definitions(
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    filters: Optional[ListNetworkMigrationDefinitionsRequestFilters] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResultsType] = None,
) -> ListNetworkMigrationDefinitionsResponse

Lists all network migration definitions in the account, with optional filtering.

Parameters:

Raises:

Examples:

Sample ListNetworkMigrationDefinitions call

>>> client.list_network_migration_definitions(filters={'networkMigrationDefinitionIDs': ['nmd-01234567891234567']})
Source code in docs_src/capo_mgn/_services/mgn.py
def list_network_migration_definitions(
    self,
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    filters: Optional[
        "capo_mgn.types.list_network_migration_definitions_request_filters.ListNetworkMigrationDefinitionsRequestFilters"
    ] = None,
    next_token: Optional["capo_mgn.types.pagination_token.PaginationToken"] = None,
    max_results: Optional["capo_mgn.types.max_results_type.MaxResultsType"] = None,
) -> "capo_mgn.types.list_network_migration_definitions_response.ListNetworkMigrationDefinitionsResponse":
    """<p>Lists all network migration definitions in the account, with optional filtering.</p>

    Args:
        filters: <p>Filters to apply when listing network migration definitions.</p>
        next_token: <p>The token for the next page of results.</p>
        max_results: <p>The maximum number of results to return in a single call.</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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample ListNetworkMigrationDefinitions call

        >>> client.list_network_migration_definitions(filters={'networkMigrationDefinitionIDs': ['nmd-01234567891234567']})
    """

    def _handler(
        req: "OperationRequest[capo_mgn.types.list_network_migration_definitions_request.ListNetworkMigrationDefinitionsRequest]",
    ) -> OperationResponse[
        "capo_mgn.types.list_network_migration_definitions_response.ListNetworkMigrationDefinitionsResponse"
    ]:
        import capo_mgn._operations.application_migration_service.list_network_migration_definitions

        output, http_response = (
            capo_mgn._operations.application_migration_service.list_network_migration_definitions.list_network_migration_definitions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_mgn.types.list_network_migration_definitions_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListNetworkMigrationDefinitions", redact_output=_redact_output
        ),
    )
    input_: capo_mgn.types.list_network_migration_definitions_request.ListNetworkMigrationDefinitionsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output