Overview
EspUri objects are used to access or refer to a cluster and projects running in a cluster. From SDK's point of view a cluster is identified by a list of host/port values.
Enumeration Types
An EspUri object is used to refer to all cluster based components that the SDK can access.
- Enumerator:
| UNDEFINED_URI |
|
| SERVER_URI |
URI that refers to running server/cluster
|
| WORKSPACE_URI |
URI that refers to a workspace in a cluster
|
| PROJECT_URI |
URI that refers to a project in a cluster
|
| STREAM_URI |
URI that refers to a stream in a project
|
Functions |
| ESPAPICALL EspUri * | esp_uri_create_string (const char *const uri_string, EspError *error) |
| ESPAPICALL EspUri * | esp_uri_create (ESP_URI_T type, EspError *error) |
| ESPAPICALL int32_t | esp_uri_add_manager (EspUri *uri, const char *manager_host, const int32_t manager_port, EspError *error) |
| ESPAPICALL int32_t | esp_uri_add_manager_string (EspUri *uri, const char *manager_string, EspError *error) |
| ESPAPICALL int32_t | esp_uri_set_ssl (EspUri *uri, const int32_t ssl, EspError *error) |
| ESPAPICALL int32_t | esp_uri_set_server (EspUri *uri, const char *server, EspError *error) |
| ESPAPICALL int32_t | esp_uri_set_workspace (EspUri *uri, const char *workspace, EspError *error) |
| ESPAPICALL int32_t | esp_uri_set_project (EspUri *uri, const char *project, EspError *error) |
| ESPAPICALL int32_t | esp_uri_set_stream (EspUri *uri, const char *stream, EspError *error) |
| ESPAPICALL int32_t | esp_uri_free (EspUri *uri, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_type (const EspUri *uri, ESP_URI_T *type, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_server (const EspUri *uri, char *server, int32_t *size, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_managers (const EspUri *uri, EspList *managers, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_workspace (const EspUri *uri, char *workspace, int32_t *size, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_project (const EspUri *uri, char *project, int32_t *size, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_stream (const EspUri *uri, char *stream, int32_t *size, EspError *error) |
| ESPAPICALL int32_t | esp_uri_get_string (const EspUri *uri, char *uri_string, int32_t *size, EspError *error) |
Function Documentation
| ESPAPICALL int32_t esp_uri_add_manager |
( |
EspUri * |
uri, |
|
|
const char * |
manager_host, |
|
|
const int32_t |
manager_port, |
|
|
EspError * |
error |
|
) |
| |
Adds the connection details (host and port) for a manager.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to modify |
| manager_host | host where manager is running |
| manager_port | port number for manager xmlrpc |
| ESPAPICALL int32_t esp_uri_add_manager_string |
( |
EspUri * |
uri, |
|
|
const char * |
manager_string, |
|
|
EspError * |
error |
|
) |
| |
Adds the connection details for a manager as a preformatted string "[http[s]://]host:port" If multiple manager URIs are added and one of them has an https protocol, all manager connections are assumed to be https.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to modify |
| manager_string | Manager connection string using http/https protocol specification |
Create an emtpy uri object of type 'type'. The URI object should be freed using esp_uri_free().
- Returns:
- an unitialized URI object or NULL in case of error.
- Parameters:
-
| type | The type of uri to create. |
| ESPAPICALL EspUri* esp_uri_create_string |
( |
const char *const |
uri_string, |
|
|
EspError * |
error |
|
) |
| |
Creates an EspUri object from a string. SDK parses the string and determines the type of EspUri to create. The new EspUri * object should be freed using esp_uri_free(). The string needs to conform to the following format
esp[s]://host1:port1;host2:port2[/workspace/project/stream]
where
hostN:portN are the list of known cluster managers
workspace is the workspace being connected to
project is the project in the above workspace
stream is the stream in the project
- Returns:
- NULL in case of error
| ESPAPICALL int32_t esp_uri_free |
( |
EspUri * |
uri, |
|
|
EspError * |
error |
|
) |
| |
Frees the resources used by the EspUri object.
| ESPAPICALL int32_t esp_uri_get_managers |
( |
const EspUri * |
uri, |
|
|
EspList * |
managers, |
|
|
EspError * |
error |
|
) |
| |
Query for the list of managers defined in the EspUri.
- Returns:
- 0 on success.
- Parameters:
-
| ESPAPICALL int32_t esp_uri_get_project |
( |
const EspUri * |
uri, |
|
|
char * |
project, |
|
|
int32_t * |
size, |
|
|
EspError * |
error |
|
) |
| |
Query for the project name defined in the EspUri.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to query |
| project | Buffer to contain the project name |
| size | on entry size of the buffer being passed. On successful return size of the formatted string |
| ESPAPICALL int32_t esp_uri_get_server |
( |
const EspUri * |
uri, |
|
|
char * |
server, |
|
|
int32_t * |
size, |
|
|
EspError * |
error |
|
) |
| |
Query the server name in the EspUri.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to query |
| server | Pointer to a char * that will be filled in successful on return |
| size | on entry size of the buffer being passed. On successful return size of the formatted string |
| ESPAPICALL int32_t esp_uri_get_stream |
( |
const EspUri * |
uri, |
|
|
char * |
stream, |
|
|
int32_t * |
size, |
|
|
EspError * |
error |
|
) |
| |
- Parameters:
-
| uri | EspUri to query |
| stream | Buffer to contain the stream name |
| size | on entry size of the buffer being passed. On successful return size of the formatted string |
| ESPAPICALL int32_t esp_uri_get_string |
( |
const EspUri * |
uri, |
|
|
char * |
uri_string, |
|
|
int32_t * |
size, |
|
|
EspError * |
error |
|
) |
| |
Returns the formatted representation for the EspUri.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to query |
| uri_string | buffer to contain the formatted string |
| size | on entry, the size of the buffer being passed. On successful return, the size of the formatted string |
| ESPAPICALL int32_t esp_uri_get_type |
( |
const EspUri * |
uri, |
|
|
ESP_URI_T * |
type, |
|
|
EspError * |
error |
|
) |
| |
Query the type of this EspUri.
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to query |
| type | Pointer to an ESP_URI_T enum that will contain the type on return |
| ESPAPICALL int32_t esp_uri_get_workspace |
( |
const EspUri * |
uri, |
|
|
char * |
workspace, |
|
|
int32_t * |
size, |
|
|
EspError * |
error |
|
) |
| |
- Returns:
- 0 on success.
- Parameters:
-
| uri | EspUri to query |
| workspace | Buffer to contain the workspace name |
| size | on entry size of the buffer being passed. On successful return size of the formatted string |
| ESPAPICALL int32_t esp_uri_set_project |
( |
EspUri * |
uri, |
|
|
const char * |
project, |
|
|
EspError * |
error |
|
) |
| |
Set the name of project component. Will overwrite existing name if any.
- Returns:
- 0 on success.
| ESPAPICALL int32_t esp_uri_set_server |
( |
EspUri * |
uri, |
|
|
const char * |
server, |
|
|
EspError * |
error |
|
) |
| |
Set the name of the server component. Will overwrite existing name if any. A server specification string consists of semicolon delimited managers specs (for example, host1:port1;host2:port2).
- Returns:
- 0 on success.
| ESPAPICALL int32_t esp_uri_set_ssl |
( |
EspUri * |
uri, |
|
|
const int32_t |
ssl, |
|
|
EspError * |
error |
|
) |
| |
Sets all manager connections in this EspUri to use or not use SSL. Note that SSL can be turned on by explicitly specifying https protocol in the add_manager call. In that case, the last change made before the EspUri object is used in the SDK will be in effect.
- Returns:
- 0 on success.
- Parameters:
-
| ssl | non-zero to enable SSL |
| ESPAPICALL int32_t esp_uri_set_stream |
( |
EspUri * |
uri, |
|
|
const char * |
stream, |
|
|
EspError * |
error |
|
) |
| |
Set the name of stream component. Will overwrite existing name if any.
- Returns:
- 0 on success.
| ESPAPICALL int32_t esp_uri_set_workspace |
( |
EspUri * |
uri, |
|
|
const char * |
workspace, |
|
|
EspError * |
error |
|
) |
| |
Set the name of workspace component. Will overwrite existing name if any.
- Returns:
- 0 on success.