Struct lsm::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
Represent the connection to plugin.
Methods
impl Client
[src]
fn new(
uri: &str,
password: Option<&str>,
timeout: Option<u32>
) -> Result<Client, LsmError>
[src]
uri: &str,
password: Option<&str>,
timeout: Option<u32>
) -> Result<Client, LsmError>
Create a connection to plugin. Please refer to libstoragemgmt user guide for how to choose the URI and password.
The timeout
argument is in milliseconds.
fn systems(&mut self) -> Result<Vec<System>, LsmError>
[src]
Gets a list of systems on this connection.
fn volumes(&mut self) -> Result<Vec<Volume>, LsmError>
[src]
Gets a list of volumes on this connection.
fn pools(&mut self) -> Result<Vec<Pool>, LsmError>
[src]
Gets a list of pools on this connection.
fn disks(&mut self) -> Result<Vec<Disk>, LsmError>
[src]
Gets a list of disks on this connection.
fn fs(&mut self) -> Result<Vec<FileSystem>, LsmError>
[src]
Gets a list of file systems on this connection.
fn nfs_exports(&mut self) -> Result<Vec<NfsExport>, LsmError>
[src]
Gets a list of NFS exports on this connection.
fn access_groups(&mut self) -> Result<Vec<AccessGroup>, LsmError>
[src]
Gets a list of access group on this connection.
fn target_ports(&mut self) -> Result<Vec<TargetPort>, LsmError>
[src]
Gets a list of target ports on this connection.
fn batteries(&mut self) -> Result<Vec<Battery>, LsmError>
[src]
Gets a list of batteries on this connection.
fn volume_create(
&mut self,
pool: &Pool,
name: &str,
size_bytes: u64,
thinp: &VolumeCreateArgThinP
) -> Result<Volume, LsmError>
[src]
&mut self,
pool: &Pool,
name: &str,
size_bytes: u64,
thinp: &VolumeCreateArgThinP
) -> Result<Volume, LsmError>
Create new volume.
pool
-- The pool where new volume should allocated from.name
-- The name of new volume. It might be altered or ignored.size_bytes
-- Size in bytes of new volume. You may use functionsize_human_2_size_bytes()
to convert string like '1.1 GiB' to integer size bytes.thinp
-- Whether to create thin provisioning volume. Check VolumeCreateArgThinP
fn volume_delete(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Delete a volume
Errors
LsmError::VolHasChildDep
volume has child dependency. e.g. specified volume is a replication source. Please use [Client::vol_child_dep_rm()
] to eliminate child dependency.
fn time_out_set(&mut self, ms: u32) -> Result<(), LsmError>
[src]
Set connection timeout value in milliseconds.
fn time_out_get(&mut self) -> Result<u32, LsmError>
[src]
Get connection timeout value.
fn capabilities(&mut self, sys: &System) -> Result<Capabilities, LsmError>
[src]
Get system's capabilities.
Capability is used to indicate whether certain functionality is
supported by specified storage system. Please check desired function
for required capability. To verify capability is supported, use
Capabilities::is_supported()
. If the functionality is not
listed in the enumerated Capability
type then that functionality
is mandatory and required to exist.
fn plugin_info(&mut self) -> Result<PluginInfo, LsmError>
[src]
Get plugin information.
fn sys_read_cache_pct_set(
&mut self,
sys: &System,
read_pct: u32
) -> Result<(), LsmError>
[src]
&mut self,
sys: &System,
read_pct: u32
) -> Result<(), LsmError>
Changes the read cache percentage for the specified system.
Errors
LsmError::InvalidArgument
:read_pct
is larger than 100.
fn iscsi_chap_auth_set(
&mut self,
init_id: &str,
in_user: Option<&str>,
in_pass: Option<&str>,
out_user: Option<&str>,
out_pass: Option<&str>
) -> Result<(), LsmError>
[src]
&mut self,
init_id: &str,
in_user: Option<&str>,
in_pass: Option<&str>,
out_user: Option<&str>,
out_pass: Option<&str>
) -> Result<(), LsmError>
Set(override) iSCSI CHAP authentication.
init_id
-- Initiator ID.in_user
-- The inbound authentication username. The inbound authentication means the iSCSI initiator authenticates the iSCSI target using CHAP.in_pass
-- The inbond authentication password.out_user
-- The outbound authentication username. The outbound authentication means the iSCSI target authenticates the iSCSI initiator using CHAP.out_pass
-- The outbound authentication password.
fn volume_resize(
&mut self,
vol: &Volume,
new_size_bytes: u64
) -> Result<Volume, LsmError>
[src]
&mut self,
vol: &Volume,
new_size_bytes: u64
) -> Result<Volume, LsmError>
Resize a volume.
Please check whether pool allows volume resize via
Pool.unsupported_actions
.
fn volume_replicate(
&mut self,
pool: Option<Pool>,
rep_type: VolumeReplicateType,
src_vol: &Volume,
name: &str
) -> Result<Volume, LsmError>
[src]
&mut self,
pool: Option<Pool>,
rep_type: VolumeReplicateType,
src_vol: &Volume,
name: &str
) -> Result<Volume, LsmError>
Replicate a volume.
pool
-- The pool where new replication target volume should be allocated from. ForNone
, will use the same pool of source volume.rep_type
-- Replication type.src_vol
-- Replication source volume.name
-- Name for replication target volume. Might be altered or ignored.
fn volume_rep_range_blk_size(&mut self, sys: &System) -> Result<i32, LsmError>
[src]
Block size for the Client::volume_replicate_range()
.
fn volume_replicate_range(
&mut self,
rep_type: VolumeReplicateType,
src_vol: &Volume,
dst_vol: &Volume,
ranges: &[BlockRange]
) -> Result<(), LsmError>
[src]
&mut self,
rep_type: VolumeReplicateType,
src_vol: &Volume,
dst_vol: &Volume,
ranges: &[BlockRange]
) -> Result<(), LsmError>
Replicates a portion of a volume to a volume.
rep_type
-- Replication type.src_vol
-- Replication source volume.dst_vol
-- Replication target volume.ranges
-- Replication block ranges.
fn volume_enable(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Set a Volume to online.
Enable the specified volume when that volume is disabled by
administrator or via Client::volume_disable()
fn volume_disable(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Disable the read and write access to the specified volume.
fn volume_mask(
&mut self,
vol: &Volume,
ag: &AccessGroup
) -> Result<(), LsmError>
[src]
&mut self,
vol: &Volume,
ag: &AccessGroup
) -> Result<(), LsmError>
Grant access to a volume for the specified group, also known as LUN masking or mapping.
Errors
LsmError::EmptyAccessGroup
: Cannot mask voluem to empty access group.
fn volume_unmask(
&mut self,
vol: &Volume,
ag: &AccessGroup
) -> Result<(), LsmError>
[src]
&mut self,
vol: &Volume,
ag: &AccessGroup
) -> Result<(), LsmError>
Revokes access to a volume for the specified group
fn access_group_create(
&mut self,
name: &str,
init_id: &str,
init_type: InitiatorType,
sys: &System
) -> Result<AccessGroup, LsmError>
[src]
&mut self,
name: &str,
init_id: &str,
init_type: InitiatorType,
sys: &System
) -> Result<AccessGroup, LsmError>
Create a access group.
Creates a new access group with one initiator in it. You may expand
the access group by adding more initiators via
Client::access_group_init_add()
Errors
LsmError::ExistsInitiator
: Specified initiator is used by other access group.
fn access_group_delete(&mut self, ag: &AccessGroup) -> Result<(), LsmError>
[src]
Delete an access group. Only access group with no volume masked can be deleted.
Errors
LsmError::IsMasked
: Access group has volume masked to.
fn access_group_init_add(
&mut self,
ag: &AccessGroup,
init_id: &str,
init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
[src]
&mut self,
ag: &AccessGroup,
init_id: &str,
init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
Add an initiator to the access group.
Errors
LsmError::ExistsInitiator
: Specified initiator is used by other access group.
fn access_group_init_del(
&mut self,
ag: &AccessGroup,
init_id: &str,
init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
[src]
&mut self,
ag: &AccessGroup,
init_id: &str,
init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
Delete an initiator from an access group.
Errors
LsmError::LastInitInAccessGroup
: Specified initiator is the last initiator of access group. UseClient::access_group_delete()
instead.
fn vols_masked_to_ag(
&mut self,
ag: &AccessGroup
) -> Result<Vec<Volume>, LsmError>
[src]
&mut self,
ag: &AccessGroup
) -> Result<Vec<Volume>, LsmError>
Query volumes that the specified access group has access to.
fn ags_granted_to_vol(
&mut self,
vol: &Volume
) -> Result<Vec<AccessGroup>, LsmError>
[src]
&mut self,
vol: &Volume
) -> Result<Vec<AccessGroup>, LsmError>
Retrieves the access groups that have access to the specified volume.
fn vol_has_child_dep(&mut self, vol: &Volume) -> Result<bool, LsmError>
[src]
Check whether volume has child dependencies.
fn vol_child_dep_rm(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Delete all child dependencies of the specified volume.
Instruct storage system to remove all child dependencies of the specified volume by duplicating the required storage before breaking replication relationship. This function might take a long time(days or even weeks), you might want to invoke it in a thread.
fn fs_create(
&mut self,
pool: &Pool,
name: &str,
size_bytes: u64
) -> Result<FileSystem, LsmError>
[src]
&mut self,
pool: &Pool,
name: &str,
size_bytes: u64
) -> Result<FileSystem, LsmError>
Create a new file system.
pool
-- The pool where new file system should allocated from.name
-- The name of new file system. It might be altered or ignored.size_bytes
-- Size in bytes of new file system. You may use functionsize_human_2_size_bytes()
to convert string like '1.1 GiB' to integer size bytes.
fn fs_resize(
&mut self,
fs: &FileSystem,
new_size_bytes: u64
) -> Result<FileSystem, LsmError>
[src]
&mut self,
fs: &FileSystem,
new_size_bytes: u64
) -> Result<FileSystem, LsmError>
Resize of file system.
fn fs_delete(&mut self, fs: &FileSystem) -> Result<(), LsmError>
[src]
Delete a file system.
When file system has snapshot attached, all its snapshot will be
deleted also. When file system is exported, all its exports will be
deleted also. If specified file system is has child dependency, it
cannot be deleted, please use Client::fs_has_child_dep()
and
Client::fs_child_dep_rm()
.
fn fs_clone(
&mut self,
src_fs: &FileSystem,
dst_fs_name: &str,
snapshot: Option<&FileSystemSnapShot>
) -> Result<FileSystem, LsmError>
[src]
&mut self,
src_fs: &FileSystem,
dst_fs_name: &str,
snapshot: Option<&FileSystemSnapShot>
) -> Result<FileSystem, LsmError>
Clones an existing file system
Create a point in time read writeable space efficient copy of specified file system, also know as read writeable snapshot. The new file system will reside in the same pool of specified file system.
Optionally, new file system could be based on a snapshot specified by
snapshot
argument.
fn fs_file_clone(
&mut self,
fs: &FileSystem,
src_file_name: &str,
dst_file_name: &str,
snapshot: Option<&FileSystemSnapShot>
) -> Result<(), LsmError>
[src]
&mut self,
fs: &FileSystem,
src_file_name: &str,
dst_file_name: &str,
snapshot: Option<&FileSystemSnapShot>
) -> Result<(), LsmError>
Clones a file on a file system.
Optionally, file contents could be based on a snapshot specified by
snapshot
argument.
fn fs_snapshots(
&mut self,
fs: &FileSystem
) -> Result<Vec<FileSystemSnapShot>, LsmError>
[src]
&mut self,
fs: &FileSystem
) -> Result<Vec<FileSystemSnapShot>, LsmError>
Get a list of snapshots of specified file system.
fn fs_snapshot_create(
&mut self,
fs: &FileSystem,
name: &str
) -> Result<FileSystemSnapShot, LsmError>
[src]
&mut self,
fs: &FileSystem,
name: &str
) -> Result<FileSystemSnapShot, LsmError>
Create a file system snapshot.
fn fs_snapshot_delete(
&mut self,
fs: &FileSystem,
snapshot: &FileSystemSnapShot
) -> Result<(), LsmError>
[src]
&mut self,
fs: &FileSystem,
snapshot: &FileSystemSnapShot
) -> Result<(), LsmError>
Delete a file system snapshot.
fn fs_snapshot_restore(
&mut self,
fs: &FileSystem,
snapshot: &FileSystemSnapShot,
all_file: bool,
files: Option<&[&str]>,
restore_files: Option<&[&str]>
) -> Result<(), LsmError>
[src]
&mut self,
fs: &FileSystem,
snapshot: &FileSystemSnapShot,
all_file: bool,
files: Option<&[&str]>,
restore_files: Option<&[&str]>
) -> Result<(), LsmError>
Restore a file system based on specified snapshot.
fs
-- File system to restore.snapshot
-- Snapshot to use.all_file
--true
for restore all files.false
for restore specified files only.files
-- Only restored specified files. Ignored ifall_file
istrue
.restore_files
-- If notNone
, rename restored files to defined file paths and names
fn fs_has_child_dep(
&mut self,
fs: &FileSystem,
files: Option<Vec<&str>>
) -> Result<bool, LsmError>
[src]
&mut self,
fs: &FileSystem,
files: Option<Vec<&str>>
) -> Result<bool, LsmError>
Checks whether file system has a child dependency.
fn fs_child_dep_rm(
&mut self,
fs: &FileSystem,
files: Option<Vec<&str>>
) -> Result<(), LsmError>
[src]
&mut self,
fs: &FileSystem,
files: Option<Vec<&str>>
) -> Result<(), LsmError>
Delete all child dependencies of the specified file system.
Instruct storage system to remove all child dependencies of the specified file system by duplicating the required storage before breaking replication relationship. This function might take a long time(days or even weeks), you might want to invoke it in a thread.
fn nfs_exp_auth_type_list(&mut self) -> Result<Vec<String>, LsmError>
[src]
Get supported NFS client authentication types.
fn fs_export(
&mut self,
fs: &FileSystem,
export_path: Option<&str>,
access: &NfsAccess,
auth_type: Option<&str>,
options: Option<&str>
) -> Result<NfsExport, LsmError>
[src]
&mut self,
fs: &FileSystem,
export_path: Option<&str>,
access: &NfsAccess,
auth_type: Option<&str>,
options: Option<&str>
) -> Result<NfsExport, LsmError>
Create or modify an NFS export.
fs
-- File system to export.export_path
-- Export path. If already exists, will modify exist NFS export. IfNone
, will let storage system to generate one.access
-- NFS access details.auth_type
-- NFS client authentication type. Get fromClient::nfs_exp_auth_type_list()
.options
-- Extra NFS options.
fn fs_unexport(&mut self, exp: &NfsExport) -> Result<(), LsmError>
[src]
Unexport specified NFS exports.
fn vol_raid_info(&mut self, vol: &Volume) -> Result<VolumeRaidInfo, LsmError>
[src]
Get volume RAID information.
fn pool_member_info(&mut self, pool: &Pool) -> Result<PoolMemberInfo, LsmError>
[src]
Get pool member information.
fn vol_raid_create_cap_get(
&mut self,
sys: &System
) -> Result<(Vec<RaidType>, Vec<u32>), LsmError>
[src]
&mut self,
sys: &System
) -> Result<(Vec<RaidType>, Vec<u32>), LsmError>
Get system capability on creating RAIDed volume. For hardware RAID only.
Returns supported RAID types and strip sizes.
fn vol_raid_create(
&mut self,
name: &str,
raid_type: RaidType,
disks: &[Disk],
strip_size: Option<u32>
) -> Result<Volume, LsmError>
[src]
&mut self,
name: &str,
raid_type: RaidType,
disks: &[Disk],
strip_size: Option<u32>
) -> Result<Volume, LsmError>
Create RAIDed volume directly from disks. Only for hardware RAID.
fn vol_ident_led_on(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Turn on the identification LED for the specified volume.
All its member disks' identification LED will be turned on.
fn vol_ident_led_off(&mut self, vol: &Volume) -> Result<(), LsmError>
[src]
Turn off the identification LED for the specified volume.
All its member disks' identification LED will be turned off.
fn vol_cache_info(&mut self, vol: &Volume) -> Result<VolumeCacheInfo, LsmError>
[src]
Get cache information on specified volume.
fn vol_phy_disk_cache_set(
&mut self,
vol: &Volume,
pdc: CachePolicy
) -> Result<(), LsmError>
[src]
&mut self,
vol: &Volume,
pdc: CachePolicy
) -> Result<(), LsmError>
Set volume physical disk cache policy.
fn vol_write_cache_set(
&mut self,
vol: &Volume,
wcp: CachePolicy
) -> Result<(), LsmError>
[src]
&mut self,
vol: &Volume,
wcp: CachePolicy
) -> Result<(), LsmError>
Set volume write cache policy.
fn vol_read_cache_set(
&mut self,
vol: &Volume,
rcp: CachePolicy
) -> Result<(), LsmError>
[src]
&mut self,
vol: &Volume,
rcp: CachePolicy
) -> Result<(), LsmError>
Set volume read cache policy.