Skip to content

describe_snapshot_copy_grants async

describe_snapshot_copy_grants(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_copy_grant_name: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    tag_keys: Optional[TagKeyList] = None,
    tag_values: Optional[TagValueList] = None,
) -> SnapshotCopyGrantMessage

Returns a list of snapshot copy grants owned by the Amazon Web Services account in the destination region.

For more information about managing snapshot copy grants, go to Amazon Redshift Database Encryption in the Amazon Redshift Cluster Management Guide.

Parameters:

  • snapshot_copy_grant_name (Optional[String], default: None ) –

    The name of the snapshot copy grant.

  • max_records (Optional[IntegerOptional], default: None ) –

    The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.

    Default: 100

    Constraints: minimum 20, maximum 100.

  • marker (Optional[String], default: None ) –

    An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeSnapshotCopyGrant request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.

    Constraints: You can specify either the SnapshotCopyGrantName parameter or the Marker parameter, but not both.

  • tag_keys (Optional[TagKeyList], default: None ) –

    A tag key or keys for which you want to return all matching resources that are associated with the specified key or keys. For example, suppose that you have resources tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with all resources that have either or both of these tag keys associated with them.

  • tag_values (Optional[TagValueList], default: None ) –

    A tag value or values for which you want to return all matching resources that are associated with the specified value or values. For example, suppose that you have resources tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with all resources that have either or both of these tag values associated with them.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def describe_snapshot_copy_grants(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_copy_grant_name: Optional["capo_redshift.types.string.String"] = None,
    max_records: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_redshift.types.string.String"] = None,
    tag_keys: Optional["capo_redshift.types.tag_key_list.TagKeyList"] = None,
    tag_values: Optional["capo_redshift.types.tag_value_list.TagValueList"] = None,
) -> "capo_redshift.types.snapshot_copy_grant_message.SnapshotCopyGrantMessage":
    """<p>Returns a list of snapshot copy grants owned by the Amazon Web Services account in the destination region.</p> <p> For more information about managing snapshot copy grants, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html">Amazon Redshift Database Encryption</a> in the <i>Amazon Redshift Cluster Management Guide</i>. </p>

    Args:
        snapshot_copy_grant_name: <p>The name of the snapshot copy grant.</p>
        max_records: <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. </p> <p>Default: <code>100</code> </p> <p>Constraints: minimum 20, maximum 100.</p>
        marker: <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeSnapshotCopyGrant</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request. </p> <p>Constraints: You can specify either the <b>SnapshotCopyGrantName</b> parameter or the <b>Marker</b> parameter, but not both. </p>
        tag_keys: <p>A tag key or keys for which you want to return all matching resources that are associated with the specified key or keys. For example, suppose that you have resources tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with all resources that have either or both of these tag keys associated with them.</p>
        tag_values: <p>A tag value or values for which you want to return all matching resources that are associated with the specified value or values. For example, suppose that you have resources tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with all resources that have either or both of these tag values associated with them.</p>

    Raises:
        capo_redshift.errors.invalid_tag_fault.InvalidTagFault: <p>The tag is invalid.</p>
        capo_redshift.errors.snapshot_copy_grant_not_found_fault.SnapshotCopyGrantNotFoundFault: <p>The specified snapshot copy grant can't be found. Make sure that the name is typed correctly and that the grant exists in the destination region.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.describe_snapshot_copy_grants_message.DescribeSnapshotCopyGrantsMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.snapshot_copy_grant_message.SnapshotCopyGrantMessage"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.describe_snapshot_copy_grants

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.describe_snapshot_copy_grants.async_describe_snapshot_copy_grants(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSnapshotCopyGrants")
    )
    input_: capo_redshift.types.describe_snapshot_copy_grants_message.DescribeSnapshotCopyGrantsMessage = {}
    if snapshot_copy_grant_name is not None:
        input_["snapshot_copy_grant_name"] = snapshot_copy_grant_name
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker
    if tag_keys is not None:
        input_["tag_keys"] = tag_keys
    if tag_values is not None:
        input_["tag_values"] = tag_values

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