[][src]Struct lsm::Client

pub struct Client { /* fields omitted */ }

Represent the connection to plugin.

Methods

impl Client[src]

pub fn new(
    uri: &str,
    password: Option<&str>,
    timeout: Option<u32>
) -> Result<Client, LsmError>
[src]

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.

pub fn systems(&mut self) -> Result<Vec<System>, LsmError>[src]

Gets a list of systems on this connection.

pub fn volumes(&mut self) -> Result<Vec<Volume>, LsmError>[src]

Gets a list of volumes on this connection.

pub fn pools(&mut self) -> Result<Vec<Pool>, LsmError>[src]

Gets a list of pools on this connection.

pub fn disks(&mut self) -> Result<Vec<Disk>, LsmError>[src]

Gets a list of disks on this connection.

pub fn fs(&mut self) -> Result<Vec<FileSystem>, LsmError>[src]

Gets a list of file systems on this connection.

pub fn nfs_exports(&mut self) -> Result<Vec<NfsExport>, LsmError>[src]

Gets a list of NFS exports on this connection.

pub fn access_groups(&mut self) -> Result<Vec<AccessGroup>, LsmError>[src]

Gets a list of access group on this connection.

pub fn target_ports(&mut self) -> Result<Vec<TargetPort>, LsmError>[src]

Gets a list of target ports on this connection.

pub fn batteries(&mut self) -> Result<Vec<Battery>, LsmError>[src]

Gets a list of batteries on this connection.

pub fn volume_create(
    &mut self,
    pool: &Pool,
    name: &str,
    size_bytes: u64,
    thinp: &VolumeCreateArgThinP
) -> Result<Volume, LsmError>
[src]

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 function size_human_2_size_bytes() to convert string like '1.1 GiB' to integer size bytes.
  • thinp -- Whether to create thin provisioning volume. Check VolumeCreateArgThinP

pub 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.

pub fn time_out_set(&mut self, ms: u32) -> Result<(), LsmError>[src]

Set connection timeout value in milliseconds.

pub fn time_out_get(&mut self) -> Result<u32, LsmError>[src]

Get connection timeout value.

pub 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.

pub fn plugin_info(&mut self) -> Result<PluginInfo, LsmError>[src]

Get plugin information.

pub fn sys_read_cache_pct_set(
    &mut self,
    sys: &System,
    read_pct: u32
) -> Result<(), LsmError>
[src]

Changes the read cache percentage for the specified system.

Errors

pub 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]

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 inbound 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.

pub fn volume_resize(
    &mut self,
    vol: &Volume,
    new_size_bytes: u64
) -> Result<Volume, LsmError>
[src]

Resize a volume.

Please check whether pool allows volume resize via Pool.unsupported_actions.

pub fn volume_replicate(
    &mut self,
    pool: Option<Pool>,
    rep_type: VolumeReplicateType,
    src_vol: &Volume,
    name: &str
) -> Result<Volume, LsmError>
[src]

Replicate a volume.

  • pool -- The pool where new replication target volume should be allocated from. For None, 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.

pub fn volume_rep_range_blk_size(
    &mut self,
    sys: &System
) -> Result<i32, LsmError>
[src]

pub fn volume_replicate_range(
    &mut self,
    rep_type: VolumeReplicateType,
    src_vol: &Volume,
    dst_vol: &Volume,
    ranges: &[BlockRange]
) -> Result<(), LsmError>
[src]

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.

pub 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()

pub fn volume_disable(&mut self, vol: &Volume) -> Result<(), LsmError>[src]

Disable the read and write access to the specified volume.

pub fn volume_mask(
    &mut self,
    vol: &Volume,
    ag: &AccessGroup
) -> Result<(), LsmError>
[src]

Grant access to a volume for the specified group, also known as LUN masking or mapping.

Errors

pub fn volume_unmask(
    &mut self,
    vol: &Volume,
    ag: &AccessGroup
) -> Result<(), LsmError>
[src]

Revokes access to a volume for the specified group

pub fn access_group_create(
    &mut self,
    name: &str,
    init_id: &str,
    init_type: InitiatorType,
    sys: &System
) -> Result<AccessGroup, LsmError>
[src]

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

pub 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

pub fn access_group_init_add(
    &mut self,
    ag: &AccessGroup,
    init_id: &str,
    init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
[src]

Add an initiator to the access group.

Errors

pub fn access_group_init_del(
    &mut self,
    ag: &AccessGroup,
    init_id: &str,
    init_type: InitiatorType
) -> Result<AccessGroup, LsmError>
[src]

Delete an initiator from an access group.

Errors

pub fn vols_masked_to_ag(
    &mut self,
    ag: &AccessGroup
) -> Result<Vec<Volume>, LsmError>
[src]

Query volumes that the specified access group has access to.

pub fn ags_granted_to_vol(
    &mut self,
    vol: &Volume
) -> Result<Vec<AccessGroup>, LsmError>
[src]

Retrieves the access groups that have access to the specified volume.

pub fn vol_has_child_dep(&mut self, vol: &Volume) -> Result<bool, LsmError>[src]

Check whether volume has child dependencies.

pub 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.

pub fn fs_create(
    &mut self,
    pool: &Pool,
    name: &str,
    size_bytes: u64
) -> Result<FileSystem, LsmError>
[src]

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 function size_human_2_size_bytes() to convert string like '1.1 GiB' to integer size bytes.

pub fn fs_resize(
    &mut self,
    fs: &FileSystem,
    new_size_bytes: u64
) -> Result<FileSystem, LsmError>
[src]

Resize of file system.

pub 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().

pub fn fs_clone(
    &mut self,
    src_fs: &FileSystem,
    dst_fs_name: &str,
    snapshot: Option<&FileSystemSnapShot>
) -> Result<FileSystem, LsmError>
[src]

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.

pub fn fs_file_clone(
    &mut self,
    fs: &FileSystem,
    src_file_name: &str,
    dst_file_name: &str,
    snapshot: Option<&FileSystemSnapShot>
) -> Result<(), LsmError>
[src]

Clones a file on a file system.

Optionally, file contents could be based on a snapshot specified by snapshot argument.

pub fn fs_snapshots(
    &mut self,
    fs: &FileSystem
) -> Result<Vec<FileSystemSnapShot>, LsmError>
[src]

Get a list of snapshots of specified file system.

pub fn fs_snapshot_create(
    &mut self,
    fs: &FileSystem,
    name: &str
) -> Result<FileSystemSnapShot, LsmError>
[src]

Create a file system snapshot.

pub fn fs_snapshot_delete(
    &mut self,
    fs: &FileSystem,
    snapshot: &FileSystemSnapShot
) -> Result<(), LsmError>
[src]

Delete a file system snapshot.

pub fn fs_snapshot_restore(
    &mut self,
    fs: &FileSystem,
    snapshot: &FileSystemSnapShot,
    all_file: bool,
    files: Option<&[&str]>,
    restore_files: Option<&[&str]>
) -> Result<(), LsmError>
[src]

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 if all_file is true.
  • restore_files -- If not None, rename restored files to defined file paths and names

pub fn fs_has_child_dep(
    &mut self,
    fs: &FileSystem,
    files: Option<Vec<&str>>
) -> Result<bool, LsmError>
[src]

Checks whether file system has a child dependency.

pub fn fs_child_dep_rm(
    &mut self,
    fs: &FileSystem,
    files: Option<Vec<&str>>
) -> Result<(), LsmError>
[src]

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.

pub fn nfs_exp_auth_type_list(&mut self) -> Result<Vec<String>, LsmError>[src]

Get supported NFS client authentication types.

pub fn fs_export(
    &mut self,
    fs: &FileSystem,
    export_path: Option<&str>,
    access: &NfsAccess,
    auth_type: Option<&str>,
    options: Option<&str>
) -> Result<NfsExport, LsmError>
[src]

Create or modify an NFS export.

  • fs -- File system to export.
  • export_path -- Export path. If already exists, will modify exist NFS export. If None, will let storage system to generate one.
  • access -- NFS access details.
  • auth_type -- NFS client authentication type. Get from Client::nfs_exp_auth_type_list().
  • options -- Extra NFS options.

pub fn fs_unexport(&mut self, exp: &NfsExport) -> Result<(), LsmError>[src]

Unexport specified NFS exports.

pub fn vol_raid_info(
    &mut self,
    vol: &Volume
) -> Result<VolumeRaidInfo, LsmError>
[src]

Get volume RAID information.

pub fn pool_member_info(
    &mut self,
    pool: &Pool
) -> Result<PoolMemberInfo, LsmError>
[src]

Get pool member information.

pub fn vol_raid_create_cap_get(
    &mut self,
    sys: &System
) -> Result<(Vec<RaidType>, Vec<u32>), LsmError>
[src]

Get system capability on creating RAIDed volume. For hardware RAID only.

Returns supported RAID types and strip sizes.

pub fn vol_raid_create(
    &mut self,
    name: &str,
    raid_type: RaidType,
    disks: &[Disk],
    strip_size: Option<u32>
) -> Result<Volume, LsmError>
[src]

Create RAIDed volume directly from disks. Only for hardware RAID.

pub 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.

pub 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.

pub fn vol_cache_info(
    &mut self,
    vol: &Volume
) -> Result<VolumeCacheInfo, LsmError>
[src]

Get cache information on specified volume.

pub fn vol_phy_disk_cache_set(
    &mut self,
    vol: &Volume,
    pdc: CachePolicy
) -> Result<(), LsmError>
[src]

Set volume physical disk cache policy.

pub fn vol_write_cache_set(
    &mut self,
    vol: &Volume,
    wcp: CachePolicy
) -> Result<(), LsmError>
[src]

Set volume write cache policy.

pub fn vol_read_cache_set(
    &mut self,
    vol: &Volume,
    rcp: CachePolicy
) -> Result<(), LsmError>
[src]

Set volume read cache policy.

Auto Trait Implementations

impl RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.