#include "libstoragemgmt/libstoragemgmt.h"
#include "libstoragemgmt/libstoragemgmt_error.h"
#include "libstoragemgmt/libstoragemgmt_plug_interface.h"
#include "libstoragemgmt/libstoragemgmt_types.h"
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <libxml/uri.h>
#include "lsm_datatypes.hpp"
#include "lsm_convert.hpp"
Go to the source code of this file.
Defines | |
#define | COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) |
#define | POOL_SEARCH_KEYS_COUNT COUNT_OF(POOL_SEARCH_KEYS) |
#define | VOLUME_SEARCH_KEYS_COUNT COUNT_OF(VOLUME_SEARCH_KEYS) |
#define | DISK_SEARCH_KEYS_COUNT COUNT_OF(DISK_SEARCH_KEYS) |
#define | FS_SEARCH_KEYS_COUNT COUNT_OF(FS_SEARCH_KEYS) |
#define | NFS_EXPORT_SEARCH_KEYS_COUNT COUNT_OF(NFS_EXPORT_SEARCH_KEYS) |
#define | ACCESS_GROUP_SEARCH_KEYS_COUNT COUNT_OF(ACCESS_GROUP_SEARCH_KEYS) |
#define | TARGET_PORT_SEARCH_KEYS_COUNT COUNT_OF(TARGET_PORT_SEARCH_KEYS) |
#define | CONN_SETUP(c) |
#define | CHECK_STR(x) ( !(x) || !strlen(x) ) |
#define | CHECK_RP(x) (!(x) || *(x) != NULL) |
Typedefs | |
typedef void *(* | convert )(Value &v) |
Functions | |
int | lsm_initiator_id_verify (const char *init_id, lsm_access_group_init_type *init_type) |
int | lsm_volume_vpd83_verify (const char *vpd83) |
int | lsm_connect_password (const char *uri, const char *password, lsm_connect **conn, uint32_t timeout, lsm_error_ptr *e, lsm_flag flags) |
int | lsm_connect_close (lsm_connect *c, lsm_flag flags) |
int | lsm_plugin_info_get (lsm_connect *c, char **desc, char **version, lsm_flag flags) |
int | lsm_available_plugins_list (const char *sep, lsm_string_list **plugins, lsm_flag flags) |
int | lsm_connect_timeout_set (lsm_connect *c, uint32_t timeout, lsm_flag flags) |
int | lsm_connect_timeout_get (lsm_connect *c, uint32_t *timeout, lsm_flag flags) |
int | lsm_job_status_get (lsm_connect *c, const char *job_id, lsm_job_status *status, uint8_t *percentComplete, lsm_flag flags) |
int | lsm_job_status_pool_get (lsm_connect *c, const char *job, lsm_job_status *status, uint8_t *percentComplete, lsm_pool **pool, lsm_flag flags) |
int | lsm_job_status_volume_get (lsm_connect *c, const char *job, lsm_job_status *status, uint8_t *percentComplete, lsm_volume **vol, lsm_flag flags) |
int | lsm_job_status_fs_get (lsm_connect *c, const char *job, lsm_job_status *status, uint8_t *percentComplete, lsm_fs **fs, lsm_flag flags) |
int | lsm_job_status_ss_get (lsm_connect *c, const char *job, lsm_job_status *status, uint8_t *percentComplete, lsm_fs_ss **ss, lsm_flag flags) |
int | lsm_job_free (lsm_connect *c, char **job, lsm_flag flags) |
int | lsm_capabilities (lsm_connect *c, lsm_system *system, lsm_storage_capabilities **cap, lsm_flag flags) |
int | lsm_pool_list (lsm_connect *c, char *search_key, char *search_value, lsm_pool **poolArray[], uint32_t *count, lsm_flag flags) |
int | lsm_pool_member_info (lsm_connect *c, lsm_pool *pool, lsm_volume_raid_type *raid_type, lsm_pool_member_type *member_type, lsm_string_list **member_ids, lsm_flag flags) |
int | lsm_target_port_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_target_port **target_ports[], uint32_t *count, lsm_flag flags) |
int | lsm_volume_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_volume **volumes[], uint32_t *count, lsm_flag flags) |
int | lsm_disk_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_disk **disks[], uint32_t *count, lsm_flag flags) |
int | lsm_volume_create (lsm_connect *c, lsm_pool *pool, const char *volumeName, uint64_t size, lsm_volume_provision_type provisioning, lsm_volume **newVolume, char **job, lsm_flag flags) |
int | lsm_volume_resize (lsm_connect *c, lsm_volume *volume, uint64_t newSize, lsm_volume **resizedVolume, char **job, lsm_flag flags) |
int | lsm_volume_replicate (lsm_connect *c, lsm_pool *pool, lsm_replication_type repType, lsm_volume *volumeSrc, const char *name, lsm_volume **newReplicant, char **job, lsm_flag flags) |
int | lsm_volume_replicate_range_block_size (lsm_connect *c, lsm_system *system, uint32_t *bs, lsm_flag flags) |
int | lsm_volume_replicate_range (lsm_connect *c, lsm_replication_type repType, lsm_volume *source, lsm_volume *dest, lsm_block_range **ranges, uint32_t num_ranges, char **job, lsm_flag flags) |
int | lsm_volume_delete (lsm_connect *c, lsm_volume *volume, char **job, lsm_flag flags) |
int | lsm_volume_raid_info (lsm_connect *c, lsm_volume *volume, lsm_volume_raid_type *raid_type, uint32_t *strip_size, uint32_t *disk_count, uint32_t *min_io_size, uint32_t *opt_io_size, lsm_flag flags) |
int | lsm_iscsi_chap_auth (lsm_connect *c, const char *init_id, const char *username, const char *password, const char *out_user, const char *out_password, lsm_flag flags) |
int | lsm_volume_enable (lsm_connect *c, lsm_volume *volume, lsm_flag flags) |
int | lsm_volume_disable (lsm_connect *c, lsm_volume *volume, lsm_flag flags) |
int | lsm_access_group_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_access_group **groups[], uint32_t *groupCount, lsm_flag flags) |
int | lsm_access_group_create (lsm_connect *c, const char *name, const char *init_id, lsm_access_group_init_type init_type, lsm_system *system, lsm_access_group **access_group, lsm_flag flags) |
int | lsm_access_group_delete (lsm_connect *c, lsm_access_group *access_group, lsm_flag flags) |
int | lsm_access_group_initiator_add (lsm_connect *c, lsm_access_group *access_group, const char *init_id, lsm_access_group_init_type init_type, lsm_access_group **updated_access_group, lsm_flag flags) |
int | lsm_access_group_initiator_delete (lsm_connect *c, lsm_access_group *access_group, const char *init_id, lsm_access_group_init_type init_type, lsm_access_group **updated_access_group, lsm_flag flags) |
int | lsm_volume_mask (lsm_connect *c, lsm_access_group *access_group, lsm_volume *volume, lsm_flag flags) |
int | lsm_volume_unmask (lsm_connect *c, lsm_access_group *group, lsm_volume *volume, lsm_flag flags) |
int | lsm_volumes_accessible_by_access_group (lsm_connect *c, lsm_access_group *group, lsm_volume **volumes[], uint32_t *count, lsm_flag flags) |
int | lsm_access_groups_granted_to_volume (lsm_connect *c, lsm_volume *volume, lsm_access_group **groups[], uint32_t *groupCount, lsm_flag flags) |
int | lsm_volume_child_dependency (lsm_connect *c, lsm_volume *volume, uint8_t *yes, lsm_flag flags) |
int | lsm_volume_child_dependency_delete (lsm_connect *c, lsm_volume *volume, char **job, lsm_flag flags) |
int | lsm_system_list (lsm_connect *c, lsm_system **systems[], uint32_t *systemCount, lsm_flag flags) |
int | lsm_fs_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_fs **fs[], uint32_t *fsCount, lsm_flag flags) |
int | lsm_fs_create (lsm_connect *c, lsm_pool *pool, const char *name, uint64_t size_bytes, lsm_fs **fs, char **job, lsm_flag flags) |
int | lsm_fs_delete (lsm_connect *c, lsm_fs *fs, char **job, lsm_flag flags) |
int | lsm_fs_resize (lsm_connect *c, lsm_fs *fs, uint64_t new_size_bytes, lsm_fs **rfs, char **job, lsm_flag flags) |
int | lsm_fs_clone (lsm_connect *c, lsm_fs *src_fs, const char *name, lsm_fs_ss *optional_ss, lsm_fs **cloned_fs, char **job, lsm_flag flags) |
int | lsm_fs_file_clone (lsm_connect *c, lsm_fs *fs, const char *src_file_name, const char *dest_file_name, lsm_fs_ss *snapshot, char **job, lsm_flag flags) |
int | lsm_fs_child_dependency (lsm_connect *c, lsm_fs *fs, lsm_string_list *files, uint8_t *yes, lsm_flag flags) |
int | lsm_fs_child_dependency_delete (lsm_connect *c, lsm_fs *fs, lsm_string_list *files, char **job, lsm_flag flags) |
int | lsm_fs_ss_list (lsm_connect *c, lsm_fs *fs, lsm_fs_ss **ss[], uint32_t *ssCount, lsm_flag flags) |
int | lsm_fs_ss_create (lsm_connect *c, lsm_fs *fs, const char *name, lsm_fs_ss **snapshot, char **job, lsm_flag flags) |
int | lsm_fs_ss_delete (lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss, char **job, lsm_flag flags) |
int | lsm_fs_ss_restore (lsm_connect *c, lsm_fs *fs, lsm_fs_ss *ss, lsm_string_list *files, lsm_string_list *restore_files, int all_files, char **job, lsm_flag flags) |
int | lsm_nfs_list (lsm_connect *c, const char *search_key, const char *search_value, lsm_nfs_export **exports[], uint32_t *count, lsm_flag flags) |
int | lsm_nfs_export_fs (lsm_connect *c, const char *fs_id, const char *export_path, lsm_string_list *root_list, lsm_string_list *rw_list, lsm_string_list *ro_list, uint64_t anon_uid, uint64_t anon_gid, const char *auth_type, const char *options, lsm_nfs_export **exported, lsm_flag flags) |
int | lsm_nfs_export_delete (lsm_connect *c, lsm_nfs_export *e, lsm_flag flags) |
int | lsm_volume_raid_create_cap_get (lsm_connect *c, lsm_system *system, uint32_t **supported_raid_types, uint32_t *supported_raid_type_count, uint32_t **supported_strip_sizes, uint32_t *supported_strip_size_count, lsm_flag flags) |
int | lsm_volume_raid_create (lsm_connect *c, const char *name, lsm_volume_raid_type raid_type, lsm_disk *disks[], uint32_t disk_count, uint32_t strip_size, lsm_volume **new_volume, lsm_flag flags) |
#define ACCESS_GROUP_SEARCH_KEYS_COUNT COUNT_OF(ACCESS_GROUP_SEARCH_KEYS) |
Definition at line 56 of file lsm_mgmt.cpp.
#define CHECK_RP | ( | x | ) | (!(x) || *(x) != NULL) |
When we pass in a pointer for an out value we want to make sure that the pointer isn't null, and that the dereferenced value is != NULL to prevent memory leaks.
Definition at line 180 of file lsm_mgmt.cpp.
#define CHECK_STR | ( | x | ) | ( !(x) || !strlen(x) ) |
Strings are non null with a len >= 1
Definition at line 173 of file lsm_mgmt.cpp.
#define CONN_SETUP | ( | c | ) |
do { \ if(!LSM_IS_CONNECT(c)) { \ return LSM_ERR_INVALID_ARGUMENT;\ } \ lsm_error_free(c->error); \ c->error = NULL; \ } while (0)
Common code to validate and initialize the connection.
Definition at line 65 of file lsm_mgmt.cpp.
#define COUNT_OF | ( | x | ) | ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) |
Definition at line 31 of file lsm_mgmt.cpp.
#define DISK_SEARCH_KEYS_COUNT COUNT_OF(DISK_SEARCH_KEYS) |
Definition at line 44 of file lsm_mgmt.cpp.
#define FS_SEARCH_KEYS_COUNT COUNT_OF(FS_SEARCH_KEYS) |
Definition at line 48 of file lsm_mgmt.cpp.
#define NFS_EXPORT_SEARCH_KEYS_COUNT COUNT_OF(NFS_EXPORT_SEARCH_KEYS) |
Definition at line 52 of file lsm_mgmt.cpp.
#define POOL_SEARCH_KEYS_COUNT COUNT_OF(POOL_SEARCH_KEYS) |
Definition at line 36 of file lsm_mgmt.cpp.
#define TARGET_PORT_SEARCH_KEYS_COUNT COUNT_OF(TARGET_PORT_SEARCH_KEYS) |
Definition at line 60 of file lsm_mgmt.cpp.
#define VOLUME_SEARCH_KEYS_COUNT COUNT_OF(VOLUME_SEARCH_KEYS) |
Definition at line 40 of file lsm_mgmt.cpp.
Definition at line 1057 of file lsm_mgmt.cpp.
int lsm_access_group_create | ( | lsm_connect * | conn, | |
const char * | name, | |||
const char * | init_id, | |||
lsm_access_group_init_type | init_type, | |||
lsm_system * | system, | |||
lsm_access_group ** | access_group, | |||
lsm_flag | flags | |||
) |
Creates a new access group with one initiator in it.
[in] | conn | Valid connection |
[in] | name | Name of access group |
[in] | init_id | Initiator id to be added to group |
[in] | init_type | Initiator type |
[in] | system | System to create access group for |
[out] | access_group | Returned access group |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1437 of file lsm_mgmt.cpp.
int lsm_access_group_delete | ( | lsm_connect * | conn, | |
lsm_access_group * | access_group, | |||
lsm_flag | flags | |||
) |
Deletes an access group.
[in] | conn | Valid connection |
[in] | access_group | Group to delete |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1486 of file lsm_mgmt.cpp.
int lsm_access_group_initiator_add | ( | lsm_connect * | conn, | |
lsm_access_group * | access_group, | |||
const char * | init_id, | |||
lsm_access_group_init_type | init_type, | |||
lsm_access_group ** | updated_access_group, | |||
lsm_flag | flags | |||
) |
Adds an initiator to the access group
[in] | conn | Valid connection |
[in] | access_group | Group to modify |
[in] | init_id | Initiator to add to group |
[in] | init_type | Type of initiator |
[out] | updated_access_group | Updated access group |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1553 of file lsm_mgmt.cpp.
int lsm_access_group_initiator_delete | ( | lsm_connect * | conn, | |
lsm_access_group * | access_group, | |||
const char * | initiator_id, | |||
lsm_access_group_init_type | init_type, | |||
lsm_access_group ** | updated_access_group, | |||
lsm_flag | flags | |||
) |
Removes an initiator from an access group.
[in] | conn | Valid connection |
[in] | access_group | Group to modify |
[in] | initiator_id | Initiator to delete from group |
[in] | init_type | Type of initiator, enumerated type |
[out] | updated_access_group | Updated access group |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1565 of file lsm_mgmt.cpp.
int lsm_access_group_list | ( | lsm_connect * | conn, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_access_group ** | groups[], | |||
uint32_t * | group_count, | |||
lsm_flag | flags | |||
) |
Retrieves a list of access groups.
[in] | conn | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | groups | Array of access groups |
[out] | group_count | Size of array |
[in] | flags | Reserved set to zero |
Definition at line 1409 of file lsm_mgmt.cpp.
int lsm_access_groups_granted_to_volume | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
lsm_access_group ** | groups[], | |||
uint32_t * | group_count, | |||
lsm_flag | flags | |||
) |
Retrieves the access groups that have access to the specified volume.
[in] | conn | Valid connection |
[in] | volume | Valid volume |
[out] | groups | An array of access groups |
[out] | group_count | Number of access groups |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1682 of file lsm_mgmt.cpp.
int lsm_available_plugins_list | ( | const char * | sep, | |
lsm_string_list ** | plugins, | |||
lsm_flag | flags | |||
) |
Retrieve a list of available plug-ins.
[in] | sep | Return data separator |
[out] | plugins | String list of plug-ins with the form desc<sep>version |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 405 of file lsm_mgmt.cpp.
int lsm_capabilities | ( | lsm_connect * | conn, | |
lsm_system * | system, | |||
lsm_storage_capabilities ** | cap, | |||
lsm_flag | flags | |||
) |
Storage system query functions Query the capabilities of the storage array.
[in] | conn | Valid connection |
[in] | system | System of interest |
[out] | cap | The storage array capabilities |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 757 of file lsm_mgmt.cpp.
int lsm_connect_close | ( | lsm_connect * | conn, | |
lsm_flag | flags | |||
) |
Closes a connection to a storage provider.
[in] | conn | Valid connection to close |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 333 of file lsm_mgmt.cpp.
int lsm_connect_password | ( | const char * | uri, | |
const char * | password, | |||
lsm_connect ** | conn, | |||
uint32_t | timeout, | |||
lsm_error_ptr * | e, | |||
lsm_flag | flags | |||
) |
Get a connection to a storage provider.
[in] | uri | Uniform Resource Identifier (see URI documentation) |
[in] | password | Password for the storage array (optional, can be NULL) |
[out] | conn | The connection to use for all the other library calls |
[in] | timeout | Time-out in milliseconds, (initial value). |
[out] | e | Error data if connection failed. |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 182 of file lsm_mgmt.cpp.
int lsm_connect_timeout_get | ( | lsm_connect * | conn, | |
uint32_t * | timeout, | |||
lsm_flag | flags | |||
) |
Gets the time-out for this connection.
[in] | conn | Valid connection |
[out] | timeout | Time-out (in ms) |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 524 of file lsm_mgmt.cpp.
int lsm_connect_timeout_set | ( | lsm_connect * | conn, | |
uint32_t | timeout, | |||
lsm_flag | flags | |||
) |
Sets the time-out for this connection.
[in] | conn | Valid connection |
[in] | timeout | Time-out (in ms) |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 506 of file lsm_mgmt.cpp.
int lsm_disk_list | ( | lsm_connect * | conn, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_disk ** | disks[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Get a list of disk for this array.
[in] | conn | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | disks | An array of lsm_disk types |
[out] | count | Number of disks |
[in] | flags | Reserved set to zero |
Definition at line 1031 of file lsm_mgmt.cpp.
int lsm_fs_child_dependency | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
lsm_string_list * | files, | |||
uint8_t * | yes, | |||
lsm_flag | flags | |||
) |
Checks to see if the specified file system has a child dependency.
[in] | conn | Valid connection |
[in] | fs | Specific file system |
[in] | files | Specific files to check (NULL OK) |
[out] | yes | Zero indicates no, else yes |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2041 of file lsm_mgmt.cpp.
int lsm_fs_child_dependency_delete | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
lsm_string_list * | files, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Removes child dependencies by duplicating the required storage to remove. Note: This could take a long time to complete based on dependencies.
[in] | conn | Valid connection |
[in] | fs | File system to remove dependencies for |
[in] | files | Specific files to check (NULL OK) |
[out] | job | Job id for async. identification |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2076 of file lsm_mgmt.cpp.
int lsm_fs_clone | ( | lsm_connect * | conn, | |
lsm_fs * | src_fs, | |||
const char * | name, | |||
lsm_fs_ss * | optional_ss, | |||
lsm_fs ** | cloned_fs, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Clones an existing file system
conn | Valid connection | |
src_fs | Source file system | |
name | Name of new file system | |
optional_ss | Optional snapshot to base clone from | |
cloned_fs | Newly cloned file system record | |
job | Job id if operation is async. | |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1975 of file lsm_mgmt.cpp.
int lsm_fs_create | ( | lsm_connect * | conn, | |
lsm_pool * | pool, | |||
const char * | name, | |||
uint64_t | size_bytes, | |||
lsm_fs ** | fs, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Creates a new file system from the specified pool
[in] | conn | Valid connection |
[in] | pool | Valid pool |
[in] | name | File system name |
[in] | size_bytes | Size of file system in bytes |
[out] | fs | Newly created fs |
[out] | job | Job id if job is async. |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1893 of file lsm_mgmt.cpp.
int lsm_fs_delete | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Deletes a file system
[in] | conn | Valid connection |
fs | File system to delete | |
job | Job id if job is created async. | |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1932 of file lsm_mgmt.cpp.
int lsm_fs_file_clone | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
const char * | src_file_name, | |||
const char * | dest_file_name, | |||
lsm_fs_ss * | snapshot, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Clones a file on a file system.
[in] | conn | Valid connection |
[in] | fs | File system which file resides |
[in] | src_file_name | Source file relative name & path |
[in] | dest_file_name | Dest. file relative name & path |
[in] | snapshot | Optional backing snapshot |
[out] | job | Job id for async. operation |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2003 of file lsm_mgmt.cpp.
int lsm_fs_list | ( | lsm_connect * | conn, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_fs ** | fs[], | |||
uint32_t * | fs_count, | |||
lsm_flag | flags | |||
) |
Retrieves information about the available file systems.
[in] | conn | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | fs | Array of lsm_fs |
[out] | fs_count | Number of file systems |
[in] | flags | Reserved set to zero |
Definition at line 1829 of file lsm_mgmt.cpp.
int lsm_fs_resize | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
uint64_t | new_size_bytes, | |||
lsm_fs ** | rfs, | |||
char ** | job_id, | |||
lsm_flag | flags | |||
) |
Resizes a file system
[in] | conn | Valid connection |
[in] | fs | File system to re-size |
[in] | new_size_bytes | New size of fs |
[out] | rfs | File system information for re-sized fs |
[out] | job_id | Job id for async. identification |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1948 of file lsm_mgmt.cpp.
int lsm_fs_ss_create | ( | lsm_connect * | c, | |
lsm_fs * | fs, | |||
const char * | name, | |||
lsm_fs_ss ** | snapshot, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Creates a snapshot
[in] | c | Valid connection |
[in] | fs | File system to snapshot |
[in] | name | Name of snap shot |
[out] | snapshot | Snapshot that was created |
[out] | job | Job id if the operation is async. |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2161 of file lsm_mgmt.cpp.
int lsm_fs_ss_delete | ( | lsm_connect * | c, | |
lsm_fs * | fs, | |||
lsm_fs_ss * | ss, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Deletes a snapshot
[in] | c | Valid connection |
[in] | fs | File system |
[in] | ss | Snapshot to delete |
[out] | job | Job id if the operation is async. |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2192 of file lsm_mgmt.cpp.
int lsm_fs_ss_list | ( | lsm_connect * | conn, | |
lsm_fs * | fs, | |||
lsm_fs_ss ** | ss[], | |||
uint32_t * | ss_count, | |||
lsm_flag | flags | |||
) |
Return a list of snapshots
[in] | conn | Valid connection |
[in] | fs | File system to check for snapshots |
[out] | ss | An array of snapshot pointers |
[out] | ss_count | Number of elements in the array |
[in] | flags | Reserved set to zero |
Definition at line 2103 of file lsm_mgmt.cpp.
int lsm_fs_ss_restore | ( | lsm_connect * | c, | |
lsm_fs * | fs, | |||
lsm_fs_ss * | ss, | |||
lsm_string_list * | files, | |||
lsm_string_list * | restore_files, | |||
int | all_files, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Restores a file system or files to a previous state as specified in the snapshot.
c | Valid connection | |
fs | File system which contains the snapshot | |
ss | Snapshot to restore to | |
files | Optional list of files to restore | |
restore_files | Optional list of file names to restore to | |
all_files | 0 = False else True | |
job | Job id if operation is async. | |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2221 of file lsm_mgmt.cpp.
int lsm_initiator_id_verify | ( | const char * | init_id, | |
lsm_access_group_init_type * | init_type | |||
) |
Checks to see if initiator id is valid
init_id | Initiator value | |
init_type | Type of initiator id, will get modified to determined if type passed in is UNKNOWN |
Definition at line 86 of file lsm_mgmt.cpp.
int lsm_iscsi_chap_auth | ( | lsm_connect * | conn, | |
const char * | init_id, | |||
const char * | in_user, | |||
const char * | in_password, | |||
const char * | out_user, | |||
const char * | out_password, | |||
lsm_flag | flags | |||
) |
Set the username password for CHAP authentication, inbound and outbound.
conn | Valid connection pointer | |
init_id | Initiator ID | |
in_user | inbound user name | |
in_password | inbound password | |
out_user | outbound user name | |
out_password | outbound password | |
flags | Reserved for future use, must be zero. |
Definition at line 1351 of file lsm_mgmt.cpp.
int lsm_job_free | ( | lsm_connect * | conn, | |
char ** | job_id, | |||
lsm_flag | flags | |||
) |
Frees the resources used by a job.
[in] | conn | Valid connection pointer |
[in] | job_id | Job ID |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 733 of file lsm_mgmt.cpp.
int lsm_job_status_fs_get | ( | lsm_connect * | conn, | |
const char * | job_id, | |||
lsm_job_status * | status, | |||
uint8_t * | percent_complete, | |||
lsm_fs ** | fs, | |||
lsm_flag | flags | |||
) |
Check on the status of a job and return the fs information when complete.
[in] | conn | Valid connection pointer |
[in] | job_id | Job to check |
[out] | status | What is the job status |
[out] | percent_complete | Percent of job complete |
[out] | fs | lsm_fs * for the completed operation |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 667 of file lsm_mgmt.cpp.
int lsm_job_status_get | ( | lsm_connect * | conn, | |
const char * | job_id, | |||
lsm_job_status * | status, | |||
uint8_t * | percent_complete, | |||
lsm_flag | flags | |||
) |
Check on the status of a job, no data to return on completion.
[in] | conn | Valid connection |
[in] | job_id | Job id |
[out] | status | Job Status |
[out] | percent_complete | Percent job complete |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 583 of file lsm_mgmt.cpp.
int lsm_job_status_pool_get | ( | lsm_connect * | conn, | |
const char * | job_id, | |||
lsm_job_status * | status, | |||
uint8_t * | percent_complete, | |||
lsm_pool ** | pool, | |||
lsm_flag | flags | |||
) |
Check on the status of a job and return the pool information when complete
[in] | conn | Valid connection pointer |
[in] | job_id | Job to check status on |
[out] | status | What is the job status |
[out] | percent_complete | Domain 0..100 |
[out] | pool | lsm_pool for completed operation |
[in] | flags | Reserved for future use, must be zero |
Definition at line 597 of file lsm_mgmt.cpp.
int lsm_job_status_ss_get | ( | lsm_connect * | c, | |
const char * | job, | |||
lsm_job_status * | status, | |||
uint8_t * | percent_complete, | |||
lsm_fs_ss ** | ss, | |||
lsm_flag | flags | |||
) |
Check on the status of a job and return the snapshot information when compete.
[in] | c | Valid connection pointer |
[in] | job | Job id to check |
[out] | status | Job status |
[out] | percent_complete | Percent complete |
[out] | ss | Snap shot information |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 700 of file lsm_mgmt.cpp.
int lsm_job_status_volume_get | ( | lsm_connect * | conn, | |
const char * | job_id, | |||
lsm_job_status * | status, | |||
uint8_t * | percent_complete, | |||
lsm_volume ** | vol, | |||
lsm_flag | flags | |||
) |
Check on the status of a job and returns the volume information when complete.
[in] | conn | Valid connection pointer. |
[in] | job_id | Job to check status on |
[out] | status | What is the job status |
[out] | percent_complete | Domain 0..100 |
[out] | vol | lsm_volume for completed operation. |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 632 of file lsm_mgmt.cpp.
int lsm_nfs_export_delete | ( | lsm_connect * | c, | |
lsm_nfs_export * | e, | |||
lsm_flag | flags | |||
) |
Delete the export.
[in] | c | Valid connection |
[in] | e | NFS export to remove |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2404 of file lsm_mgmt.cpp.
int lsm_nfs_export_fs | ( | lsm_connect * | c, | |
const char * | fs_id, | |||
const char * | export_path, | |||
lsm_string_list * | root_list, | |||
lsm_string_list * | rw_list, | |||
lsm_string_list * | ro_list, | |||
uint64_t | anon_uid, | |||
uint64_t | anon_gid, | |||
const char * | auth_type, | |||
const char * | options, | |||
lsm_nfs_export ** | exported, | |||
lsm_flag | flags | |||
) |
Creates or modifies an NFS export.
[in] | c | Valid connection |
[in] | fs_id | File system ID to export via NFS |
[in] | export_path | Export path |
[in] | root_list | List of hosts that have root access |
[in] | rw_list | List of hosts that have read/write access |
[in] | ro_list | List of hosts that have read only access |
[in] | anon_uid | UID to map to anonymous |
[in] | anon_gid | GID to map to anonymous |
[in] | auth_type | Array specific authentication types |
[in] | options | Array specific options |
[out] | exported | Export record |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 2335 of file lsm_mgmt.cpp.
int lsm_nfs_list | ( | lsm_connect * | c, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_nfs_export ** | exports[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Lists the nfs exports on the specified array.
[in] | c | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | exports | An array of lsm_nfs_export |
[out] | count | Number of items in array |
[in] | flags | Reserved set to zero |
Definition at line 2268 of file lsm_mgmt.cpp.
int lsm_plugin_info_get | ( | lsm_connect * | conn, | |
char ** | desc, | |||
char ** | version, | |||
lsm_flag | flags | |||
) |
Retrieve information about the plug-in NOTE: Caller needs to free desc and version!
[in] | conn | Valid connection |
[out] | desc | Plug-in description |
[out] | version | Plug-in version |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 361 of file lsm_mgmt.cpp.
int lsm_pool_list | ( | lsm_connect * | conn, | |
char * | search_key, | |||
char * | search_value, | |||
lsm_pool ** | pool_array[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Query the list of storage pools on the array.
[in] | conn | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | pool_array | Array of storage pools |
[out] | count | Number of storage pools |
[in] | flags | Reserved, set to 0 |
Definition at line 793 of file lsm_mgmt.cpp.
int lsm_pool_member_info | ( | lsm_connect * | c, | |
lsm_pool * | pool, | |||
lsm_volume_raid_type * | raid_type, | |||
lsm_pool_member_type * | member_type, | |||
lsm_string_list ** | member_ids, | |||
lsm_flag | flags | |||
) |
Retrieves the membership of given pool. New in version 1.2.
[in] | c | Valid connection |
[in] | pool | The lsm_pool ptr. |
[out] | raid_type | Enum of lsm_volume_raid_type. |
[out] | member_type | Enum of lsm_pool_member_type. |
[out] | member_ids | The pointer to lsm_string_list pointer. When 'member_type' is LSM_POOL_MEMBER_TYPE_POOL, the 'member_ids' will contain a list of parent Pool IDs. When 'member_type' is LSM_POOL_MEMBER_TYPE_DISK, the 'member_ids' will contain a list of disk IDs. When 'member_type' is LSM_POOL_MEMBER_TYPE_OTHER or LSM_POOL_MEMBER_TYPE_UNKNOWN, the member_ids should be NULL. Need to use lsm_string_list_free() to free this memory. |
[in] | flags | Reserved, set to 0 |
Definition at line 855 of file lsm_mgmt.cpp.
int lsm_system_list | ( | lsm_connect * | conn, | |
lsm_system ** | systems[], | |||
uint32_t * | system_count, | |||
lsm_flag | flags | |||
) |
Retrieves information about the different arrays accessible. NOTE: Free returned systems by calling to lsm
[in] | conn | Valid connection |
[out] | systems | Array of lsm_system |
[out] | system_count | Number of systems |
[in] | flags | Reserved set to zero |
Definition at line 1773 of file lsm_mgmt.cpp.
int lsm_target_port_list | ( | lsm_connect * | c, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_target_port ** | target_ports[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Retrieve a list of target ports
[in] | c | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | target_ports | Array of target ports |
[out] | count | Number of target ports |
[in] | flags | Reserved, set to 0 |
Definition at line 915 of file lsm_mgmt.cpp.
int lsm_volume_child_dependency | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
uint8_t * | yes, | |||
lsm_flag | flags | |||
) |
Returns 1 if the specified volume has child dependencies.
[in] | conn | Valid connection |
[in] | volume | Valid volume |
[out] | yes | 1 == Yes, 0 == No |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1727 of file lsm_mgmt.cpp.
int lsm_volume_child_dependency_delete | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Instructs the array to remove all child dependencies by replicating required storage.
[in] | conn | Valid connection |
[in] | volume | Valid volume |
[out] | job | Job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1755 of file lsm_mgmt.cpp.
int lsm_volume_create | ( | lsm_connect * | conn, | |
lsm_pool * | pool, | |||
const char * | volume_name, | |||
uint64_t | size, | |||
lsm_volume_provision_type | provisioning, | |||
lsm_volume ** | new_volume, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Creates a new volume (aka. LUN).
[in] | conn | Valid connection |
[in] | pool | Valid pool |
[in] | volume_name | Human recognizable name (not all arrays support) |
[in] | size | Size of new volume in bytes (actual size will be based on array rounding to block size) |
[in] | provisioning | Type of volume provisioning to use |
[out] | new_volume | Valid volume |
[out] | job | Indicates job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1101 of file lsm_mgmt.cpp.
int lsm_volume_delete | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Deletes a logical unit and data is lost!
[in] | conn | Valid connection |
[in] | volume | Volume that is to be deleted. |
[out] | job | Indicates job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1277 of file lsm_mgmt.cpp.
int lsm_volume_disable | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
lsm_flag | flags | |||
) |
Set a Volume to offline
[in] | conn | Valid connection |
[in] | volume | Volume that is to be placed online |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1404 of file lsm_mgmt.cpp.
int lsm_volume_enable | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
lsm_flag | flags | |||
) |
Set a Volume to online
[in] | conn | Valid connection |
[in] | volume | Volume that is to be placed online |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1399 of file lsm_mgmt.cpp.
int lsm_volume_list | ( | lsm_connect * | conn, | |
const char * | search_key, | |||
const char * | search_value, | |||
lsm_volume ** | volumes[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Volume management functions Gets a list of logical units for this array.
[in] | conn | Valid connection |
[in] | search_key | Search key (NULL for all) |
[in] | search_value | Search value |
[out] | volumes | An array of lsm_volume |
[out] | count | Number of elements in the lsm_volume array |
[in] | flags | Reserved set to 0 |
Definition at line 991 of file lsm_mgmt.cpp.
int lsm_volume_mask | ( | lsm_connect * | conn, | |
lsm_access_group * | access_group, | |||
lsm_volume * | volume, | |||
lsm_flag | flags | |||
) |
Grants access to a volume for the specified group
[in] | conn | Valid connection |
[in] | access_group | Valid group pointer |
[in] | volume | Valid volume pointer |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1577 of file lsm_mgmt.cpp.
int lsm_volume_raid_create | ( | lsm_connect * | c, | |
const char * | name, | |||
lsm_volume_raid_type | raid_type, | |||
lsm_disk * | disks[], | |||
uint32_t | disk_count, | |||
uint32_t | strip_size, | |||
lsm_volume ** | new_volume, | |||
lsm_flag | flags | |||
) |
Create a disk RAID pool and allocate entire full space to new volume. New in version 1.2, only available for hardware RAID cards.
[in] | c | Valid connection |
[in] | name | String. Name for the new volume. It might be ignored or altered on some hardwardware raid cards in order to fit their limitation. |
[in] | raid_type | Enum of lsm_volume_raid_type. Please refer to the returns of lsm_volume_raid_create_cap_get() function for supported strip sizes. |
[in] | disks | An array of lsm_disk types |
[in] | disk_count | The count of lsm_disk in 'disks' argument. Count starts with 1. |
[in] | strip_size | uint32_t. The strip size in bytes. Please refer to the returns of lsm_volume_raid_create_cap_get() function for supported strip sizes. |
[out] | new_volume | Newly created volume, Pointer to the lsm_volume type pointer. |
[in] | flags | Reserved, set to 0 |
Definition at line 2479 of file lsm_mgmt.cpp.
int lsm_volume_raid_create_cap_get | ( | lsm_connect * | c, | |
lsm_system * | system, | |||
uint32_t ** | supported_raid_types, | |||
uint32_t * | supported_raid_type_count, | |||
uint32_t ** | supported_strip_sizes, | |||
uint32_t * | supported_strip_size_count, | |||
lsm_flag | flags | |||
) |
Query all supported RAID types and strip sizes which could be used in lsm_volume_raid_create() functions. New in version 1.2, only available for hardware RAID cards.
[in] | c | Valid connection |
[in] | system | The lsm_sys type. |
[out] | supported_raid_types | The pointer of uint32_t array. Containing lsm_volume_raid_type values. You need to free this memory by yourself. |
[out] | supported_raid_type_count | The pointer of uint32_t. Indicate the item count of supported_raid_types array. |
[out] | supported_strip_sizes | The pointer of uint32_t array. Containing all supported strip sizes. You need to free this memory by yourself. |
[out] | supported_strip_size_count | The pointer of uint32_t. Indicate the item count of supported_strip_sizes array. |
[in] | flags | Reserved, set to 0 |
Definition at line 2423 of file lsm_mgmt.cpp.
int lsm_volume_raid_info | ( | lsm_connect * | c, | |
lsm_volume * | volume, | |||
lsm_volume_raid_type * | raid_type, | |||
uint32_t * | strip_size, | |||
uint32_t * | disk_count, | |||
uint32_t * | min_io_size, | |||
uint32_t * | opt_io_size, | |||
lsm_flag | flags | |||
) |
Retrieves the pool id that the volume is derived from. New in version 1.2.
[in] | c | Valid connection |
[in] | volume | Volume ptr. |
[out] | raid_type | Enum of lsm_volume_raid_type |
[out] | strip_size | Size of the strip on disk or other storage extent. |
[out] | disk_count | Count of disks of RAID group(s) where this volume allocated from. |
[out] | min_io_size | Minimum I/O size, also the preferred I/O size of random I/O. |
[out] | opt_io_size | Optimal I/O size, also the preferred I/O size of sequential I/O. |
[in] | flags | Reserved, set to 0 |
Definition at line 1306 of file lsm_mgmt.cpp.
int lsm_volume_replicate | ( | lsm_connect * | conn, | |
lsm_pool * | pool, | |||
lsm_replication_type | rep_type, | |||
lsm_volume * | volume_src, | |||
const char * | name, | |||
lsm_volume ** | new_replicant, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Replicates a volume
[in] | conn | Valid connection |
[in] | pool | Valid pool |
[in] | rep_type | Type of replication lsm_replication_type |
[in] | volume_src | Which volume to replicate |
[in] | name | Human recognizable name (not all arrays support) |
[out] | new_replicant | New replicated volume lsm_volume_t |
[out] | job | Indicates job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1168 of file lsm_mgmt.cpp.
int lsm_volume_replicate_range | ( | lsm_connect * | conn, | |
lsm_replication_type | rep_type, | |||
lsm_volume * | source, | |||
lsm_volume * | dest, | |||
lsm_block_range ** | ranges, | |||
uint32_t | num_ranges, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Replicates a portion of a volume to a volume.
[in] | conn | Valid connection |
[in] | rep_type | Replication type |
[in] | source | Source volume |
[in] | dest | Destination volume (can be same as source) |
[in] | ranges | An array of block ranges |
[in] | num_ranges | Number of entries in ranges. |
[out] | job | Indicates job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1236 of file lsm_mgmt.cpp.
int lsm_volume_replicate_range_block_size | ( | lsm_connect * | conn, | |
lsm_system * | system, | |||
uint32_t * | bs, | |||
lsm_flag | flags | |||
) |
Unit of block size for the replicate range method.
[in] | conn | Valid connection |
[in] | system | Valid lsm_system |
[out] | bs | Block size |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1204 of file lsm_mgmt.cpp.
int lsm_volume_resize | ( | lsm_connect * | conn, | |
lsm_volume * | volume, | |||
uint64_t | new_size, | |||
lsm_volume ** | resized_volume, | |||
char ** | job, | |||
lsm_flag | flags | |||
) |
Resize an existing volume.
[in] | conn | Valid connection |
[in] | volume | volume to re-size |
[in] | new_size | New size of volume |
[out] | resized_volume | Pointer to newly re-sized lun. |
[out] | job | Indicates job id |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1136 of file lsm_mgmt.cpp.
int lsm_volume_unmask | ( | lsm_connect * | conn, | |
lsm_access_group * | access_group, | |||
lsm_volume * | volume, | |||
lsm_flag | flags | |||
) |
Revokes access to a volume for the specified group
[in] | conn | Valid connection |
[in] | access_group | Valid group pointer |
[in] | volume | Valid volume pointer |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1599 of file lsm_mgmt.cpp.
int lsm_volume_vpd83_verify | ( | const char * | vpd83 | ) |
Checks to see if volume vpd83 is valid
vpd83 | VPD string to check |
Definition at line 123 of file lsm_mgmt.cpp.
int lsm_volumes_accessible_by_access_group | ( | lsm_connect * | conn, | |
lsm_access_group * | group, | |||
lsm_volume ** | volumes[], | |||
uint32_t * | count, | |||
lsm_flag | flags | |||
) |
Returns those volumes that the specified group has access to.
[in] | conn | Valid connection |
[in] | group | Valid group |
[out] | volumes | An array of volumes |
[out] | count | Number of volumes |
[in] | flags | Reserved for future use, must be zero. |
Definition at line 1620 of file lsm_mgmt.cpp.