quasardb C API: Node- and cluster-related operations

quasardb C API

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Node- and cluster-related operations

## Functions
QDB_API_LINKAGE qdb_error_t | qdb_node_status (qdb_handle_t handle, const char *uri, const char **content, qdb_size_t *content_length)
| Returns the status of a node. More...
QDB_API_LINKAGE qdb_error_t | qdb_node_config (qdb_handle_t handle, const char *uri, const char **content, qdb_size_t *content_length)
| Returns the configuration of a node. More...
QDB_API_LINKAGE qdb_error_t | qdb_node_topology (qdb_handle_t handle, const char *uri, const char **content, qdb_size_t *content_length)
| Returns the topology of a node. More...
QDB_API_LINKAGE qdb_error_t | qdb_node_stop (qdb_handle_t handle, const char *uri, const char *reason)
| Requests the node to gracefully stop. More...

## Detailed Description

## Function Documentation

QDB_API_LINKAGE qdb_error_t qdb_node_config | ( | qdb_handle_t | handle,
|  | const char * | uri,
|  | const char ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Returns the configuration of a node.

The API will request the node for its configuration and allocate a buffer of the appropriate size, which will later have to be released using qdb_release.

The configuration is JSON object, as described in the documentation.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | uri | A pointer to a null-terminated UTF-8 string representing the URI of the node for which the configuration is requested.
  [out] | content | A pointer to the pointer of an API-allocated buffer holding the node configuration.
  [out] | content_length | A pointer to an integer representing the size of the API-allocated buffer.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_node_status | ( | qdb_handle_t | handle,
|  | const char * | uri,
|  | const char ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Returns the status of a node.

The API will request the node for its status and allocate a buffer of the appropriate size, which will later have to be released using qdb_release.

The status is JSON object and contains current information of the node state, as described in the documentation.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | uri | A pointer to a null-terminated UTF-8 string representing the URI of node for which the status is requested.
  [out] | content | A pointer to the pointer of an API-allocated buffer holding the node status.
  [out] | content_length | A pointer to an integer representing the size of the API-allocated buffer.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release

QDB_API_LINKAGE qdb_error_t qdb_node_stop | ( | qdb_handle_t | handle,
|  | const char * | uri,
|  | const char * | reason
| ) |  |

Requests the node to gracefully stop.

Use this function to remotely stop a node, the supplied reason will be displayed in the logs of the remote node.

By default cluster do not allow this operation and the function will return qdb_e_operation_disabled error.

Parameters

  handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  uri | A pointer to a null-terminated UTF-8 string representing the URI of node to be stopped.
  reason | A pointer to a null-terminated UTF-8 string of the reason for the stop.

Returns
  A qdb_error_t code indicating success or failure.

QDB_API_LINKAGE qdb_error_t qdb_node_topology | ( | qdb_handle_t | handle,
|  | const char * | uri,
|  | const char ** | content,
|  | qdb_size_t * | content_length
| ) |  |

Returns the topology of a node.

The API will request the node for its topology and allocate a buffer of the appropriate size, which will later have to be released using qdb_release.

The topology is JSON object containing the node address, and the addresses of its successor and predecessor.

Parameters

  | handle | A valid handle previously initialized by qdb_open or qdb_open_tcp.
  | uri | A pointer to a null-terminated UTF-8 string representing the URI of node for which the topology is requested.
  [out] | content | A pointer to the pointer of an API-allocated buffer holding the node topology.
  [out] | content_length | A pointer to an integer representing the size of the API-allocated buffer.

Returns
  A qdb_error_t code indicating success or failure.

See Also
  qdb_release