Skip to content

get_channel async

get_channel(
    table_arn: TableARN,
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    channel_id: Optional[ChannelId] = None,
) -> GetChannelResponse

Gets the current state of a table's channel in Amazon S3 Tables.

The operation returns the following information about the channel:

  • The state of the channel

  • The approximate number of rows that the channel has buffered and not yet committed to the table

  • An error code and a message that describe the error, if an error blocks commits

The default channel is created the first time that PutRows writes to the table. Until then, GetChannel fails with a NotFoundException error.

Permissions

To use this operation, you must have the s3tables:GetChannel permission on the table.

Parameters:

  • table_arn (TableARN) –

    The Amazon Resource Name (ARN) of the table that the channel belongs to.

  • channel_id (Optional[ChannelId], default: None ) –

    The identifier of the channel whose state you want to get. If you don't specify a channel, the operation uses default. Only default is supported.

Raises:

Source code in docs_src/capo_s3tables/_services/async_s3_tables.py
async def get_channel(
    self,
    table_arn: "capo_s3tables.types.table_arn.TableARN",
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    channel_id: Optional["capo_s3tables.types.channel_id.ChannelId"] = None,
) -> "capo_s3tables.types.get_channel_response.GetChannelResponse":
    """<p>Gets the current state of a table's channel in Amazon S3 Tables.</p> <p>The operation returns the following information about the channel:</p> <ul> <li> <p>The state of the channel</p> </li> <li> <p>The approximate number of rows that the channel has buffered and not yet committed to the table</p> </li> <li> <p>An error code and a message that describe the error, if an error blocks commits</p> </li> </ul> <p>The default channel is created the first time that <code>PutRows</code> writes to the table. Until then, <code>GetChannel</code> fails with a <code>NotFoundException</code> error.</p> <dl> <dt>Permissions</dt> <dd> <p>To use this operation, you must have the <code>s3tables:GetChannel</code> permission on the table.</p> </dd> </dl>

    Args:
        table_arn: <p>The Amazon Resource Name (ARN) of the table that the channel belongs to.</p>
        channel_id: <p>The identifier of the channel whose state you want to get. If you don't specify a channel, the operation uses <code>default</code>. Only <code>default</code> is supported.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3tables.types.get_channel_request.GetChannelRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3tables.types.get_channel_response.GetChannelResponse"
    ]:
        import capo_s3tables._operations.s3_table_buckets.get_channel

        (
            output,
            http_response,
        ) = await capo_s3tables._operations.s3_table_buckets.get_channel.async_get_channel(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetChannel")
    )
    input_: capo_s3tables.types.get_channel_request.GetChannelRequest = {
        "table_arn": table_arn
    }
    if channel_id is not None:
        input_["channel_id"] = channel_id

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