libdeltacloud 0.9
Functions
src/key.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "common.h"
#include "key.h"

Functions

int deltacloud_get_keys (struct deltacloud_api *api, struct deltacloud_key **keys)
int deltacloud_create_key (struct deltacloud_api *api, const char *name, struct deltacloud_create_parameter *params, int params_length)
int deltacloud_key_destroy (struct deltacloud_api *api, struct deltacloud_key *key)
int deltacloud_get_key_by_id (struct deltacloud_api *api, const char *id, struct deltacloud_key *key)
void deltacloud_free_key (struct deltacloud_key *key)
void deltacloud_free_key_list (struct deltacloud_key **keys)

Detailed Description


Function Documentation

int deltacloud_create_key ( struct deltacloud_api api,
const char *  name,
struct deltacloud_create_parameter params,
int  params_length 
)

A function to create a new key.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]nameThe name to give to the new key
[in]paramsAn array of deltacloud_create_parameter structures that represent any optional parameters to pass into the create call
[in]params_lengthAn integer describing the length of the params array
Returns:
0 on success, -1 on error
void deltacloud_free_key ( struct deltacloud_key key)

A function to free a deltacloud_key structure initially allocated by deltacloud_get_key_by_id().

Parameters:
[in]keyThe deltacloud_key structure representing the key
void deltacloud_free_key_list ( struct deltacloud_key **  keys)

A function to free a list of deltacloud_key structures initially allocated by deltacloud_get_keys().

Parameters:
[in]keysThe pointer to the head of the deltacloud_key list
int deltacloud_get_key_by_id ( struct deltacloud_api api,
const char *  id,
struct deltacloud_key key 
)

A function to look up a particular key by id. The caller is expected to free the deltacloud_key structure using deltacloud_free_key().

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]idThe key ID to look for
[out]keyThe deltacloud_key structure to fill in if the ID is found
Returns:
0 on success, -1 if the key cannot be found or on error
int deltacloud_get_keys ( struct deltacloud_api api,
struct deltacloud_key **  keys 
)

A function to get a linked list of all of the keys. The caller is expected to free the list using deltacloud_free_key_list().

Parameters:
[in]apiThe deltacloud_api structure representing this connection
[out]keysA pointer to the deltacloud_key structure to hold the list of keys
Returns:
0 on success, -1 on error
int deltacloud_key_destroy ( struct deltacloud_api api,
struct deltacloud_key key 
)

A function to destroy a key.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]keyThe deltacloud_key structure representing the key
Returns:
0 on success, -1 on error
 All Data Structures Files Functions Variables