Loading...
Searching...
No Matches
as_info.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2023 Aerospike, Inc.
3 *
4 * Portions may be licensed to Aerospike, Inc. under one or more contributor
5 * license agreements.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8 * use this file except in compliance with the License. You may obtain a copy of
9 * the License at http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17#pragma once
18
19#include <aerospike/aerospike.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/******************************************************************************
28 * TYPES
29 *****************************************************************************/
30
31/**
32 * @private
33 * Name value pair.
34 */
35typedef struct as_name_value_s {
36 char* name;
37 char* value;
39
40/******************************************************************************
41 * FUNCTIONS
42 ******************************************************************************/
43
44/**
45 * @private
46 * Send info command to specific node. The values must be freed by the caller on success.
47 */
50 as_error* err, as_node* node, char* command, bool send_asis, uint64_t deadline_ms,
51 char** response
52 );
53
54/**
55 * @private
56 * Asynchronously send info command to specific node.
57 */
60 aerospike* as, as_error* err, as_policy_info* policy, as_node* node, const char* command,
61 as_async_info_listener listener, void* udata, as_event_loop* event_loop
62 );
63
64/**
65 * @private
66 * Send info command to random node. The values must be freed by the caller on success.
67 */
70
71/**
72 * @private
73 * Send info command to specific host. The values must be freed by the caller on success.
74 */
77 as_cluster* cluster, as_error* err, struct sockaddr* addr, char* command,
78 bool send_asis, uint64_t deadline_ms, char** response, const char* tls_name
79 );
80
81/**
82 * @private
83 * Send info command to specific socket. The values must be freed by the caller on success.
84 * Set max_response_length to zero if response size should not be bounded.
85 */
88 as_error* err, as_socket* sock, as_node* node, char* names, bool send_asis, uint64_t deadline_ms,
89 uint64_t max_response_length, char** values
90 );
91
92/**
93 * @private
94 * Create and authenticate socket for info requests.
95 */
98 as_cluster* cluster, as_error* err, struct sockaddr* addr, uint64_t deadline_ms,
99 const char* tls_name, as_socket* sock
100 );
101
102/**
103 * @private
104 * Check for errors in info response.
105 */
107as_info_validate(char* response, char** message);
108
109/**
110 * @private
111 * Validate an individual response in a multiple response info request.
112 */
114as_info_validate_item(as_error* err, char* response);
115
116/**
117 * @private
118 * Return the single command's info response buffer value.
119 * The original buffer will be modified with the null termination character.
120 */
122as_info_parse_single_response(char *values, char **value);
123
124/**
125 * @private
126 * Parse info response buffer into name/value pairs, one for each command.
127 * The original buffer will be modified with null termination characters to
128 * delimit each command name and value referenced by the name/value pairs.
129 */
130void
131as_info_parse_multi_response(char* buf, as_vector* /* <as_name_value> */ values);
132
133#ifdef __cplusplus
134} // end extern "C"
135#endif
as_status as_info_validate_item(as_error *err, char *response)
AS_EXTERN as_status as_info_parse_single_response(char *values, char **value)
AS_EXTERN as_status as_info_command_host(as_cluster *cluster, as_error *err, struct sockaddr *addr, char *command, bool send_asis, uint64_t deadline_ms, char **response, const char *tls_name)
as_status as_info_create_socket(as_cluster *cluster, as_error *err, struct sockaddr *addr, uint64_t deadline_ms, const char *tls_name, as_socket *sock)
AS_EXTERN as_status as_info_command_random_node(aerospike *as, as_error *err, as_policy_info *policy, char *command)
as_status as_info_validate(char *response, char **message)
void as_info_parse_multi_response(char *buf, as_vector *values)
AS_EXTERN as_status as_info_command_node(as_error *err, as_node *node, char *command, bool send_asis, uint64_t deadline_ms, char **response)
AS_EXTERN as_status as_info_command_node_async(aerospike *as, as_error *err, as_policy_info *policy, as_node *node, const char *command, as_async_info_listener listener, void *udata, as_event_loop *event_loop)
AS_EXTERN as_status as_info_command(as_error *err, as_socket *sock, as_node *node, char *names, bool send_asis, uint64_t deadline_ms, uint64_t max_response_length, char **values)
void(* as_async_info_listener)(as_error *err, char *response, void *udata, as_event_loop *event_loop)
Definition as_listener.h:85
as_status
Definition as_status.h:30
#define AS_EXTERN
Definition as_std.h:25
char * value
Definition as_info.h:37
char * name
Definition as_info.h:36