All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_info.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2017 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>
20 #include <aerospike/as_cluster.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /******************************************************************************
27  * TYPES
28  *****************************************************************************/
29 
30 /**
31  * @private
32  * Name value pair.
33  */
34 typedef struct as_name_value_s {
35  char* name;
36  char* value;
38 
39 /******************************************************************************
40  * FUNCTIONS
41  ******************************************************************************/
42 
43 /**
44  * @private
45  * Send info command to specific node. The values must be freed by the caller on success.
46  */
49  as_error* err, as_node* node, char* command, bool send_asis, uint64_t deadline_ms,
50  char** response
51  );
52 
53 /**
54  * @private
55  * Send info command to random node. The values must be freed by the caller on success.
56  */
58 as_info_command_random_node(aerospike* as, as_error* err, as_policy_info* policy, char* command);
59 
60 /**
61  * @private
62  * Send info command to specific host. The values must be freed by the caller on success.
63  */
66  as_cluster* cluster, as_error* err, struct sockaddr* addr, char* command,
67  bool send_asis, uint64_t deadline_ms, char** response, const char* tls_name
68  );
69 
70 /**
71  * @private
72  * Send info command to specific socket. The values must be freed by the caller on success.
73  * Set max_response_length to zero if response size should not be bounded.
74  */
77  as_error* err, as_socket* sock, char* names, bool send_asis, uint64_t deadline_ms,
78  uint64_t max_response_length, char** values
79  );
80 
81 /**
82  * @private
83  * Create and authenticate socket for info requests.
84  */
87  as_cluster* cluster, as_error* err, struct sockaddr* addr, uint64_t deadline_ms,
88  const char* tls_name, as_socket* sock
89  );
90 
91 /**
92  * @private
93  * Return the single command's info response buffer value.
94  * The original buffer will be modified with the null termination character.
95  */
97 as_info_parse_single_response(char *values, char **value);
98 
99 /**
100  * @private
101  * Parse info response buffer into name/value pairs, one for each command.
102  * The original buffer will be modified with null termination characters to
103  * delimit each command name and value referenced by the name/value pairs.
104  */
105 void
106 as_info_parse_multi_response(char* buf, as_vector* /* <as_name_value> */ values);
107 
108 #ifdef __cplusplus
109 } // end extern "C"
110 #endif
as_status
Definition: as_status.h:30
void as_info_parse_multi_response(char *buf, as_vector *values)
as_status as_info_command_random_node(aerospike *as, as_error *err, as_policy_info *policy, char *command)
as_status as_info_command_node(as_error *err, as_node *node, char *command, bool send_asis, uint64_t deadline_ms, char **response)
as_status as_info_parse_single_response(char *values, char **value)
char * value
Definition: as_info.h:36
char * name
Definition: as_info.h:35
as_status as_info_command(as_error *err, as_socket *sock, char *names, bool send_asis, uint64_t deadline_ms, uint64_t max_response_length, char **values)
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_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)