#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "curl_action.h"
#include "bucket.h"
Functions |
int | deltacloud_get_buckets (struct deltacloud_api *api, struct deltacloud_bucket **buckets) |
int | deltacloud_get_bucket_by_id (struct deltacloud_api *api, const char *id, struct deltacloud_bucket *bucket) |
int | deltacloud_create_bucket (struct deltacloud_api *api, const char *name, struct deltacloud_create_parameter *params, int params_length) |
int | deltacloud_bucket_create_blob_from_file (struct deltacloud_api *api, struct deltacloud_bucket *bucket, const char *blob_name, const char *filename, struct deltacloud_create_parameter *params, int params_length) |
int | deltacloud_bucket_get_blob_by_id (struct deltacloud_api *api, struct deltacloud_bucket *bucket, const char *name, struct deltacloud_bucket_blob *blob) |
int | deltacloud_bucket_blob_update_metadata (struct deltacloud_api *api, struct deltacloud_bucket_blob *blob, struct deltacloud_create_parameter *params, int params_length) |
int | deltacloud_bucket_blob_get_content (struct deltacloud_api *api, struct deltacloud_bucket_blob *blob, char **output) |
int | deltacloud_bucket_delete_blob (struct deltacloud_api *api, struct deltacloud_bucket_blob *blob) |
void | deltacloud_free_bucket_blob (struct deltacloud_bucket_blob *blob) |
int | deltacloud_bucket_destroy (struct deltacloud_api *api, struct deltacloud_bucket *bucket) |
void | deltacloud_free_bucket (struct deltacloud_bucket *bucket) |
void | deltacloud_free_bucket_list (struct deltacloud_bucket **buckets) |
Detailed Description
Function Documentation
A function to get the contents of a blob. It is the responsibility of the caller to free the memory returned in output.
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | blob | The deltacloud_bucket_blob structure representing the blob |
[out] | output | A pointer to an memory location to store the blob contents |
- Returns:
- 0 on success, -1 on error
A function to update the metadata on a blob.
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | blob | The deltacloud_bucket_blob structure representing the blob |
[in] | params | An array of deltacloud_create_parameter structures that represent the key/value pairs of metadata to update |
[in] | params_length | An integer describing the length of the params array |
- Returns:
- 0 on success, -1 on error
A function to create a new blob in a bucket.
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | bucket | The deltacloud_bucket representing the bucket in which to create the blob |
[in] | blob_name | The name to give to the new blob |
[in] | filename | The filename from which to read the data for the blob |
[in] | params | An array of deltacloud_create_parameter structures that represent any optional parameters to pass into the create call |
[in] | params_length | An integer describing the length of the params array |
- Returns:
- 0 on success, -1 on error
A function to delete a blob.
- Parameters:
-
- Returns:
- 0 on success, -1 on error
A function to destroy a bucket.
- Parameters:
-
- Returns:
- 0 on success, -1 on error
A function to lookup a blob by id. It is up to the caller to free the structure with deltacloud_free_bucket_blob().
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | bucket | The deltacloud_bucket representing the bucket in which to look for the blob |
[in] | name | The name of the blob to lookup |
[out] | blob | The deltacloud_bucket_blob structure that will be filled in if the blob is found |
- Returns:
- 0 on success, -1 on error or if the blob could not be found
A function to create a new bucket.
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | name | The name to give to the new bucket |
[in] | params | An array of deltacloud_create_parameter structures that represent any optional parameters to pass into the create call |
[in] | params_length | An integer describing the length of the params array |
- Returns:
- 0 on success, -1 on error
A function to look up a particular bucket by id. The caller is expected to free the deltacloud_bucket structure using deltacloud_free_bucket().
- Parameters:
-
[in] | api | The deltacloud_api structure representing the connection |
[in] | id | The bucket ID to look for |
[out] | bucket | The deltacloud_bucket structure to fill in if the ID is found |
- Returns:
- 0 on success, -1 if the bucket cannot be found or on error
A function to get a linked list of all of the buckets defined. The caller is expected to free the list using deltacloud_free_bucket_list().
- Parameters:
-
- Returns:
- 0 on success, -1 on error