Skip to content

Aerospike Graph call steps

Use this page as a reference for Graph calls. For HTTP mappings, see HTTP endpoints.

For all commands, replace placeholder values with the correct values for your configuration.

Metadata

These call steps return information about the graph, its configuration, and resource usage.

Get graph summary

Returns graph summary with counts for vertices, edges, and supernodes.

g.call("aerospike.graph.admin.metadata.summary").next()
Example response
==>Total vertex count=450036
==>Vertex count by label={Account=100008, Consumer=50004, Subscription=100008, Communication=100008, Contact=100008}
==>Vertex properties by label={Account=[Account Number], Consumer=[Consumer Name], Subscription=[Subscription Name], Communication=[Preference Code], Contact=[Contact Value, Contact Type]}
==>Total edge count=500040
==>Edge count by label={HAS_CONTACT=200016, OWNS_ACCOUNT=100008, SUBSCRIBED_TO=100008, HAS_SUBSCRIPTION=100008}
==>Edge properties by label={HAS_CONTACT=[], OWNS_ACCOUNT=[], SUBSCRIBED_TO=[], HAS_SUBSCRIPTION=[]}
==>Total supernode count=5
==>Supernode count by label={Contact=2, Communication=3}

Get usage statistics

Returns a map with raw usage samples and total-vcpu-hours. Supports an optional since date (yyyy-mm-dd) parameter.

g.call("aerospike.graph.admin.metadata.usage").with("since","SINCE_DATE").next()
Example response
'raw': [ { 'epoch-ms-final': 1702327851857,
'epoch-ms-start': 1702326901857,
'memory-gb': 32,
'uuid': '9c0ba414-c9f2-492f-adb9-9792bb6dfed1',
'vcpus': 16},
{ 'epoch-ms-final': 1702327148084,
'epoch-ms-start': 1702327148084,
'memory-gb': 9,
'uuid': 'c924f45e-886d-4c04-8039-292d56ea037c',
'vcpus': 16}],
'total-vcpu-hours': 8.4819888381532217,
'estimated-annual-total-vcpus': 80000}

Get configuration

Returns a snapshot of server and graph configuration. See version and configuration info for the optional mode parameter.

g.call("aerospike.graph.admin.metadata.config").next()
Example response
{'Graph Properties': {'aerospike.client.host': 'aerospike-cluster',
'aerospike.client.namespace': 'retail-graph',
'aerospike.client.port': '3000',
'aerospike.graph.http.port': '9090',
'aerospike.graph.index.vertex.label.enabled': 'true',
'gremlin.graph': 'com.aerospike.firefly.structure.FireflyGraph'},
'Gremlin Server Configuration': 'host: 0.0.0.0\n'
'port: 8182\n'
'evaluationTimeout: 10000\n'
'channelizer: '
'org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer\n'
'...'
}

Get version

Returns Aerospike Database, Aerospike Graph, and Gremlin versions.

g.call("aerospike.graph.admin.metadata.version").next()
Example response
{'Aerospike Graph Service version': '2.6.0',
'Aerospike version': 'aerospike-cluster:8.0.0.7',
'Gremlin version': '3.7.3'}

Configuration management

Use aerospike.graph.admin.metadata.set-config to update supported configuration options at runtime without restarting AGS. AGS saves these changes in graph metadata, so they persist across restarts and apply to all instances that share the same graph metadata.

Set runtime configuration

To propagate changes to other running instances automatically, set aerospike.graph.config.update.enabled to true. Each instance then checks for updates at the interval defined by aerospike.graph.config.update.frequency (default: 5000 ms). If aerospike.graph.config.update.enabled is false (the default), you must restart other instances to apply the changes.

You can update any configuration option that matches the following:

  • aerospike.client.policy.*
  • aerospike.client.batch.read.*
  • aerospike.graph.pagination.*
  • aerospike.client.batch-threshold.per-node
  • aerospike.graph.cache.*

Pass one or more key-value pairs with .with():

g.call("aerospike.graph.admin.metadata.set-config")
.with("CONFIG_KEY", "CONFIG_VALUE")
.iterate()

The call returns no output on success. If you pass an immutable key, the call throws an IllegalArgumentException:

IllegalArgumentException("Immutable option <key> can't be changed.")

Examples:

Set a single configuration option:

g.call("aerospike.graph.admin.metadata.set-config")
.with("aerospike.client.policy.write.socketTimeout", "1000")
.iterate()

Set multiple configuration options in one call:

g.call("aerospike.graph.admin.metadata.set-config")
.with("aerospike.client.policy.write.socketTimeout", "1000")
.with("aerospike.client.policy.write.totalTimeout", "5000")
.with("aerospike.client.policy.write.sleepBetweenRetry", "1000")
.with("aerospike.client.policy.maxRetries", "2")
.iterate()

Index management

These call steps create, inspect, and remove secondary indexes.

Create a secondary index

Starts building a secondary index on a vertex property or label.

g.call("aerospike.graph.admin.index.create")
.with("element_type","ELEMENT_TYPE")
.with("property_key","PROPERTY_KEY")
.with("index_type", "INDEX_TYPE")
.next()
Example response
Vertex index creation of property key 'PROPERTY_KEY' in progress.

Get index status

Returns progress and resource usage for an index build.

g.call("aerospike.graph.admin.index.status")
.with("element_type","ELEMENT_TYPE")
.with("property_key","PROPERTY_KEY")
.next()
Example response
==>percent_complete=100
==>total_used_bytes=33554432
==>total_entries=194
==>load_time=7

Get index cardinality

Returns distinct value counts for all existing secondary indexes.

g.call("aerospike.graph.admin.index.cardinality").next()
Example response
{'~vertex.label': 2}

List indexes

Lists indexed properties currently available to queries.

g.call("aerospike.graph.admin.index.list").next()
Example response
['vertex.~label']

Drop index

Drops a secondary index.

g.call("aerospike.graph.admin.index.drop")
.with("element_type","ELEMENT_TYPE")
.with("property_key","PROPERTY_KEY")
.with("index_type", "INDEX_TYPE")
.next()
Example response
Vertex index of property key 'PROPERTY_KEY' dropped.

Bulk load

Bulk loader calls are Gremlin only. They are not exposed as HTTP endpoints. See HTTP endpoints.

Start bulk load

Starts a bulk import job from a data source using aerospike.graphloader.admin.bulk-load.load.

Use these .with() arguments to point to your dataset files:

  • aerospike.graphloader.vertices: Directory containing vertex CSV files.
  • aerospike.graphloader.edges: Directory containing edge CSV files.

Use these .with() arguments for S3 (AWS) and GCS (GCP) storage backends:

  • aerospike.graphloader.remote-user: S3: AWS_ACCESS_KEY_ID or GCS: private_key_id.
  • aerospike.graphloader.remote-passkey: S3: AWS_SECRET_ACCESS_KEY or GCS: private_key.
  • aerospike.graphloader.gcs-email: GCS service account client_email.

Get bulk load errors

Returns load-time errors by type.

Use the following ERROR_TYPE values for the .with argument:

  • duplicate-vertex-ids: vertices that have the same ID in the input dataset.
  • bad-edges: edges (from or to) that reference missing vertex IDs.
  • bad-entry: vertices or edges with incorrectly typed data.
g.call("aerospike.graphloader.admin.bulk-load.errors")
.with("type","ERROR_TYPE")
.next()
Example response
==>count=1
==>bad-vertex-id=tommy

Get bulk load error count

Returns aggregate error counts for the most recent load.

g.call("aerospike.graphloader.admin.bulk-load.error-count").next()
Example response
Warning: Errors were encountered during bulk loading.
duplicate-vertex-id-count: 1
bad-edge-count: 3
bad-entry-count: 2
Use the g.call("aerospike.graphloader.admin.bulk-load.errors") command for details.

Security

These call steps manage authentication tokens for role-based access control.

Issue RBAC JWT

Issues a JSON Web Token (JWT) for access with the specified role.

g.call("aerospike.graph.admin.rbac-jwt.issue-token")
.with("username","USERNAME")
.with("role","ROLE")
.next()

Query control

These call steps manage running queries.

Abort background queries

Terminates all Graph-related background database operations and returns counts affected.

g.call("aerospike.graph.admin.query.abort").next()
Example response
==>found=0
==>aborted=0

Cache management

Get cache status

Returns the current cache mode and usage statistics including weight, entry count, and hit/miss counts.

g.call("aerospike.graph.admin.cache.status").next()
Example response
{'mode': 'TRANSACTIONAL',
'cache_weight': 1000000,
'estimated_entry_count': 0,
'weighted_size': 0,
'estimated_memory_bytes': 0,
'estimated_memory_formatted': '0 B',
'hit_count': 0,
'miss_count': 0}

Set cache mode

Changes the cache mode at runtime. You can optionally set a custom cache weight.

g.call("aerospike.graph.admin.cache.set-mode")
.with("mode","CACHE_MODE")
.with("cache_weight","CACHE_WEIGHT")
.next()
Example response
{'status': 'success',
'previous_mode': 'TRANSACTIONAL',
'current_mode': 'GLOBAL',
'cache_weight': 20000000}

Reset cache

Clears and reinitializes the current caches.

g.call("aerospike.graph.admin.cache.reset").next()
Example response
{'status': 'success',
'mode': 'GLOBAL',
'previous_entry_count': 1523,
'previous_weighted_size': 45690,
'current_entry_count': 0,
'current_weighted_size': 0}
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?