Skip to content

notify_application_state async

notify_application_state(
    application_id: ApplicationId,
    status: ApplicationStatus,
    *,
    config_overrides: Optional[AsyncMigrationHubClientConfig] = None,
    update_date_time: Optional[UpdateDateTime] = None,
    dry_run: Optional[DryRun] = None,
) -> NotifyApplicationStateResult

Sets the migration state of an application. For a given application identified by the value passed to ApplicationId, its status is set or updated by passing one of three values to Status: NOT_STARTED | IN_PROGRESS | COMPLETED.

Parameters:

  • application_id (ApplicationId) –

    The configurationId in Application Discovery Service that uniquely identifies the grouped application.

  • status (ApplicationStatus) –

    Status of the application - Not Started, In-Progress, Complete.

  • update_date_time (Optional[UpdateDateTime], default: None ) –

    The timestamp when the application state changed.

  • dry_run (Optional[DryRun], default: None ) –

    Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • DryRunOperation –

    Exception raised to indicate a successfully authorized action when the DryRun flag is set to "true".

  • HomeRegionNotSetException –

    The home region is not set. Set the home region to continue.

  • InternalServerError –

    Exception raised when an internal, configuration, or dependency error is encountered.

  • InvalidInputException –

    Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

  • PolicyErrorException –

    Exception raised when there are problems accessing Application Discovery Service (Application Discovery Service); most likely due to a misconfigured policy or the migrationhub-discovery role is missing or not configured correctly.

  • ResourceNotFoundException –

    Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.

  • ServiceUnavailableException –

    Exception raised when there is an internal, configuration, or dependency error encountered.

  • ThrottlingException –

    The request was denied due to request throttling.

  • UnauthorizedOperation –

    Exception raised to indicate a request was not authorized when the DryRun flag is set to "true".

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_migration_hub/_services/async_migration_hub.py
async def notify_application_state(
    self,
    application_id: "capo_migration_hub.types.application_id.ApplicationId",
    status: "capo_migration_hub.types.application_status.ApplicationStatus",
    *,
    config_overrides: Optional[AsyncMigrationHubClientConfig] = None,
    update_date_time: Optional[
        "capo_migration_hub.types.update_date_time.UpdateDateTime"
    ] = None,
    dry_run: Optional["capo_migration_hub.types.dry_run.DryRun"] = None,
) -> "capo_migration_hub.types.notify_application_state_result.NotifyApplicationStateResult":
    """<p>Sets the migration state of an application. For a given application identified by the value passed to <code>ApplicationId</code>, its status is set or updated by passing one of three values to <code>Status</code>: <code>NOT_STARTED | IN_PROGRESS | COMPLETED</code>.</p>

    Args:
        application_id: <p>The configurationId in Application Discovery Service that uniquely identifies the grouped application.</p>
        status: <p>Status of the application - Not Started, In-Progress, Complete.</p>
        update_date_time: <p>The timestamp when the application state changed.</p>
        dry_run: <p>Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.</p>

    Raises:
        capo_migration_hub.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_migration_hub.errors.dry_run_operation.DryRunOperation: <p>Exception raised to indicate a successfully authorized action when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.home_region_not_set_exception.HomeRegionNotSetException: <p>The home region is not set. Set the home region to continue.</p>
        capo_migration_hub.errors.internal_server_error.InternalServerError: <p>Exception raised when an internal, configuration, or dependency error is encountered.</p>
        capo_migration_hub.errors.invalid_input_exception.InvalidInputException: <p>Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.</p>
        capo_migration_hub.errors.policy_error_exception.PolicyErrorException: <p>Exception raised when there are problems accessing Application Discovery Service (Application Discovery Service); most likely due to a misconfigured policy or the <code>migrationhub-discovery</code> role is missing or not configured correctly.</p>
        capo_migration_hub.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.</p>
        capo_migration_hub.errors.service_unavailable_exception.ServiceUnavailableException: <p>Exception raised when there is an internal, configuration, or dependency error encountered.</p>
        capo_migration_hub.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_migration_hub.errors.unauthorized_operation.UnauthorizedOperation: <p>Exception raised to indicate a request was not authorized when the <code>DryRun</code> flag is set to "true".</p>
        capo_migration_hub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migration_hub.types.notify_application_state_request.NotifyApplicationStateRequest]",
    ) -> AsyncOperationResponse[
        "capo_migration_hub.types.notify_application_state_result.NotifyApplicationStateResult"
    ]:
        import capo_migration_hub._operations.aws_migration_hub.notify_application_state

        (
            output,
            http_response,
        ) = await capo_migration_hub._operations.aws_migration_hub.notify_application_state.async_notify_application_state(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("NotifyApplicationState")
    )
    input_: capo_migration_hub.types.notify_application_state_request.NotifyApplicationStateRequest = {
        "application_id": application_id,
        "status": status,
    }
    if update_date_time is not None:
        input_["update_date_time"] = update_date_time
    if dry_run is not None:
        input_["dry_run"] = dry_run

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