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

Functions

int deltacloud_get_images (struct deltacloud_api *api, struct deltacloud_image **images)
int deltacloud_get_image_by_id (struct deltacloud_api *api, const char *id, struct deltacloud_image *image)
int deltacloud_create_image (struct deltacloud_api *api, const char *name, struct deltacloud_instance *instance, struct deltacloud_create_parameter *params, int params_length, char **image_id)
void deltacloud_free_image (struct deltacloud_image *image)
void deltacloud_free_image_list (struct deltacloud_image **images)

Detailed Description


Function Documentation

int deltacloud_create_image ( struct deltacloud_api api,
const char *  name,
struct deltacloud_instance instance,
struct deltacloud_create_parameter params,
int  params_length,
char **  image_id 
)

A function to create a new image from a running instance.

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]nameThe name for the image
[in]instanceThe deltacloud_instance structure to create the image from
[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
[out]image_idThe image_id returned by the create call
Returns:
0 on success, -1 on error
void deltacloud_free_image ( struct deltacloud_image image)

A function to free a deltacloud_image structure initially allocated by deltacloud_get_image_by_id().

Parameters:
[in]imageThe deltacloud_image structure representing the image
void deltacloud_free_image_list ( struct deltacloud_image **  images)

A function to free a list of deltacloud_image structures initially allocated by deltacloud_get_images().

Parameters:
[in]imagesThe pointer to the head of the deltacloud_image list
int deltacloud_get_image_by_id ( struct deltacloud_api api,
const char *  id,
struct deltacloud_image image 
)

A function to look up a particular image by id. The caller is expected to free the deltacloud_image structure using deltacloud_free_image().

Parameters:
[in]apiThe deltacloud_api structure representing the connection
[in]idThe image ID to look for
[out]imageThe deltacloud_image structure to fill in if the ID is found
Returns:
0 on success, -1 if the image cannot be found or on error
int deltacloud_get_images ( struct deltacloud_api api,
struct deltacloud_image **  images 
)

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

Parameters:
[in]apiThe deltacloud_api structure representing this connection
[out]imagesA pointer to the deltacloud_image structure to hold the list of images
Returns:
0 on success, -1 on error
 All Data Structures Files Functions Variables