Bedrock / Client / list_guardrails

list_guardrails#

Bedrock.Client.list_guardrails(**kwargs)#

Lists details about all the guardrails in an account. To list the DRAFT version of all your guardrails, don’t specify the guardrailIdentifier field. To list all versions of a guardrail, specify the ARN of the guardrail in the guardrailIdentifier field.

You can set the maximum number of results to return in a response in the maxResults field. If there are more results than the number you set, the response returns a nextToken that you can send in another ListGuardrails request to see the next batch of results.

See also: AWS API Documentation

Request Syntax

response = client.list_guardrails(
    guardrailIdentifier='string',
    maxResults=123,
    nextToken='string'
)
Parameters:
  • guardrailIdentifier (string) – The unique identifier of the guardrail. This can be an ID or the ARN.

  • maxResults (integer) – The maximum number of results to return in the response.

  • nextToken (string) – If there are more results than were returned in the response, the response returns a nextToken that you can send in another ListGuardrails request to see the next batch of results.

Return type:

dict

Returns:

Response Syntax

{
    'guardrails': [
        {
            'id': 'string',
            'arn': 'string',
            'status': 'CREATING'|'UPDATING'|'VERSIONING'|'READY'|'FAILED'|'DELETING',
            'name': 'string',
            'description': 'string',
            'version': 'string',
            'createdAt': datetime(2015, 1, 1),
            'updatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • guardrails (list) –

      A list of objects, each of which contains details about a guardrail.

      • (dict) –

        Contains details about a guardrail.

        This data type is used in the following API operations:

        • id (string) –

          The unique identifier of the guardrail.

        • arn (string) –

          The ARN of the guardrail.

        • status (string) –

          The status of the guardrail.

        • name (string) –

          The name of the guardrail.

        • description (string) –

          A description of the guardrail.

        • version (string) –

          The version of the guardrail.

        • createdAt (datetime) –

          The date and time at which the guardrail was created.

        • updatedAt (datetime) –

          The date and time at which the guardrail was last updated.

    • nextToken (string) –

      If there are more results than were returned in the response, the response returns a nextToken that you can send in another ListGuardrails request to see the next batch of results.

Exceptions

  • Bedrock.Client.exceptions.ResourceNotFoundException

  • Bedrock.Client.exceptions.AccessDeniedException

  • Bedrock.Client.exceptions.ValidationException

  • Bedrock.Client.exceptions.InternalServerException

  • Bedrock.Client.exceptions.ThrottlingException