The Info API provides the ability to query server node(s) for statistics and set dynamically configurable variables.
|
AS_EXTERN as_status | aerospike_info_any (aerospike *as, as_error *err, const as_policy_info *policy, const char *req, char **res) |
|
AS_EXTERN 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_EXTERN as_status | aerospike_info_host (aerospike *as, as_error *err, const as_policy_info *policy, const char *hostname, uint16_t port, const char *req, char **res) |
|
AS_EXTERN as_status | aerospike_info_node (aerospike *as, as_error *err, const as_policy_info *policy, as_node *node, const char *req, char **res) |
|
static as_status | aerospike_info_node_async (aerospike *as, as_error *err, as_policy_info *policy, as_node *node, const char *req, as_async_info_listener listener, void *udata, as_event_loop *event_loop) |
|
AS_EXTERN as_status | aerospike_info_socket_address (aerospike *as, as_error *err, const as_policy_info *policy, struct sockaddr_in *sa_in, const char *req, char **res) |
|
◆ aerospike_info_foreach_callback
typedef bool(* aerospike_info_foreach_callback) (const as_error *err, const as_node *node, const char *req, char *res, void *udata) |
Callback for aerospike_info_foreach()
- Parameters
-
err | The status and possible error information for the info request. |
node | The node which provided the response. |
req | The initial request. |
res | The response to the info request. |
udata | The udata provided to the aerospike_info_foreach() |
- Returns
- TRUE to continue to the next info response. FALSE to stop processing.
Definition at line 56 of file aerospike_info.h.
◆ aerospike_info_any()
Send an info request to a node in the cluster. If node request fails, send request to the next node in the cluster. Repeat until the node request succeeds. The response must be freed by the caller on success.
char* res = NULL;
}
else {
free(res);
res = NULL;
}
AS_EXTERN as_status aerospike_info_any(aerospike *as, as_error *err, const as_policy_info *policy, const char *req, char **res)
- 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. |
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.
◆ aerospike_info_foreach()
Send an info request to the entire cluster.
}
AS_EXTERN 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)
The callback takes a response string. The caller should not free this string.
bool callback(
const as_error* err,
const as_node * node,
const char* req,
char* res,
void* udata) {
}
- 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.
◆ aerospike_info_host()
Send an info request to a specific host. The response must be freed by the caller on success.
char* res = NULL;
}
else {
free(res);
res = NULL;
}
AS_EXTERN as_status aerospike_info_host(aerospike *as, as_error *err, const as_policy_info *policy, const char *hostname, uint16_t port, const char *req, char **res)
This function does not support TLS nor the new user authentication protocol.
- Deprecated
- Use aerospike_info_node() or aerospike_info_any() instead.
- 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. |
hostname | 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.
◆ aerospike_info_node()
Send an info request to a specific server node. The response must be freed by the caller on success.
char* res = NULL;
}
else {
free(res);
}
AS_EXTERN as_status aerospike_info_node(aerospike *as, as_error *err, const as_policy_info *policy, as_node *node, const char *req, char **res)
- 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. |
node | The server node 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.
◆ aerospike_info_node_async()
Asynchronously send an info request to a specific server node.
{
if (err) {
printf(
"Command failed: %d %s\n", err->
code, err->
message);
return;
}
}
static as_status aerospike_info_node_async(aerospike *as, as_error *err, as_policy_info *policy, as_node *node, const char *req, as_async_info_listener listener, void *udata, as_event_loop *event_loop)
char message[AS_ERROR_MESSAGE_MAX_SIZE]
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The info policy. If NULL, the default info policy will be used. |
node | The server node to send the request to. |
req | The info request to send. |
listener | User function to be called with command results. |
udata | User data to be forwarded to user callback. |
event_loop | Event loop assigned to run this command. If NULL, an event loop will be chosen by round-robin. |
- Returns
- AEROSPIKE_OK on success. Otherwise an error.
Definition at line 126 of file aerospike_info.h.
References as_info_command_node_async().
◆ aerospike_info_socket_address()
Send an info request to a specific socket address. The response must be freed by the caller on success.
char* res = NULL;
}
else {
free(res);
res = NULL;
}
AS_EXTERN as_status aerospike_info_socket_address(aerospike *as, as_error *err, const as_policy_info *policy, struct sockaddr_in *sa_in, const char *req, char **res)
This function does not support TLS, IPv6 nor the new user authentication protocol.
- Deprecated
- Use aerospike_info_node() or aerospike_info_any() instead.
- 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. |
sa_in | The IP address and 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.