Skip to content

update_table_migration

update_table_migration(
    requested_state: MigrationRequestedState,
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
    table_arn: Optional[TableARN] = None,
    migration_id: Optional[MigrationId] = None,
    update_description: Optional[str] = None,
) -> UpdateTableMigrationResponse

Requests a state change for a migration. Identify the migration by its migrationId or by the tableARN of its destination table.

Set requestedState to queued to continue a migration in the pendingReview state. The migration then moves to queued or migrating. Set it to cancelled to cancel a migration that's new, planning, pendingReview, queued, or migrating. A migration in the new state moves directly to cancelled. From the other states, the migration moves to cancelling and finishes the work in progress. It then ends in the cancelled state, or in the failed state if any objects failed to migrate. Data that the migration already committed stays in the destination table.

If you request queued for a migration that's already queued or migrating, the request fails with a ConflictException. From any other state except pendingReview, it fails with a BadRequestException.

Permissions
  • You must have the s3tables:UpdateTableMigration permission to use this operation.

Parameters:

  • table_arn (Optional[TableARN], default: None ) –

    The Amazon Resource Name (ARN) of the destination table. Updates the table's most recent migration. Until the migration creates the destination table, specify migrationId. Specify either tableARN or migrationId, not both.

  • migration_id (Optional[MigrationId], default: None ) –

    The ID of the migration to update. Specify either migrationId or tableARN, not both.

  • requested_state (MigrationRequestedState) –

    The state to move the migration to: queued to continue a migration in the pendingReview state, or cancelled to cancel a migration in the new, planning, pendingReview, queued, or migrating state.

  • update_description (Optional[str], default: None ) –

    A description of the update, up to 1,024 characters, with no control characters. GetTableMigration doesn't return it.

Raises:

  • AccessDeniedException –

    The action cannot be performed because you do not have the required permission.

  • BadRequestException –

    The request is invalid or malformed.

  • ConflictException –

    The request conflicts with the resource's current state, such as a previous write, an existing table, or a migration that's in progress or already in the requested state. If the conflict is with a concurrent write, you can retry the request.

  • ForbiddenException –

    The caller isn't authorized to make the request.

  • InternalServerErrorException –

    The request failed due to an internal server error.

  • NotFoundException –

    The request was rejected because the specified resource could not be found.

  • TooManyRequestsException –

    The limit on the number of requests per second was exceeded.

  • UnknownServiceError –

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

Source code in docs_src/capo_s3tables/_services/s3_tables.py
def update_table_migration(
    self,
    requested_state: "capo_s3tables.types.migration_requested_state.MigrationRequestedState",
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
    table_arn: Optional["capo_s3tables.types.table_arn.TableARN"] = None,
    migration_id: Optional["capo_s3tables.types.migration_id.MigrationId"] = None,
    update_description: Optional[str] = None,
) -> "capo_s3tables.types.update_table_migration_response.UpdateTableMigrationResponse":
    """<p>Requests a state change for a migration. Identify the migration by its <code>migrationId</code> or by the <code>tableARN</code> of its destination table.</p> <p>Set <code>requestedState</code> to <code>queued</code> to continue a migration in the <code>pendingReview</code> state. The migration then moves to <code>queued</code> or <code>migrating</code>. Set it to <code>cancelled</code> to cancel a migration that's <code>new</code>, <code>planning</code>, <code>pendingReview</code>, <code>queued</code>, or <code>migrating</code>. A migration in the <code>new</code> state moves directly to <code>cancelled</code>. From the other states, the migration moves to <code>cancelling</code> and finishes the work in progress. It then ends in the <code>cancelled</code> state, or in the <code>failed</code> state if any objects failed to migrate. Data that the migration already committed stays in the destination table.</p> <p>If you request <code>queued</code> for a migration that's already <code>queued</code> or <code>migrating</code>, the request fails with a <code>ConflictException</code>. From any other state except <code>pendingReview</code>, it fails with a <code>BadRequestException</code>.</p> <dl> <dt>Permissions</dt> <dd> <ul> <li> <p>You must have the <code>s3tables:UpdateTableMigration</code> permission to use this operation.</p> </li> </ul> </dd> </dl>

    Args:
        table_arn: <p>The Amazon Resource Name (ARN) of the destination table. Updates the table's most recent migration. Until the migration creates the destination table, specify <code>migrationId</code>. Specify either <code>tableARN</code> or <code>migrationId</code>, not both.</p>
        migration_id: <p>The ID of the migration to update. Specify either <code>migrationId</code> or <code>tableARN</code>, not both.</p>
        requested_state: <p>The state to move the migration to: <code>queued</code> to continue a migration in the <code>pendingReview</code> state, or <code>cancelled</code> to cancel a migration in the <code>new</code>, <code>planning</code>, <code>pendingReview</code>, <code>queued</code>, or <code>migrating</code> state.</p>
        update_description: <p>A description of the update, up to 1,024 characters, with no control characters. <code>GetTableMigration</code> doesn't return it.</p>

    Raises:
        capo_s3tables.errors.access_denied_exception.AccessDeniedException: <p>The action cannot be performed because you do not have the required permission.</p>
        capo_s3tables.errors.bad_request_exception.BadRequestException: <p>The request is invalid or malformed.</p>
        capo_s3tables.errors.conflict_exception.ConflictException: <p>The request conflicts with the resource's current state, such as a previous write, an existing table, or a migration that's in progress or already in the requested state. If the conflict is with a concurrent write, you can retry the request.</p>
        capo_s3tables.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
        capo_s3tables.errors.internal_server_error_exception.InternalServerErrorException: <p>The request failed due to an internal server error.</p>
        capo_s3tables.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource could not be found.</p>
        capo_s3tables.errors.too_many_requests_exception.TooManyRequestsException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_s3tables.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3tables.types.update_table_migration_request.UpdateTableMigrationRequest]",
    ) -> OperationResponse[
        "capo_s3tables.types.update_table_migration_response.UpdateTableMigrationResponse"
    ]:
        import capo_s3tables._operations.s3_table_buckets.update_table_migration

        output, http_response = (
            capo_s3tables._operations.s3_table_buckets.update_table_migration.update_table_migration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTableMigration")
    )
    input_: capo_s3tables.types.update_table_migration_request.UpdateTableMigrationRequest = {
        "requested_state": requested_state
    }
    if table_arn is not None:
        input_["table_arn"] = table_arn
    if migration_id is not None:
        input_["migration_id"] = migration_id
    if update_description is not None:
        input_["update_description"] = update_description

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