InfoCommands

class aerospike_sdk.aio.info.InfoCommands[source]

Bases: object

Provides high-level methods to execute common Aerospike info commands.

This class encapsulates the most commonly used Aerospike info commands and provides a convenient API for retrieving cluster information.

Example:

info = session.info()

# Get all namespaces
namespaces = await info.namespaces()

# Get namespace details
ns_detail = await info.namespace_details("test")

# Get all secondary indexes
indexes = await info.secondary_indexes()
__init__(session)[source]

Initialize InfoCommands.

Parameters:

session (Session) – The Session to use for info commands.

async build()[source]

Get the build information from all nodes in the cluster.

Return type:

Set[str]

Returns:

A set of build strings from all nodes.

async namespaces()[source]

Get the list of namespaces from all nodes in the cluster.

Return type:

Set[str]

Returns:

A set of namespace names from all nodes.

async namespace_details(namespace)[source]

Get detailed information about a specific namespace.

Parameters:

namespace (str) – The name of the namespace.

Return type:

Optional[Dict[str, str]]

Returns:

A dictionary containing namespace details, or None if not found.

async sets(namespace)[source]

Get the list of sets in a specific namespace.

Parameters:

namespace (str) – The name of the namespace.

Return type:

List[str]

Returns:

A list of set names in the namespace.

async secondary_indexes(namespace=None)[source]

Get information about all secondary indexes.

Parameters:

namespace (Optional[str]) – Optional namespace filter. If provided, only returns indexes for that namespace.

Return type:

List[Dict[str, str]]

Returns:

A list of dictionaries containing secondary index information.

async secondary_index_details(namespace, index_name)[source]

Get detailed information about a specific secondary index.

Parameters:
  • namespace (str) – The namespace containing the index.

  • index_name (str) – The name of the index.

Return type:

Optional[Dict[str, str]]

Returns:

A dictionary containing index details, or None if not found.

async is_cluster_stable()[source]

Check if all nodes agree on the current cluster state.

Return type:

bool

Returns:

True if the cluster is stable, False otherwise.

async get_cluster_size()[source]

Get the number of nodes in the cluster.

Return type:

int

Returns:

The number of nodes in the cluster.

async info(command)[source]

Execute a raw info command against the cluster.

Parameters:

command (str) – The info command to execute (e.g., “statistics”, “build”).

Return type:

Dict[str, str]

Returns:

A dictionary containing the info command response as key-value pairs.

async info_on_all_nodes(command)[source]

Execute a raw info command against all nodes in the cluster.

Parameters:

command (str) – The info command to execute (e.g., “statistics”, “build”).

Return type:

Dict[str, Dict[str, str]]

Returns:

A dictionary mapping node names to their response dictionaries.