Braket

2020/10/30 - Braket - 3 new 3 updated api methods

Changes  This release supports tagging for Amazon Braket quantum-task resources. It also supports tag-based access control for quantum-task APIs.

UntagResource (new) Link ¶

Remove tags from a resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
type resourceArn

string

param resourceArn

[REQUIRED]

Specify the resourceArn for the resource from which to remove the tags.

type tagKeys

list

param tagKeys

[REQUIRED]

pecify the keys for the tags to remove from the resource.

  • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ListTagsForResource (new) Link ¶

Shows the tags associated with this resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    resourceArn='string'
)
type resourceArn

string

param resourceArn

[REQUIRED]

Specify the resourceArn for the resource whose tags to display.

rtype

dict

returns

Response Syntax

{
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • tags (dict) --

      Displays the key, value pairs of tags associated with this resource.

      • (string) --

        • (string) --

TagResource (new) Link ¶

Add a tag to the specified resource.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    resourceArn='string',
    tags={
        'string': 'string'
    }
)
type resourceArn

string

param resourceArn

[REQUIRED]

Specify the resourceArn of the resource to which a tag will be added.

type tags

dict

param tags

[REQUIRED]

Specify the tags to add to the resource.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateQuantumTask (updated) Link ¶
Changes (request)
{'tags': {'string': 'string'}}

Creates a quantum task.

See also: AWS API Documentation

Request Syntax

client.create_quantum_task(
    action='string',
    clientToken='string',
    deviceArn='string',
    deviceParameters='string',
    outputS3Bucket='string',
    outputS3KeyPrefix='string',
    shots=123,
    tags={
        'string': 'string'
    }
)
type action

string

param action

[REQUIRED]

The action associated with the task.

type clientToken

string

param clientToken

[REQUIRED]

The client token associated with the request.

This field is autopopulated if not provided.

type deviceArn

string

param deviceArn

[REQUIRED]

The ARN of the device to run the task on.

type deviceParameters

string

param deviceParameters

The parameters for the device to run the task on.

type outputS3Bucket

string

param outputS3Bucket

[REQUIRED]

The S3 bucket to store task result files in.

type outputS3KeyPrefix

string

param outputS3KeyPrefix

[REQUIRED]

The key prefix for the location in the S3 bucket to store task results in.

type shots

integer

param shots

[REQUIRED]

The number of shots to use for the task.

type tags

dict

param tags

Tags to be added to the quantum task you're creating.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'quantumTaskArn': 'string'
}

Response Structure

  • (dict) --

    • quantumTaskArn (string) --

      The ARN of the task created by the request.

GetQuantumTask (updated) Link ¶
Changes (response)
{'tags': {'string': 'string'}}

Retrieves the specified quantum task.

See also: AWS API Documentation

Request Syntax

client.get_quantum_task(
    quantumTaskArn='string'
)
type quantumTaskArn

string

param quantumTaskArn

[REQUIRED]

the ARN of the task to retrieve.

rtype

dict

returns

Response Syntax

{
    'createdAt': datetime(2015, 1, 1),
    'deviceArn': 'string',
    'deviceParameters': 'string',
    'endedAt': datetime(2015, 1, 1),
    'failureReason': 'string',
    'outputS3Bucket': 'string',
    'outputS3Directory': 'string',
    'quantumTaskArn': 'string',
    'shots': 123,
    'status': 'CREATED'|'QUEUED'|'RUNNING'|'COMPLETED'|'FAILED'|'CANCELLING'|'CANCELLED',
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • createdAt (datetime) --

      The time at which the task was created.

    • deviceArn (string) --

      The ARN of the device the task was run on.

    • deviceParameters (string) --

      The parameters for the device on which the task ran.

    • endedAt (datetime) --

      The time at which the task ended.

    • failureReason (string) --

      The reason that a task failed.

    • outputS3Bucket (string) --

      The S3 bucket where task results are stored.

    • outputS3Directory (string) --

      The folder in the S3 bucket where task results are stored.

    • quantumTaskArn (string) --

      The ARN of the task.

    • shots (integer) --

      The number of shots used in the task.

    • status (string) --

      The status of the task.

    • tags (dict) --

      The tags that belong to this task.

      • (string) --

        • (string) --

SearchQuantumTasks (updated) Link ¶
Changes (response)
{'quantumTasks': {'tags': {'string': 'string'}}}

Searches for tasks that match the specified filter values.

See also: AWS API Documentation

Request Syntax

client.search_quantum_tasks(
    filters=[
        {
            'name': 'string',
            'operator': 'LT'|'LTE'|'EQUAL'|'GT'|'GTE'|'BETWEEN',
            'values': [
                'string',
            ]
        },
    ],
    maxResults=123,
    nextToken='string'
)
type filters

list

param filters

[REQUIRED]

Array of SearchQuantumTasksFilter objects.

  • (dict) --

    A filter to use to search for tasks.

    • name (string) -- [REQUIRED]

      The name of the device used for the task.

    • operator (string) -- [REQUIRED]

      An operator to use in the filter.

    • values (list) -- [REQUIRED]

      The values to use for the filter.

      • (string) --

type maxResults

integer

param maxResults

Maximum number of results to return in the response.

type nextToken

string

param nextToken

A token used for pagination of results returned in the response. Use the token returned from the previous request continue results where the previous request ended.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'quantumTasks': [
        {
            'createdAt': datetime(2015, 1, 1),
            'deviceArn': 'string',
            'endedAt': datetime(2015, 1, 1),
            'outputS3Bucket': 'string',
            'outputS3Directory': 'string',
            'quantumTaskArn': 'string',
            'shots': 123,
            'status': 'CREATED'|'QUEUED'|'RUNNING'|'COMPLETED'|'FAILED'|'CANCELLING'|'CANCELLED',
            'tags': {
                'string': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      A token used for pagination of results, or null if there are no additional results. Use the token value in a subsequent request to continue results where the previous request ended.

    • quantumTasks (list) --

      An array of QuantumTaskSummary objects for tasks that match the specified filters.

      • (dict) --

        Includes information about a quantum task.

        • createdAt (datetime) --

          The time at which the task was created.

        • deviceArn (string) --

          The ARN of the device the task ran on.

        • endedAt (datetime) --

          The time at which the task finished.

        • outputS3Bucket (string) --

          The S3 bucket where the task result file is stored..

        • outputS3Directory (string) --

          The folder in the S3 bucket where the task result file is stored.

        • quantumTaskArn (string) --

          The ARN of the task.

        • shots (integer) --

          The shots used for the task.

        • status (string) --

          The status of the task.

        • tags (dict) --

          Displays the key, value pairs of tags associated with this quantum task.

          • (string) --

            • (string) --