Amazon CloudFront KeyValueStore

2023/11/21 - Amazon CloudFront KeyValueStore - 6 new api methods

Changes  This release adds support for CloudFront KeyValueStore, a globally managed key value datastore associated with CloudFront Functions.

UpdateKeys (new) Link ¶

Puts or Deletes multiple key value pairs in a single, all-or-nothing operation.

See also: AWS API Documentation

Request Syntax

client.update_keys(
    KvsARN='string',
    IfMatch='string',
    Puts=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    Deletes=[
        {
            'Key': 'string'
        },
    ]
)
type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

type IfMatch

string

param IfMatch

[REQUIRED]

The current version (ETag) of the Key Value Store that you are updating keys of, which you can get using DescribeKeyValueStore.

type Puts

list

param Puts

List of key value pairs to put.

  • (dict) --

    List item for key value pair to put.

    • Key (string) -- [REQUIRED]

      The key of the key value pair list item to put.

    • Value (string) -- [REQUIRED]

      The value for the key value pair to put.

type Deletes

list

param Deletes

List of keys to delete.

  • (dict) --

    List item for keys to delete.

    • Key (string) -- [REQUIRED]

      The key of the key value pair to be deleted.

rtype

dict

returns

Response Syntax

{
    'ItemCount': 123,
    'TotalSizeInBytes': 123,
    'ETag': 'string'
}

Response Structure

  • (dict) --

    Metadata information about a Key Value Store.

    • ItemCount (integer) --

      Number of key value pairs in the Key Value Store after the successful update.

    • TotalSizeInBytes (integer) --

      Total size of the Key Value Store after the successful update, in bytes.

    • ETag (string) --

      The current version identifier of the Key Value Store after the successful update.

DescribeKeyValueStore (new) Link ¶

Returns metadata information about Key Value Store.

See also: AWS API Documentation

Request Syntax

client.describe_key_value_store(
    KvsARN='string'
)
type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

rtype

dict

returns

Response Syntax

{
    'ItemCount': 123,
    'TotalSizeInBytes': 123,
    'KvsARN': 'string',
    'Created': datetime(2015, 1, 1),
    'ETag': 'string',
    'LastModified': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    Metadata information about a Key Value Store.

    • ItemCount (integer) --

      Number of key value pairs in the Key Value Store.

    • TotalSizeInBytes (integer) --

      Total size of the Key Value Store in bytes.

    • KvsARN (string) --

      The Amazon Resource Name (ARN) of the Key Value Store.

    • Created (datetime) --

      Date and time when the Key Value Store was created.

    • ETag (string) --

      The version identifier for the current version of the Key Value Store.

    • LastModified (datetime) --

      Date and time when the key value pairs in the Key Value Store was last modified.

PutKey (new) Link ¶

Creates a new key value pair or replaces the value of an existing key.

See also: AWS API Documentation

Request Syntax

client.put_key(
    Key='string',
    Value='string',
    KvsARN='string',
    IfMatch='string'
)
type Key

string

param Key

[REQUIRED]

The key to put.

type Value

string

param Value

[REQUIRED]

The value to put.

type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

type IfMatch

string

param IfMatch

[REQUIRED]

The current version (ETag) of the Key Value Store that you are putting keys into, which you can get using DescribeKeyValueStore.

rtype

dict

returns

Response Syntax

{
    'ItemCount': 123,
    'TotalSizeInBytes': 123,
    'ETag': 'string'
}

Response Structure

  • (dict) --

    Metadata information about a Key Value Store.

    • ItemCount (integer) --

      Number of key value pairs in the Key Value Store after the successful put.

    • TotalSizeInBytes (integer) --

      Total size of the Key Value Store after the successful put, in bytes.

    • ETag (string) --

      The current version identifier of the Key Value Store after the successful put.

GetKey (new) Link ¶

Returns a key value pair.

See also: AWS API Documentation

Request Syntax

client.get_key(
    KvsARN='string',
    Key='string'
)
type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

type Key

string

param Key

[REQUIRED]

The key to get.

rtype

dict

returns

Response Syntax

{
    'Key': 'string',
    'Value': 'string',
    'ItemCount': 123,
    'TotalSizeInBytes': 123
}

Response Structure

  • (dict) --

    A key value pair.

    • Key (string) --

      The key of the key value pair.

    • Value (string) --

      The value of the key value pair.

    • ItemCount (integer) --

      Number of key value pairs in the Key Value Store.

    • TotalSizeInBytes (integer) --

      Total size of the Key Value Store in bytes.

ListKeys (new) Link ¶

Returns a list of key value pairs.

See also: AWS API Documentation

Request Syntax

client.list_keys(
    KvsARN='string',
    NextToken='string',
    MaxResults=123
)
type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

type NextToken

string

param NextToken

If nextToken is returned in the response, there are more results available. Make the next call using the returned token to retrieve the next page.

type MaxResults

integer

param MaxResults

Maximum number of results that are returned per call. The default is 10 and maximum allowed page is 50.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'Items': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If nextToken is returned in the response, there are more results available. Make the next call using the returned token to retrieve the next page.

    • Items (list) --

      Key value pairs

      • (dict) --

        A key value pair.

        • Key (string) --

          The key of the key value pair.

        • Value (string) --

          The value of the key value pair.

DeleteKey (new) Link ¶

Deletes the key value pair specified by the key.

See also: AWS API Documentation

Request Syntax

client.delete_key(
    KvsARN='string',
    Key='string',
    IfMatch='string'
)
type KvsARN

string

param KvsARN

[REQUIRED]

The Amazon Resource Name (ARN) of the Key Value Store.

type Key

string

param Key

[REQUIRED]

The key to delete.

type IfMatch

string

param IfMatch

[REQUIRED]

The current version (ETag) of the Key Value Store that you are deleting keys from, which you can get using DescribeKeyValueStore.

rtype

dict

returns

Response Syntax

{
    'ItemCount': 123,
    'TotalSizeInBytes': 123,
    'ETag': 'string'
}

Response Structure

  • (dict) --

    Metadata information about a Key Value Store.

    • ItemCount (integer) --

      Number of key value pairs in the Key Value Store after the successful delete.

    • TotalSizeInBytes (integer) --

      Total size of the Key Value Store after the successful delete, in bytes.

    • ETag (string) --

      The current version identifier of the Key Value Store after the successful delete.