file_client – HP3ParFilePersonaClient

HP3PAR File Persona Client

Author:Mark Sturdevant
Description:Client for 3PAR File Persona. This module provides a client for File Persona functionality. The File Persona client requires 3PAR InForm 3.2.1 (MU3) with File Persona capability. This client extends the regular 3PAR client.
class hp3parclient.file_client.HP3ParFilePersonaClient(api_url, secure=False)[source]

The 3PAR File Persona Client.

The File Persona client requires 3PAR InForm 3.2.1 (MU3) with File Persona capability

Parameters:api_url (str) – The url to the WSAPI service on 3PAR ie. http://<3par server>:8080/api/v1
gettpdinterface(*args, **kwargs)[source]

Get and parse TPD interfaces (and set for re-use).

The output is filtered to only include interfaces used by this client.

Returns:Dictionary of TPD interfaces
getfs(*args, **kwargs)[source]

Show information on File Services cluster.

The getfs command displays information on File Services nodes.

Returns:dict with message, total and members
result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of FS settings.
}
createfpg(*args, **kwargs)[source]

Create a file provisioning group.

The createfpg command creates a file provisioning group of the given name and size within the specified cpg.

For this command MB = 1048576 bytes, GB = 1024MB, and TB = 1024GB.

Parameters:
  • cpgname – The CPG where the VVs associated with the file provisioning group will be created
  • fpgname – The name of the file provisioning group to be created
  • size – The size of the file provisioning group to be created. The specified size must be between 1T and 32T. A suffix (with no whitespace before the suffix) will modify the units to GB (g or G suffix) or TB (t or T suffix).
  • comment – Specifies the textual description of the file provisioning group.
  • node – Bind the created file provisioning group to the specified node.
  • full – Create the file provisioning group using fully provisioned volumes.
  • wait – Wait until the associated task is completed before proceeding. This option will produce verbose task information.
Returns:

List of strings. Lines of output from the CLI command.

growfpg(*args, **kwargs)[source]

Grow a file provisioning group.

The growfpg command grows a file provisioning group of the given name by the size specified, within the CPG associated with the base file provisioning group.

For each grow undertaken, at least one additional VV of name <fpgname>.n is created.

Parameters:
  • fpgname – The name of the filesystem to be grown.
  • size – The size of the filesystem to be grown.
Returns:

List of strings. Lines of output from the CLI command.

getfpg(*args, **kwargs)[source]

Show file provisioning group information

The getfpg command displays information on file provisioning groups

Parameters:fpgs – Limit output to the specified file provisioning group.
Returns:dict with message, total and members
result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of FPGs
}
setfpg(*args, **kwargs)[source]

Modify the properties of a File Provisioning Group.

The setfpg command allows the user to enable and disable various properties associated with a File Provisioning Group.

Access to all domains is required to run this command.

The -primarynode and -failover options are mutually exclusive.

When assigning primary nodes, the secondary node will be implicit as a couplet pair [0,1] [2,3] [4,5] [6,7]. This action will fail if the graceful failover is not possible.

The -failover and -primarynode options will result in temporary unavailability of the Virtual File Servers associated with the File Provisioning Group being migrated, and also the unavailability of any associated shares. An implicit -deactivate and -activate process is undertaken during a migration to the alternate node.

Parameters:
  • fpgname – The name of the file provisioning group to be modified.
  • comment – Specifies any addition textual information.
  • rmcomment – Clears the comment string.
  • activate – Makes the File Provisioning Group available.
  • deactivate – Makes the File Provisioning Group unavailable.
  • primarynode – Specifies the primary node to which the File Provisioning Group will be assigned. Appropriate <nodeid> values are defined as those on which file services has been enabled.
  • failover – Specifies that the File Provisioning Group should be failed over to its alternate node. If it has previously failed over to the secondary, this will cause it to fail back to the primary node. Will fail if a graceful failover is not possible.
  • forced – In the event of failure to failover, this will attempt a forced failover.
Returns:

List of strings. Lines of output from the CLI command.

removefpg(*args, **kwargs)[source]

Remove a file provisioning group

The removefpg command removes a file provisioning group and its underlying components from the system.

It is necessary to remove any shares on the file provisioning group before removing the file provisioning group itself.

Parameters:
  • fpgname – fpgname is the name of the file provisioning group(s) to be removed. This specifier can be repeated to remove multiple file provisioning groups. When used with pat=True, specifies a glob-style pattern. This specifier can be repeated to remove multiple file provisioning groups.
  • **kwargs – See below.
Kwargs:
  • forget – Removes the specified file provisioning group which is involved in Remote DR, keeping the virtual volume intact.
  • wait – Wait until the associated task is completed before proceeding. This option will produce verbose task information.
  • pat – The fpgname parameter is a glob-style pattern.
Returns:

List of strings. Lines of output from the CLI command.

createvfs(*args, **kwargs)[source]

Create a Virtual File Server.

createvfs creates a Virtual File Server. It can optionally create the File Provisioning Group to which the VFS will belong.

If an fpg is created, it will be given the same name as the VFS. Both names must be available for creation for the command to succeed.

Either -fpg or the parameters to create a File Provisioning Group must be specified in order to create a VFS.

This command will spawn a task and return the taskid.

Grace times are specified in minutes.

Certificates must be in PEM format, containing both public and private keys.

Only one of the following certificate options can be specified: nocert, certfile, certdata.

Parameters:
  • ipaddr – The IP address to which the VFS should be assigned
  • subnet – The subnet for the IP Address.
  • vfsname – The name of the VFS to be created.
  • nocert – Do not create a self signed certificate associated with the VFS.
  • certfile – Use the certificate data contained in this file.
  • certdata – Use the certificate data contained in this string.
  • comment – Specifies any additional textual information.
  • bgrace – The block grace time in minutes for quotas within the VFS.
  • igrace – The inode grace time in minutes for quotas within the VFS.
  • fpg – The name of the File Provisioning Group in which the VFS should be created.
  • cpg – The CPG in which the File Provisioning Group should be created.
  • size – The size of the File Provisioning Group to be created.
  • node – The node to which the File Provisioning Group should be assigned.
  • vlan – The VLAN ID associated with the VFSIP.
  • wait – Wait until the associated task is completed before proceeding. This option will produce verbose task information.
Returns:

List of strings. Lines of output from the CLI command.

getvfs(*args, **kwargs)[source]

Display Virtual File Server information.

The getvfs command displays information on Virtual File Servers.

VFS name is not globally unique, and the same VFS name may be in use in multiple File Provisioning Groups.

If no filter options are provided the system will traverse all File Provisioning Groups and display all associated VFSs.

Parameters:
  • fpg – Limit the display to VFSs contained within the File Provisioning Group.
  • vfs – Limit the display to the specified VFS name.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of VFSs.
}
setvfs(*args, **kwargs)[source]

Modify a Virtual File Server.

Allows modification of the specified Virtual File Server

Only one of the following certificate options can be specified: certfile, certdata, certgen, rmcert.

Certificates must be in PEM format, containing both public and private keys.

Grace times are specified in minutes.

Parameters:
  • vfs – The name of the VFS to be modified.
  • fpg – The name of the File Provisioning Group to which the VFS belongs.
  • certfile – Use the certificate data contained in this file.
  • certdata – Use the certificate data contained in this string.
  • certgen – Generates and sets a certificate for the VFS.
  • rmcert – Remove the named certificate from the VFS.
  • comment – Specifies any additional textual information.
  • bgrace – Specifies the block grace time for quotas within the VFS.
  • igrace – Specifies the inode grace time for quotas within the VFS.
Returns:

List of strings. Lines of output from the CLI command.

removevfs(*args, **kwargs)[source]

Remove a Virtual File Server.

The removevfs command removes a Virtual File Server and its underlying components from the system.

Parameters:
  • vfs – The name of the VFS to be removed.
  • fpg – fpg is the name of the File Provisioning Group containing the VFS
Returns:

List of strings. Lines of output from the CLI command.

createfsip(*args, **kwargs)[source]

Assigns an IP address to a Virtual File Server.

Parameters:
  • ipaddr – Specifies the IP address to be assign to the Virtual File Server.
  • subnet – Specifies the subnet mask to be used.
  • vfs – Specifies the Virtual File Server to which the IP address will be assigned.
  • vlantag – Specifies the VLAN Tag to be used.
  • fpg – Specifies the file provisioning group in which the Virtual File Server was created.
Returns:

List of strings. Lines of output from the CLI command.

setfsip(*args, **kwargs)[source]

Modifies the network config of a Virtual File Server.

Parameters:
  • vfs – Specifies the Virtual File Server which is to have its network config modified.
  • id – Specifies the ID for the network config.
  • vlantag – Specifies the VLAN Tag to be used.
  • ip – Specifies the new IP address.
  • subnet – Specifies the new subnet mask.
  • fpg – Specifies the File Provisioning Group in which the Virtual File Server was created.
Returns:

List of strings. Lines of output from the CLI command.

getfsip(*args, **kwargs)[source]

Shows the network config of a Virtual File Server.

Parameters:
  • vfs – Specifies the Virtual File Server which is to have its network config modified.
  • fpg – Specifies the File Provisioning Group in which the Virtual File Server was created.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of FSIPs.
}
removefsip(*args, **kwargs)[source]

Removes the network config of a Virtual File Server.

Parameters:
  • vfs – Specifies the Virtual File Server which is to have its network config removed.
  • id – Specifies the ID for the network config.
  • fpg – Specifies the File Provisioning Group in which the Virtual File Server was created.
Returns:

List of strings. Lines of output from the CLI command.

createfsgroup(*args, **kwargs)[source]

Create a local group account associated with file services.

The -gid option can have any value between 1000 and 65535.

To access an SMB share, specify the group as “LOCAL_CLUSTER<groupname>”.

Parameters:
  • groupname – Specifies the local group name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
  • gid – Specifies the group ID to be used.
  • memberlist – User members of the group.
Returns:

List of strings. Lines of output from the CLI command.

setfsgroup(*args, **kwargs)[source]

Modify a local group account associated with file services.

memberlist specifies user members of the group. It is a set of comma separated strings (memberlist=’<list>’).

If <list> has a prefix (for example, +user1):

+ add <list> to the existing user list. Users in <list> must not be in the existing list.

- remove <list> from the existing list. Users in <list> must be already in the existing list.

If specified, the prefix will be applied to the entire list. If <list> has no prefix, <list> will be used as the new user list.

Parameters:
  • groupname – Specifies the local group name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
  • memberlist – Specifies user members of the group. It is a set of comma separated strings.
Returns:

List of strings. Lines of output from the CLI command.

removefsgroup(*args, **kwargs)[source]

Remove a local group account associated with file services.

Parameters:groupname – Specifies the local group name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
Returns:List of strings. Lines of output from the CLI command.
createfsuser(*args, **kwargs)[source]

Create a local user account associated with file services.

If not specified -uid will be given a default value.

The -uid option can have any value between 1000 and 65535.

If the -enabled option is not supplied the user will be enabled by default. Valid values are strings ‘false’ or ‘true’ (default). These values are strings – not Python booleans.

To access an SMB share, specify the user as “LOCAL_CLUSTER<username>”.

Parameters:
  • username – Specifies the local user name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
  • passwd – Specifies the user’s password.
  • primarygroup – Specifies the user’s primary group.
  • enable – Specifies the user is enabled or disabled on creation. Valid values are strings ‘false’ or ‘true’ (default). These values are strings – not Python booleans.
  • uid – Specifies the user ID to be used.
  • grplist – Specifies a list of additional groups the user is to be a member.
Returns:

List of strings. Lines of output from the CLI command.

setfsuser(*args, **kwargs)[source]

Modify a local user account associated with file services.

Valid values for enabled are strings ‘false’ or ‘true’ (or None). These values are strings – not Python booleans.

grplist specifies a list of additional groups which the user is to be a member. It is a set of comma separated strings (grplist=’<list>’).

If <list> has a prefix (for example, +group1):

+ add <list> to the existing group list. Groups in <list> must not be in the existing list.

- remove <list> from the existing list. Groups in <list> must be already in the existing list.

If specified, the prefix will be applied to the entire list. If <list> has no prefix, <list> will be used as the new group list.

Parameters:
  • username – Specifies the local user name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
  • passwd – Specifies the user’s password.
  • primarygroup – Specifies the user’s primary group.
  • enable – Specifies if the user is enabled or not.
  • grplist – Specifies a list of additional groups which the user is to be a member. It is a set of comma separated strings.
Returns:

List of strings. Lines of output from the CLI command.

removefsuser(*args, **kwargs)[source]

Remove a local user account associated with file services.

Parameters:username – Specifies the local user name using up to 31 characters. Valid characters are alphanumeric characters, periods, dashes (except first character), and underscores.
Returns:List of strings. Lines of output from the CLI command.
createfstore(*args, **kwargs)[source]

Create a file store.

The createfstore command creates a new fstore with the specified name for the specified storage pool and the virtual file system.

Parameters:
  • vfs – Specifies the name of the virtual file system.
  • fstore – Specifies the name of the file store to be created.
  • comment – Specifies the textual description of the fstore.
  • fpg – Specifies the name of the file provisioning group.
Returns:

List of strings. Lines of output from the CLI command.

getfstore(*args, **kwargs)[source]

Display File Store information.

The showfstore command displays information on the file stores. To specify VFS or fstore filters, the parent components must be specified.

Parameters:
  • fpg – Limit the display to virtual file servers contained within the file provisioning group.
  • vfs – Limit the display to the specified virtual file server.
  • fstore – Limit the display to the specified file store.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of fstores.
}
setfstore(*args, **kwargs)[source]

Modify a File Store.

Parameters:
  • vfs – The name of the containing Virtual File Server.
  • fstore – The name of the fstore to be modified.
  • comment – Specifies any addition textual information.
  • fpg – The name of the parent File Provisioning Group.
Returns:

List of strings. Lines of output from the CLI command.

removefstore(*args, **kwargs)[source]

Remove a File Store

The removefstore command removes a File store and its underlying
components from the system
Parameters:
  • vfs – The name of the containing Virtual File Server.
  • fstore – The name of the fstore to be removed.
  • fpg – The name of the parent File Provisioning Group.
Returns:

List of strings. Lines of output from the CLI command.

createfshare(*args, **kwargs)[source]

Create a file share.

The createfshare command creates file shares for supported protocols.

PROTOCOLS

smb
Creates an SMB file share.
nfs
Creates an NFS file share.
obj
Creates an Object file share.

OPTIONS

The following parameters are for all protocols:

fpg <fpgname> fstore <fstore> sharedir <sharedir> comment <comment>

The following options are specific to each subcommand:

smb
abe {true|false} allowip <iplist> denyip <iplist> allowperm <permlist> denyperm <permlist> cache {off|manual|optimized|auto} ca {true|false}
nfs
options <options> clientip <clientlist>
obj
ssl {true|false} urlpath <urlpath>

The file provisioning group and its underneath virtual file server must be created before creating file shares.

For SMB permissions, the same user cannot be specified with the same permission in both “allowperm” and “denyperm”.

To access an SMB share: for users configured locally, specify “LOCAL_CLUSTER<user>”, for users configured on Active Directory, specify “<domain><user>” or “<ad-netbios><user>”, for users configured on the LDAP server, specify “<ldap-netbios><user>”.

For NFS shares, it is not allowed to create two shares which have identical clients (i.e. specified by -clientip) and share directory (i.e. specified by -sharedir). If you create NFS shares without specifying different -clientip and -sharedir options, the second “createfshare” will fail.

To create Object share, the virtual file server specified by <vfs> must have an associated IP address.

Parameters:
  • protocol – The protocol {‘nfs’|’smb’|’obj’}
  • vfs – The virtual file server under which the file store, if it does not exist, and the share will be created.
  • sharename – The share name to be created.
  • fpg – Specifies the file provisioning group that <vfs> belongs. If this is not specified, the command will find out the file provisioning group based on the specified <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
  • fstore – Specifies the file store under which the share will be created. If this is not specified, the command uses the <sharename> as the file store name. The file store will be created if it does not exist.
  • sharedir – Specifies the directory path to share. It can be a full path starting from “/”, or a relative path under the file store. If this is not specified, the share created will be rooted at the file store. If option is specified, option -fstore must be specified.
  • comment – Specifies any comments or additional information for the share. The comment can be up to 255 characters long. Unprintable characters are not allowed.
  • abe – Access Based Enumeration. Specifies if users can see only the files and directories to which they have been allowed access on the shares. The default is ‘false’. Valid values are ‘true’, ‘false’ or None. The parameter is a Python string – not a boolean.
  • allowip – Specifies client IP addresses that are allowed access to the share. Use commas to separate the IP addresses. The default is “”, which allows all IP addresses (i.e. empty means all are allowed).
  • denyip – Specifies client IP addresses that are denied access to the share. Use commas to separate the IP addresses. The default is “”, which denies none of IP addresses (i.e. empty means none is denied).
  • allowperm

    Specifies the permission that a user/group is allowed to access the share. <permlist> must be specified in the format of: “<user1>:<perm1>,<user2>:<perm2>,...”. <user> can be a user or group name. <perm> must be “fullcontrol”, “read”, or “change”.

    “Everyone” is a special user for all users and groups.

    If the user is configured locally using “createfsuser”, use <user> to specify the user (for example, -allowperm user1:fullcontrol).

    If the user is configured on Active Directory, use “setfs ad” to join Active Directory domain with <domain> if it has not been done, and use “<domain><user>” or “<ad-netbios><user>” to specify the user (for example, -allowperm example.comaduser:fullcontrol). The <ad-netbios> can be found by running “showfs -ad”.

    If the user is configured on the LDAP server, use “setfs ldap” to create LDAP configuration with <ldap-netbios> if it has not been done, and use “<ldap-netbios><user>” to specify the user (for example, -allowperm ldaphostldapuser:read).

    If not specified, no default permissions will be allowed for the new shares, which sets the same default as a Windows Server 2012 R2 server would. This is to avoid a system administrator inadvertently allowing any non explicitly specified user to be able to access the SMB share.

  • denyperm

    Specifies the permission that a user/group is denied to access the share. <permlist> must be specified in the format of: “<user1>:<perm1>,<user2>:<perm2>,...”. <user> can be a user or group name. <perm> must be “fullcontrol”, “read”, or “change”.

    “Everyone” is a special user for all users and groups.

    If the user is configured locally using “createfsuser”, use <user> to specify the user (for example, -denyperm user1:fullcontrol).

    If the user is configured on Active Directory, use “setfs ad” to join Active Directory domain with <domain> if it has not been done, and use “<domain><user>” or “<ad-netbios><user>” to specify the user (for example, -denyperm example.comaduser:fullcontrol). The <ad-netbios> can be found by running “showfs -ad”.

    If the user is configured on the LDAP server, use “setfs ldap” to create LDAP configuration with <ldap-netbios> if it has not been done, and use “<ldap-netbios><user>” to specify the user (for example, -denyperm ldaphostldapuser:read).

  • cache – Specifies client-side caching for offline files. Valid values are: “off”: The client must not cache any files from this share. The share is configured to disallow caching. “manual”: The client must allow only manual caching for the files open from this share. “optimized”: The client may cache every file that it opens from this share. Also, the client may satisfy the file requests from its local cache. The share is configured to allow automatic caching of programs and documents. “auto”: The client may cache every file that it opens from this share. The share is configured to allow automatic caching of documents. If this is not specified, the default is “manual”.
  • ca – Continuous Availability. Specifies if SMB3 continuous availability features should be enabled for this share. If not specified, the default is ‘true’. Valid values are ‘true’, ‘false’ or None. The parameter is a Python string – not a boolean.
  • options

    Specifies options to use for the share to be created. Standard NFS export options except “no_subtree_check” are supported. Do not enter option “fsid”, which is provided. If not specified, the following options will be automatically set: sync, auth_nlm, wdelay, sec=sys, no_all_squash, crossmnt, secure, subtree_check, hide, root_squash, ro.

    See linux exports(5) man page for detailed information.

  • clientip – Specifies the clients that can access the share. The NFS client can be specified by the name (for example, sys1.hp.com), the name with a wildcard (for example, .hp.com), or by its IP address. Use comma to separate the IP addresses. If this is not specified, the default is “”.
  • ssl – Specifies if SSL is enabled. The default is false.
  • urlpath – Specifies the URL that clients will use to access the share. If this is not specified, the command uses <sharename> as <urlpath>.
Returns:

List of strings. Lines of output from the CLI command.

setfshare(*args, **kwargs)[source]

Set/modify file share properties.

The setfshare command modifies file share properties for supported protocols.

For setting SMB permissions, the same user cannot be specified with the same permission in both “allowperm” and “denyperm”.

PROTOCOLS

smb
Sets file share options for SMB.
nfs
Sets file share options for NFS.
obj
Sets file share options for Object.

OPTIONS

The following options are for all protocols:

fpg <fpgname> fstore <fstore> comment <comment>

The following options are specific to each protocol:

smb
-abe {true|false} -allowip [+|-]<iplist> -denyip [+|-]<iplist> -allowperm [+|-|=]<permlist> -denyperm [+|-|=]<permlist> -cache {off|manual|optimized|auto} -ca {true|false}
nfs
-options <options> -clientip [+|-]<iplist>
obj
-ssl {true|false}
Parameters:
  • protocol – The protocol {‘nfs’|’smb’|’obj’}
  • vfs – Specifies the virtual file server that the share to be modified belongs.
  • sharename – Specifies the name of the share to be modified.
  • fpg – Specifies the file provisioning group that <vfs> belongs. If this is not specified, the command will find out the file provisioning group based on the specified <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
  • fstore – Specifies the file store that the share to be modified belongs. If this is not specified, the <sharename> will be used as the file store name to identify the share.
  • comment – Specifies any comments or additional information for the share. The comment can be up to 255 characters long. Unprintable characters are not allowed.
  • abe – Access Based Enumeration. Specifies if users can see only the files and directories to which they have been allowed access on the shares.
  • allowip

    Specifies client IP addresses that are allowed access to the share. Use commas to separate the IP addresses.

    If <iplist> has a prefix (for example: +1.1.1.0,2.2.2.0):

    + add <iplist> to the existing allowed list. The IP addresses in <iplist> must not be in the existing allowed list.

    - remove <iplist> from the existing allowed list. The IP addresses in <iplist> must be already in the existing allowed list.

    If specified, the prefix will be applied to the entire <iplist>. If <iplist> has no prefix, <iplist> will be used as the new allowed list.

  • denyip

    Specifies client IP addresses that are denied access to the share. Use commas to separate the IP addresses.

    If <iplist> has a prefix (for example: +1.1.1.0,2.2.2.0):

    + add <iplist> to the existing denied list. The IP addresses in <iplist> must not be in the existing denied list.

    - remove <iplist> from the existing denied list. The IP addresses in <iplist> must already be in the existing denied list.

    If specified, the prefix will be applied to the entire <iplist>. If <iplist> has no prefix, <iplist> will be used as the new denied list.

  • allowperm

    Specifies the permissions that users/groups are allowed to access the share. <permlist> must be specified in the format of: “<user1>:<perm1>,<user2>:<perm2>,...”. The <user> can be a user or group name specified using the same format as described in createfshare. <perm> must be “fullcontrol”, “read”, or “change”.

    If <permlist> has a prefix (for example: +Everyone:read):

    + add <permlist> to the existing allowed list. Users/groups in <permlist> must not be in the existing allowed list.

    - remove <permlist> from the existing allowed list. Users/groups in <permlist> must be already in the existing allowed list.

    = modify the existing allowed list with <permlist>. Users/groups in <permlist> must be already in the existing allowed list.

    If specified, the prefix will be applied to the entire <permlist>. If <permlist> has no prefix, <permlist> will be used as the new allowed list.

  • denyperm

    Specifies the permissions that users/groups are denied to access the share. <permlist> must be specified in the format of: “<user1>:<perm1>,<user2>:<perm2>,...”. The <user> can be a user or group name specified using the same format as described in createfshare. <perm> must be “fullcontrol”, “read”, or “change”.

    If <permlist> has a prefix (for example, +Everyone:read):

    + add <permlist> to the existing denied list. Users/groups in <permlist> must not be in the existing denied list.

    - remove <permlist> from the existing denied list. Users/groups in <permlist> must be already in the existing denied list.

    = modify the existing denied list with <permlist>. Users/groups set in <permlist> must be already in the existing denied list.

    If specified, the prefix will be applied to the entire <permlist>. If <permlist> has no prefix, <permlist> will be used as the new denied list.

  • cache – Specifies client-side caching for offline files. Valid values are: “off”: The client must not cache any files from this share. The share is configured to disallow caching. “manual”: The client must allow only manual caching for the files open from this share. “optimized”: The client may cache every file that it opens from this share. Also, the client may satisfy the file requests from its local cache. The share is configured to allow automatic caching of programs and documents. “auto”: The client may cache every file that it opens from this share. The share is configured to allow automatic caching of documents.
  • ca – Continuous Availability. Specifies if SMB3 continuous availability features should be enabled for this share. If not specified, the default is ‘true’. Valid values are ‘true’, ‘false’ or None. The parameter is a Python string – not a boolean.
  • options

    Specifies the new options to use for the share. This completely overwrites the options you set previously. Standard NFS export options except “no_subtree_check” are supported. Do not enter option “fsid”, which is provided. If not specified, the following options will be automatically set: sync, auth_nlm, wdelay, sec=sys, no_all_squash, crossmnt, secure, subtree_check, hide, root_squash, ro.

    See linux exports(5) man page for detailed information on valid options.

  • clientip

    Specifies the clients that can access the share. The NFS client can be specified by the name (for example, sys1.hp.com), the name with a wildcard (for example, *.hp.com), or by its IP address. Use comma to separate the IP addresses.

    If <iplist> has a prefix (for example, +1.1.1.0,2.2.2.0):

    + add <iplist> to the existing list. IP addresses in <iplist> must not be in the existing list.

    - remove <iplist> from the existing list. IP addresses in <iplist> must be already in the existing list.

    If specified, the prefix will be applied to the entire <iplist>. If <iplist> has no prefix, <iplist> will be used as the new list.

  • ssl – Specifies to enable or disable SSL.
Returns:

List of strings. Lines of output from the CLI command.

getfshare(*args, **kwargs)[source]

Show file shares information.

The getfshare command displays file share information for supported protocols.

PROTOCOLS

smb
Displays file shares information for SMB.
nfs
Displays file shares information for NFS.
obj
Displays file shares information for Object.
Parameters:
  • protocol – The protocol {‘nfs’|’smb’|’obj’}
  • sharename – Displays only shares with names matching the specified <sharename> or one of glob-style patterns.
  • **kwargs – See below.
Kwargs:
  • fpg – Specifies the file provisioning group name. This limits the share output to those shares associated with the specified file provisioning group.
  • vfs – Specifies the virtual file server name. This limits the share output to those shares associated with the specified virtual file server. If this option is specified, but -fpg is not specified, the command will find out the file provisioning group based on <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
  • fstore – Specifies the file store name. This limits the share output to only those shares associated with the specified file store. If this is specified, option -vfs must be specified.
  • pat – Specifies the file share names using the glob-style pattern. Shares which have the name matching any of the specified glob-style patterns will be displayed. The -pat option can specify a list of patterns, and it must be used if specifier <pattern> is used.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of fshares.
}
removefshare(*args, **kwargs)[source]

Remove a file share from File Services cluster.

PROTOCOLS

smb
Removes an SMB file share.
nfs
Removes an NFS file share.
obj
Removes an Object file share.
Parameters:
  • protocol – The protocol {‘nfs’|’smb’|’obj’}
  • vfs – Specifies the virtual file server name.
  • sharename – The name of the share to be removed.
  • fpg – Specifies the file provisioning group that <vfs> belongs. If this is not specified, the command will find out the file provisioning group based on the specified <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
  • fstore – Specifies the file store that the file share to be removed belongs. If this is not specified, the <sharename> will be used as <fstore>.
Returns:

List of strings. Lines of output from the CLI command.

createfsnap(*args, **kwargs)[source]

Create a snapshot for File Services.

If option -retain is specified and the file store already has the maximum number of snapshots taken, the oldest snapshot will be deleted first before the new snapshot is created. If the command fails to create the new snapshot, the deleted snapshot will not be restored.

Parameters:
  • vfs – Specifies the name of the virtual file server.
  • fstore – Specifies the name of the file store that the snapshot will be taken. This is the path relative to <vfs>.
  • tag – Specifies the suffix to be appended to the timestamp of snapshot creation time in ISO 8601 date and time format, which will become the name of the created file store snapshot (for example: if “snapshot1” is being used as <tag>, the snapshot name will be 2013-12-17T215020_snapshot1). The name can be used as the value of option -snapname to display or remove a snapshot.
  • retain – Number of snapshots to retain with the specified tag. Snapshots exceeding the count will be deleted, oldest first. The valid range of <rcnt> is from 1 to 1024.
  • fpg – Specifies the file provisioning group that <vfs> belongs. If this is not specified, the command will find out the file provisioning group based on the specified <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
Returns:

List of strings. Lines of output from the CLI command.

getfsnap(*args, **kwargs)[source]

Show snapshot information for File Services.

Parameters:
  • snapname – Displays only snapshots with names matching the specified <snapname> or one of glob-style patterns.
  • **kwargs – See below.
Kwargs:
  • fpg – Specifies the file provisioning group name. This option limits the snapshot output to those associated snapshots with the specified file provisioning group.
  • vfs – Specifies the virtual file server name. This option limits the snapshot output to those snapshots associated with the specified virtual file server.
  • fstore – Specifies the file store name. This option limits the snapshot output to only those snapshots associated with the specified file store.
  • pat – Specifies the snapshot names using glob-style patterns. Snapshots which have the name matching any of the specified glob-style patterns will be displayed. Patterns can be repeated using a comma-separated list. The -pat option must be used if <pattern> specifier is used.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of fsnaps.
}
removefsnap(*args, **kwargs)[source]

Remove file store snapshots from File Services.

Parameters:
  • vfs – Specifies the virtual file server name.
  • fstore – Specifies the file store name.
  • snapname – Specifies the name of the snapshot to be removed. If this is not specified, all snapshots of the file store specified by <fstore> will be removed.
  • fpg – Specifies the file provisioning group that <vfs> belongs. If this is not specified, the command will find out the file provisioning group based on the specified <vfs>. However, if <vfs> exists under multiple file provisioning groups, -fpg must be specified.
Returns:

List of strings. Lines of output from the CLI command.

startfsnapclean(*args, **kwargs)[source]

Start or resume an on-demand reclamation task.

Parameters:
  • fpgname – Specifies the name of the file provisioning group.
  • resume – Specifies a paused reclamation task needs to be resumed.
  • reclaimStrategy
    Specifies the strategy to be used while
    reclaiming snap space.

    ‘maxspeed’: Suggests optimize for speedy reclamation. ‘maxspace’: Suggests optimize to reclaim maximum space.

Returns:

List of strings. Lines of output from the CLI command.

getfsnapclean(*args, **kwargs)[source]

List details of snapshot reclamation tasks.

The showfsnapclean command displays the details of an on-demand snapshot reclamation task active on a file provisioning group.

Parameters:fpgname – Specifies the name of the file provisioning group.
Returns:dict with message, total and members
result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of fsnapcleans.
}
stopfsnapclean(*args, **kwargs)[source]

Stop or pause an on-demand reclamation task.

The stopfsnapclean command stops or pauses an on-demand reclamation task on a file provisioning group.

There can be only one reclamation task running on a file provisioning group. If we pause reclamation task, it will still be counted.

If the task is not running, the following output is displayed: No reclamation task running on Storage Pool samplepool (Server error: 400)

Parameters:
  • fpgname – Specifies the name of the file provisioning group.
  • pause – Specifies to pause a reclamation task.
Returns:

List of strings. Lines of output from the CLI command.

setfsquota(*args, **kwargs)[source]

Set the quotas for a specific virtual file server.

Parameters:
  • vfsname – Specifies the name of the virtual file server associated with the quotas.
  • fpg – Specifies the name of the file provisioning group hosting the virtual file server.
  • username

    The username of the quotas to be modified.

    If the user is configured on Active Directory, use “setfs ad” to join Active Directory domain with <domain> if it has not been done, and use “<domain><uname>” or “<ad-netbios><uname>” to specify the user (for example, -username example.comduser). The “<ad-netbios>” is Active Directory NetBIOS name, which can be found by running “showfs -ad”.

    If the user is configured on the LDAP server, use “setfs ldap” to create LDAP configuration with <ldap-netbios> if it has not been done, and use “<ldap-netbios><username>” to specify the user (for example, -username ldaphostldapuser). The “<ldap-netbios>” is the LDAP server NetBIOS name, which can be found by running “showfs -ldap”.

  • groupname

    The groupname of the quotas to be modified.

    If the group is configured on Active Directory, use “setfs ad” to join Active Directory domain with <domain> if it has not been done, and use “<domain><gname>” or “<ad-netbios><uname>” to specify the user (for example, -groupname example.comdgroup). The <ad-netbios> is Active Directory NetBIOS name, which can be found by running “showfs -ad”.

    If the group is configured on the LDAP server, use “setfs ldap” to create LDAP configuration with <ldap-netbios> if it has not been done, and use “<ldap-netbios><gname>” to specify the user (for example, -groupname ldaphostldapgroup).

  • fstore – The path to the fstore to which you wish to apply quotas.
  • scapacity – An integer value in MB for the soft capacity storage quota.
  • hcapacity – An integer value in MB for the hard capacity storage quota.
  • sfile – An integer limit of the number of files for the soft file quota.
  • hfile – An integer limit of the number of files for the hard file quota.
  • clear – Clears the quotas of the specified object.
  • archive – Stores the quota information associated with the VFS in a file.
  • restore – Applies the quota information stored in the file to the VFS.
Returns:

List of strings. Lines of output from the CLI command.

getfsquota(*args, **kwargs)[source]

Show the quotas for File Services.

Parameters:
  • username – The user name of the quotas to be displayed.
  • groupname – The group name of the quotas to be displayed.
  • fstore – The file store of the quotas to be displayed.
  • vfs – Specifies the name of the virtual file server associated with the quotas.
  • fpg – Specifies the name of the file provisioning group hosting the virtual file server.
Returns:

dict with message, total and members

result = {
    'message': None,  # Error message, if any.
    'total': 0        # Number of members returned.
    'members': [],    # List containing dict of fsquotas.
}

Previous topic

exceptions – HTTP Exceptions

Next topic

http – HTTP REST Base Class

This Page