Amazon NeptuneData

2026/10/28 - Amazon NeptuneData - 5 new api methods

Changes  Get Storage API analyzes storage usage to identify database bloat and your storage footprint. Index Rebuild API triggers on-demand index reconstruction to eliminate bloat and restore query performance.

CancelIndexRebuild (new) Link ¶

Cancels an in-progress index rebuild operation.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:CancelIndexRebuild IAM action in that cluster.

See also: AWS API Documentation

Request Syntax

client.cancel_index_rebuild(
    rebuildId='string'
)
type rebuildId:

string

param rebuildId:

[REQUIRED]

The unique identifier of the index rebuild job to cancel.

rtype:

dict

returns:

Response Syntax

{
    'status': 'PREPARING'|'REBUILDING'|'COMPLETED'|'FAILED'|'CANCELLED'|'CANCELLING',
    'concurrency': 123,
    'writeBufferSize': 'LOW'|'MEDIUM'|'HIGH'
}

Response Structure

  • (dict) --

    • status (string) --

      The status of the cancellation request.

    • concurrency (integer) --

      The concurrency of the rebuild being cancelled, echoed from the original StartIndexRebuild request.

    • writeBufferSize (string) --

      The WriteBufferSize of the rebuild being cancelled, echoed from the original StartIndexRebuild request.

StartIndexRebuild (new) Link ¶

Initiates an index rebuild operation to optimize storage and improve query performance. The rebuild operation reorganizes index to reclaim space and improve efficiency.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:StartIndexRebuild IAM action in that cluster.

See also: AWS API Documentation

Request Syntax

client.start_index_rebuild(
    scope='ALL'|'QUADS'|'DICTIONARIES',
    concurrency=123,
    writeBufferSize='LOW'|'MEDIUM'|'HIGH',
    clientToken='string'
)
type scope:

string

param scope:

Specifies the scope of the rebuild operation. Possible values are:

  • ALL - Rebuild all (quads and dictionaries). This is the default if not specified.

  • QUADS - Rebuild only the quad indexes.

  • DICTIONARIES - Rebuild only the dictionaries.

type concurrency:

integer

param concurrency:

The number of concurrent indexes to rebuild in parallel. If not specified, defaults to 1.

Valid values are between 1 and the number of vCPUs available on the writer instance. If the value exceeds the available vCPUs, it is capped at the maximum instead of returning an InvalidParameterException. The effective (capped) value is returned in the response.

Higher concurrency can shorten the overall rebuild, but also increases CPU and I/O load during the operation.

type writeBufferSize:

string

param writeBufferSize:

Controls the buffer size used for tracking concurrent write operations during the index rebuild. If your database has high write traffic during the rebuild, a larger buffer prevents the operation from failing due to buffer overflow. Possible values are:

  • LOW - Suitable for databases with light to moderate write activity. This is the default.

  • MEDIUM - Recommended for databases with sustained write traffic or bulk loading.

  • HIGH - Use when rebuilding indexes during heavy write workloads or continuous bulk data ingestion.

If your rebuild fails and you are actively writing data to the database, retry with a higher writeBufferSize value. For bulk load operations, consider using HIGH.

type clientToken:

string

param clientToken:

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, the SDK automatically generates one.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'status': 'PREPARING'|'REBUILDING'|'COMPLETED'|'FAILED'|'CANCELLED'|'CANCELLING',
    'rebuildId': 'string',
    'scope': 'ALL'|'QUADS'|'DICTIONARIES',
    'concurrency': 123,
    'writeBufferSize': 'LOW'|'MEDIUM'|'HIGH'
}

Response Structure

  • (dict) --

    • status (string) --

      The current status of the rebuild operation. See RebuildStatus for possible values.

    • rebuildId (string) --

      The unique identifier for the index rebuild job. Use this ID with the GetIndexRebuildStatus operation to check the progress of the rebuild.

    • scope (string) --

      The scope of the rebuild operation that was requested. See Scope for possible values: ALL, QUADS, or DICTIONARIES.

    • concurrency (integer) --

      The effective concurrency used for this rebuild. This is the value supplied in the request, capped at the number of vCPUs on the writer instance.

    • writeBufferSize (string) --

      The WriteBufferSize applied to this rebuild. See the WriteBufferSize enum for possible values.

ListIndexRebuilds (new) Link ¶

Retrieves a list of all index rebuild operation identifiers.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:ListIndexRebuilds IAM action in that cluster.

See also: AWS API Documentation

Request Syntax

client.list_index_rebuilds()
rtype:

dict

returns:

Response Syntax

{
    'rebuildIds': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • rebuildIds (list) --

      A list of unique identifiers for index rebuild operations. Use each ID with the GetIndexRebuildStatus operation to retrieve detailed status information.

      • (string) --

GetStorageInfo (new) Link ¶

Retrieves storage information for the Neptune database instance, including approximate total storage used and per-category size and entry counts. Storage categories include:

  • Quad indexes - the indexes that store graph data, for both RDF (SPARQL) and Property Graph (Gremlin/openCypher) models.

  • Dictionaries - the term dictionaries, including total dictionary storage and the portion used by blob (large value) entries.

  • Undo logs - the undo logs, reported as a total size and the number of entries in the undo log list.

  • Streams - the change-log streams.

  • Schema - the schema.

  • DFE statistics - the DFE engine statistics.

  • System metadata - internal system metadata.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:GetStorageInfo IAM action in that cluster.

See also: AWS API Documentation

Request Syntax

client.get_storage_info()
rtype:

dict

returns:

Response Syntax

{
    'totalStorageBytesUsed': 123,
    'quads': {
        'RDF': {
            'SPOG': {
                'sizeInBytes': 123,
                'count': 123
            },
            'POGS': {
                'sizeInBytes': 123,
                'count': 123
            },
            'GPSO': {
                'sizeInBytes': 123,
                'count': 123
            },
            'OSGP': {
                'sizeInBytes': 123,
                'count': 123
            },
            'PZSOG': {
                'sizeInBytes': 123,
                'count': 123
            }
        },
        'PG': {
            'SPOG': {
                'sizeInBytes': 123,
                'count': 123
            },
            'POGS': {
                'sizeInBytes': 123,
                'count': 123
            },
            'GPSO': {
                'sizeInBytes': 123,
                'count': 123
            },
            'OSGP': {
                'sizeInBytes': 123,
                'count': 123
            },
            'PZSOG': {
                'sizeInBytes': 123,
                'count': 123
            }
        }
    },
    'dictionaries': {
        'total': {
            'sizeInBytes': 123,
            'count': 123
        },
        'blobs': {
            'sizeInBytes': 123,
            'count': 123
        }
    },
    'undoLogs': {
        'sizeInBytes': 123,
        'listSize': 123
    },
    'streams': {
        'sizeInBytes': 123,
        'count': 123
    },
    'dfeStatistics': {
        'sizeInBytes': 123,
        'count': 123
    },
    'schema': {
        'sizeInBytes': 123,
        'count': 123
    },
    'internals': {
        'sizeInBytes': 123,
        'count': 123
    }
}

Response Structure

  • (dict) --

    • totalStorageBytesUsed (integer) --

      The approximate total amount of storage used by the Neptune database instance, in bytes.

    • quads (dict) --

      Contains information about the quad indexes, including counts and sizes for both RDF (SPARQL) and Property Graph (Gremlin/openCypher) data.

      • RDF (dict) --

        Contains quad index information for the RDF (SPARQL) data model.

        • SPOG (dict) --

          Size and count information for the SPOG quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • POGS (dict) --

          Size and count information for the POGS quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • GPSO (dict) --

          Size and count information for the GPSO quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • OSGP (dict) --

          Size and count information for the OSGP quad index. This index is optional. For details on how to enable it and evaluate the benefits and costs, see Neptune Data Model.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • PZSOG (dict) --

          Size and count information for the PZSOG quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

      • PG (dict) --

        Contains quad index information for the Property Graph (Gremlin/openCypher) data model.

        • SPOG (dict) --

          Size and count information for the SPOG quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • POGS (dict) --

          Size and count information for the POGS quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • GPSO (dict) --

          Size and count information for the GPSO quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • OSGP (dict) --

          Size and count information for the OSGP quad index. This index is optional. For details on how to enable it and evaluate the benefits and costs, see Neptune Data Model.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

        • PZSOG (dict) --

          Size and count information for the PZSOG quad index.

          • sizeInBytes (integer) --

            Storage size in bytes.

          • count (integer) --

            The number of entries.

    • dictionaries (dict) --

      Contains information about the dictionaries, including total dictionary storage and the portion used by blob entries. For additional details on the storage of the Neptune dictionary, see Neptune Storage Billing.

      • total (dict) --

        The total size and entry count across all dictionary entries.

        • sizeInBytes (integer) --

          Storage size in bytes.

        • count (integer) --

          The number of entries.

      • blobs (dict) --

        The size and entry count for the blob (large value) dictionary entries.

        • sizeInBytes (integer) --

          Storage size in bytes.

        • count (integer) --

          The number of entries.

    • undoLogs (dict) --

      Contains information about the undo logs. The sizeInBytes field represents the total size of the undo logs in bytes, and the listSize field represents the number of entries in the undo log list.

      • sizeInBytes (integer) --

        The total size of the undo logs in bytes.

      • listSize (integer) --

        The number of entries in the undo log list.

    • streams (dict) --

      Contains storage metrics for the Neptune change-log streams, including size in bytes and entry count.

      • sizeInBytes (integer) --

        Storage size in bytes.

      • count (integer) --

        The number of entries.

    • dfeStatistics (dict) --

      Contains storage metrics for the Neptune DFE engine statistics, including size in bytes and entry count.

      • sizeInBytes (integer) --

        Storage size in bytes.

      • count (integer) --

        The number of entries.

    • schema (dict) --

      Contains storage metrics for the Neptune schema, including size in bytes and entry count.

      • sizeInBytes (integer) --

        Storage size in bytes.

      • count (integer) --

        The number of entries.

    • internals (dict) --

      Contains storage metrics for Neptune system metadata, including size in bytes and entry count.

      • sizeInBytes (integer) --

        Storage size in bytes.

      • count (integer) --

        The number of entries.

GetIndexRebuildStatus (new) Link ¶

Retrieves the status of an index rebuild operation.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:GetIndexRebuildStatus IAM action in that cluster.

See also: AWS API Documentation

Request Syntax

client.get_index_rebuild_status(
    rebuildId='string'
)
type rebuildId:

string

param rebuildId:

[REQUIRED]

The unique identifier of the index rebuild job returned by the StartIndexRebuild operation.

rtype:

dict

returns:

Response Syntax

{
    'status': 'PREPARING'|'REBUILDING'|'COMPLETED'|'FAILED'|'CANCELLED'|'CANCELLING',
    'scope': 'ALL'|'QUADS'|'DICTIONARIES',
    'concurrency': 123,
    'writeBufferSize': 'LOW'|'MEDIUM'|'HIGH',
    'startTime': datetime(2015, 1, 1),
    'progressPercentage': 123,
    'estimatedEndTime': datetime(2015, 1, 1),
    'endTime': datetime(2015, 1, 1),
    'failureReason': 'string'
}

Response Structure

  • (dict) --

    • status (string) --

      The current status of the rebuild operation. See RebuildStatus for possible values: PREPARING, REBUILDING, COMPLETED, FAILED, CANCELLING or CANCELLED.

    • scope (string) --

      The scope of the rebuild operation. See Scope for possible values: ALL, QUADS, or DICTIONARIES.

    • concurrency (integer) --

      The concurrency in effect for this rebuild, as echoed from the original StartIndexRebuild request.

    • writeBufferSize (string) --

      The WriteBufferSize in effect for this rebuild, as echoed from the original StartIndexRebuild request.

    • startTime (datetime) --

      The ISO-8601 timestamp indicating when the index rebuild operation started.

    • progressPercentage (integer) --

      The percentage of the index rebuild operation that has been completed, expressed as an integer from 0 to 100.

    • estimatedEndTime (datetime) --

      The estimated ISO-8601 timestamp for when the index rebuild operation will complete. The estimate may change as the operation progresses.

    • endTime (datetime) --

      The ISO-8601 timestamp indicating when the index rebuild operation completed. This field is only present when the operation has completed (status is COMPLETED, FAILED, or CANCELLED).

    • failureReason (string) --

      The reason for the failure, if the rebuild operation failed. This field is only populated when the status is FAILED.