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

Functions

int deltacloud_get_storage_volumes (struct deltacloud_api *api, struct deltacloud_storage_volume **storage_volumes)
int deltacloud_get_storage_volume_by_id (struct deltacloud_api *api, const char *id, struct deltacloud_storage_volume *storage_volume)
int deltacloud_create_storage_volume (struct deltacloud_api *api, struct deltacloud_create_parameter *params, int params_length)
int deltacloud_storage_volume_destroy (struct deltacloud_api *api, struct deltacloud_storage_volume *storage_volume)
int deltacloud_storage_volume_attach (struct deltacloud_api *api, struct deltacloud_storage_volume *storage_volume, const char *instance_id, const char *device, struct deltacloud_create_parameter *params, int params_length)
int deltacloud_storage_volume_detach (struct deltacloud_api *api, struct deltacloud_storage_volume *storage_volume, struct deltacloud_create_parameter *params, int params_length)
void deltacloud_free_storage_volume (struct deltacloud_storage_volume *storage_volume)
void deltacloud_free_storage_volume_list (struct deltacloud_storage_volume **storage_volumes)

Detailed Description


Function Documentation

int deltacloud_create_storage_volume ( struct deltacloud_api api,
struct deltacloud_create_parameter params,
int  params_length 
)

A function to create a new storage volume.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[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_storage_volume ( struct deltacloud_storage_volume storage_volume)

A function to free a deltacloud_storage_volume structure initially allocated by deltacloud_get_storage_volume_by_id().

Parameters:
[in]storage_volumeThe deltacloud_storage_volume structure representing the storage volume
void deltacloud_free_storage_volume_list ( struct deltacloud_storage_volume **  storage_volumes)

A function to free a list of deltacloud_storage_volume structures initially allocated by deltacloud_get_storage_volumes().

Parameters:
[in]storage_volumesThe pointer to the head of the deltacloud_storage_volume list
int deltacloud_get_storage_volume_by_id ( struct deltacloud_api api,
const char *  id,
struct deltacloud_storage_volume storage_volume 
)

A function to look up a particular storage volume by id. The caller is expected to free the deltacloud_storage_volume structure using deltacloud_free_storage_volume().

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]idThe storage volume ID to look for
[out]storage_volumeThe deltacloud_storage_volume structure to fill in if the ID is found
Returns:
0 on success, -1 if the storage volume cannot be found or on error
int deltacloud_get_storage_volumes ( struct deltacloud_api api,
struct deltacloud_storage_volume **  storage_volumes 
)

A function to get a linked list of all of the storage volumes. The caller is expected to free the list using deltacloud_free_storage_volume_list().

Parameters:
[in]apiThe deltacloud_api structure representing this connection
[out]storage_volumesA pointer to the deltacloud_storage_volume structure to hold the list of storage volumes
Returns:
0 on success, -1 on error
int deltacloud_storage_volume_attach ( struct deltacloud_api api,
struct deltacloud_storage_volume storage_volume,
const char *  instance_id,
const char *  device,
struct deltacloud_create_parameter params,
int  params_length 
)

A function to attach a storage volume to an instance.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]storage_volumeThe deltacloud_storage_volume structure representing the storage volume to attach
[in]instance_idThe instance ID to attach the storage volume to
[in]deviceThe device name that the storage volume will be attached as
[in]paramsAn array of deltacloud_create_parameter structures that represent any optional parameters to pass into the register call
[in]params_lengthAn integer describing the length of the params array
Returns:
0 on success, -1 on error
int deltacloud_storage_volume_destroy ( struct deltacloud_api api,
struct deltacloud_storage_volume storage_volume 
)

A function to destroy a storage volume.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]storage_volumeThe deltacloud_storage_snapstho structure representing the storage volume
Returns:
0 on success, -1 on error
int deltacloud_storage_volume_detach ( struct deltacloud_api api,
struct deltacloud_storage_volume storage_volume,
struct deltacloud_create_parameter params,
int  params_length 
)

A function to detach a storage volume from an instance.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]storage_volumeThe deltacloud_storage_volume structure representing the storage volume to detach
[in]paramsAn array of deltacloud_create_parameter structures that represent any optional parameters to pass into the register call
[in]params_lengthAn integer describing the length of the params array
Returns:
0 on success, -1 on error
 All Data Structures Files Functions Variables