The Info API provides the ability to query an Aerospike cluster for information.
The following API are provided:
|
as_status | aerospike_info_foreach (aerospike *as, as_error *err, const as_policy_info *policy, const char *req, aerospike_info_foreach_callback callback, void *udata) |
|
as_status | aerospike_info_host (aerospike *as, as_error *err, const as_policy_info *policy, const char *addr, uint16_t port, const char *req, char **res) |
|
typedef bool(* aerospike_info_foreach_callback)(const as_error *err, const as_node *node, const char *req, char *res, void *udata) |
typedef bool(* aerospike_info_foreach_callback)(const as_error *err, const as_node *node, const char *req, char *res, void *udata) |
Send an info request to the entire cluster.
The callback takes a response string, which the caller is reponsible for freeing.
bool callback(
const as_error * err,
const char * node,
char * res,
void * udata) {
free(res);
res = NULL;
}
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
req | The info request to send. |
callback | The function to call when a response is received. |
udata | User-data to send to the callback. |
- Returns
- AEROSPIKE_OK on success. Otherwise an error.
Send an info request to a specific host. The response must be freed by the caller.
char * res = NULL;
}
else {
free(res);
res = NULL;
}
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
addr | The IP address or hostname to send the request to. |
port | The port to send the request to. |
req | The info request to send. |
res | The response from the node. The response will be a NULL terminated string, allocated by the function, and must be freed by the caller. |
- Returns
- AEROSPIKE_OK on success. Otherwise an error.