hssadmin package

Submodules

hssadmin.adminclient module

class hssadmin.adminclient.adminClient(base_url, enable_auth=True, user='sysadmin', passwd='public')[source]

Bases: object

This Class definition is to create a Python object having some methods that Cloudian HyperStore(R) Admin APIs are wrapped and properties. You need to specify the arguments in the table below to create the object using this class definition.

Arguments for initialization of this class definition
Argument name Type Mandatory/Optional Default value
base_url string Mandatory  
enable_auth bool Optional True
user string Optional sysadmin
passwd string Optional public

The adminClient object has the following methods and properties.

Methods and Properties
Type Name Category
Method user_add User Management
Method userpasswd_set User Management
Method user_delete User Management
Method user_deactivate User Management
Method user_activate User Management
Method user_list User Management
Method users_list User Management
Method s3credential_add User Management
Method s3credentials_all_list User Management
Method s3credentials_active_list User Management
Method s3credential_import User Management
Method accesskey_deactivate User Management
Method accesskey_activate User Management
Method secretkey_list User Management
Method user_ratingplan_list User Management
Method user_ratingplanid_list User Management
Method user_ratingplanid_set User Management
Method group_add Group Management
Method group_delete Group Management
Method group_deactivate Group Management
Method group_activate Group Management
Method group_list Group Management
Method groups_list Group Management
Method group_ratingplanid_list Group Management
Method group_ratingplanid_set Group Management
Method storpol_list Storage Policies
Method storpols_list Storage Policies
Method storpolid_list Storage Policies
Method storpol_status_change Storage Policies
Method storpol_usage Storage Policies
Method qos_set Quality of Service
Method qos_unset Quality of Service
Method qos_list Quality of Service
Method usagereport_list Usage Reporting
Method hss_info System Services
Method license_info System Services
Method sys_version System Services
Method node_list System Monitoring
Method node_monitoring_data System Monitoring
Method region_monitoring_data System Monitoring
Property base_url  
Property encrypted_passwd  

Note

For detailed usage of each method, refer to the section below corresponding to the method you want to know.

accesskey_activate(usr_params={}, accessKey=None)[source]

Activate an S3 access key

You can make an S3 access key “active” using this method.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
accessKey mandatory
isActive optional

Or…..

Parameters:accessKey (string) – S3 access key (default: None)
Returns:Status of the S3 access key activation operation
Return type:string
Example:accesskey_activate(accessKey=”2596b3dd92f86a466c3d”)
accesskey_deactivate(usr_params={}, accessKey=None)[source]

Deactivate an S3 access key

You can make an S3 access key “deactive” using this method.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
accessKey mandatory
isActive optional

Or…..

Parameters:accessKey (string) – S3 access key
Returns:Status of the S3 access key deactivation operation
Return type:string
Example:accesskey_deactivate(accessKey=”2596b3dd92f86a466c3d”)
base_url
encrypted_passwd
group_activate(usr_params={}, groupId=None)[source]

Activate a CMC group

You can make a CMC group’s status “active” using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
groupName optional
ldapGroup optional
active optional

Or…..

Parameters:groupId (string) – CMC group ID
Returns:Status of the CMC group activation operations
Return type:string
Example:user_activate(userId=”gzuser5”, groupId=”GROUP-Z”)
group_add(usr_params={}, file=None, groupId=None, groupName=None, ldapGroup=None, active=None)[source]

Add new CMC groups

You can add new CMC group(s) using this method. If you set the CSV filename described the GroupInfo as the “file=” argument, you can register many groups in bulk.

Sample CSV file for group batch registration

Warning

If you set the “file=” argument, all other arguments are ignored.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
groupName optional
ldapGroup optional
active optional

Or…..

Parameters:
  • file (string) – CSV file for group batch registration
  • groupId (string) – CMC group ID
  • groupName (string) – CMC group name
  • ldapGroup (string) – LDAP/AD group
  • active (bool) – status of CMC group
Returns:

Number of successes and failures of this user add operation

Return type:

string

Example:

group_add(file=’cmc_group_info.csv’)

group_deactivate(usr_params={}, groupId=None)[source]

Deactivate a CMC group

You can make a CMC group’s status “deactive” using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
groupName optional
ldapGroup optional
active optional

Or…..

Parameters:groupId (string) – CMC group ID
Returns:Status of the CMC group deactivation operations
Return type:string
Example:group_deactivate(groupId=”GROUP-Z”)
group_delete(usr_params={}, file=None, groupId=None)[source]

Delete CMC groups

You can delete existing CMC group(s) using this method.

Warning

If you set the “file=” argument, all other arguments are ignored.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory

Or…..

Parameters:
  • file (string) – CSV file for group batch registration
  • groupId (string) – CMC group ID
Returns:

Status of CMC group delete operations

Return type:

string

Example:

group_delete(groupId=”GROUP-Z”)

group_list(usr_params={}, groupId=None)[source]

List the specified CMC GroupInfo

You can list the CMC GroupInfo of a specified group using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory

Or…..

Parameters:groupId (string) – CMC group ID
Returns:GroupInfo of a CMC group
Return type:dict
Example:group_list(groupId=”GROUP-Z”)
group_ratingplanid_list(usr_params={}, groupId=None, region=None)[source]

List a rating plan ID assigned to a specified CMC group

You can list the rating plan ID which are assigned to a specified CMC group using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
region optional

Or…..

Parameters:
  • groupId (string) – CMC group ID
  • region (string) – Region name (optional)
Returns:

Rating plan ID

Return type:

string

Example:

group_ratingplanid_list({“groupId”: “GROUP-Z”})

group_ratingplanid_set(usr_params={}, groupId=None, ratingPlanId=None, region=None)[source]

Set a rating plan ID to a specified CMC group

You can set the rating plan ID to a specified CMC group using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
ratingPlanId mandatory
region optional

Or…..

Parameters:
  • groupId (string) – CMC group ID
  • ratingPlanId (string) – Rating plan ID
  • region (string) – Region name (optional)
Returns:

Status of the Rating plan ID set operation

Return type:

string

Example:

group_ratingplanid_set(groupId=”GROUP-Z”, ratingPlanId=”API-TEST-RP”)

groups_list(usr_params={})[source]

List some of the CMC GroupInfo

You can list the CMC GroupInfo of a specified group using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Returns:GroupInfo of a CMC group
Return type:list
Example:groups_list()
hss_info(usr_params={})[source]

List the your HyperStore node ID(s)

You can list the your HyperStore node ID(s) using this method.

Return values
Key Type of Value Example
version string 6.2 Compiled: 2017-07-26 15:20
nodes string [‘cloudian-node1’, ‘cloudian-node2’]
license_expiration string 2027/05/20 10:46:13
Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Returns:Version, node ID(s) and license expiration date of your HyperStore system
Return type:OrderedDict
Example:hss_info()
license_info(usr_params={})[source]

List the license information of your HyperStore system

You can list the license information of your HyperStore system using this method. The following information will be returned as a Python dictionary.

Return values
Key Type of Value Example
License Expiration Date string 2027/05/20 10:46:13
Warning Period int 8
Grace Period int 0
Maximum Net Storage int -1
Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Returns:HyperStore System License Information
Return type:dict
Example:license_info()
node_list(usr_params={}, region=None)[source]

List the your HyperStore node ID(s)

You can list the your HyperStore node ID(s) using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Parameters:region (string) – Region name (optional)
Returns:Node ID(s) of your HyperStore system
Return type:list
Example:node_list()
node_monitoring_data(usr_params={}, nodeId=None, region=None)[source]

List the monitoring data of the HyperStore node you specified

You can list the monitoring data of the HyperStore node using this method.

Note

The return value of this method is very complex and difficult to understand. This return value consists of nested Python lists and directories so I recommend that you should arrange this value using Python Programming Laungage.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
nodeId mandatory
region optional

Or…..

Parameters:
  • nodeId (string) – Node ID of your HyperStore system
  • region (string) – Region name (optional)
Returns:

Too much monitoring data

Return type:

list

Example:

node_monitoring_data(nodeId=”cloudian-node1”)

qos_list(usr_params={}, userId=None, groupId=None, region=None)[source]

List QoS limits information which is specified

You can list QoS limits information which are specified by you using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
region optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • region (string) – Region name (optional)
Returns:

Bucket names assigned the storage policy you specify

Return type:

dict

Example:

qos_list(userId=”gzuser10”, groupId=”GROUP-Z”)

qos_set(usr_params={}, qos_level=None, userId=None, groupId=None, storageQuotaKBytes='-1', storageQuotaCount='-1', wlRequestRate='-1', hlRequestRate='-1', wlDataKBytesIn='-1', hlDataKBytesIn='-1', wlDataKBytesOut='-1', hlDataKBytesOut='-1', region=None)[source]

Set QoS to user(s)/group(s)

You can set an existing QoS rule to CMC user(s)/group(s) using this method.

Warning

For the system to actually enforce QoS limits that you have assigned to usersor groups, the QoS feature must be enabled in your system configuration. By default it is disabled. To enable it log into the CMC and go toCluster → Cluster Config → Configuration Settings.

Note

Note that you can enable QoS enforcement just for storage utilization limits, or for storage utilization limits and also request traffic limits.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
storageQuotaKBytes mandatory
storageQuotaCount mandatory
wlRequestRate mandatory
hlRequestRate mandatory
wlDataKBytesIn mandatory
hlDataKBytesIn mandatory
wlDataKBytesOut mandatory
hlDataKBytesOut mandatory
region optional

Or…..

Parameters:
  • qos_level (string) – you can specify QoS level as “user”, “default-user”, “default-region-user”, “group” and “default-group”.
  • userId (string) – CMC user ID
  • groupId (string) – CMC groupId
  • storageQuotaKBytes (string) – Storage Size Quota (KB)
  • storageQuotaCount (string) – Storage Count Quota (Num. of objects)
  • wlRequestRate (string) – Warning level of number of HTTP requests per minute
  • hlRequestRate (string) – Maximum allowed number of HTTP requests per minute
  • wlDataKBytesIn (string) – Warning level for number of uploaded kilobytes per minute
  • hlDataKBytesIn (string) – Maximum allowed number of uploaded kilobytes per minute
  • wlDataKBytesOut (string) – Warning level for number of downloaded kilobytes per minute
  • hlDataKBytesOut (string) – Maximum allowed number of downloaded kilobytes per minute
  • region (string) – Region name (optional)
Returns:

Status of the QoS limit set operation

Return type:

string

Example:

qos_set(qos_level=”user”, userId=”gzuser10”, groupId=”GROUP-Z”, storageQuotaKBytes=”1024000000000”)

qos_unset(usr_params={}, userId=None, groupId=None, region=None)[source]

Unset QoS to user(s)/group(s)

You can unset a QoS rule from CMC user(s)/group(s) using this method.

Note

The default QoS will be set to the user(s)/group(s) after you unset the specified custom QoS.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
region optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC groupId
  • region (string) – Region name (optional)
Returns:

Status of the QoS limit unset operation

Return type:

string

Example:

qos_unset(userId=”gzuser10”, groupId=”GROUP-Z”)

region_monitoring_data(usr_params={}, region=None)[source]

List the monitoring and perfomance data within the region you specified

You can list the monitoring and perfomance data within the region using this method. You can see the following data in the return value.

Return values
Key Description
status High-level service status for the system as a whole
s3GetTPS Across the whole service region, the number of S3 GET transactions processed per second
s3PutTPS Across the whole service region, the number of S3 PUT transactions processed per second
s3GetThruput Across the whole service region, the data throughput for S3 GET transactions, expressed as MB per second
s3PutThruput Across the whole service region, the data throughput for S3 PUT transactions, expressed as MB per second
s3GetLatency Across the whole service region, the average latency for completing S3 GET transactions, in milliseconds
s3PutLatency Across the whole service region, the average latency for completing S3 PUT transactions, in milliseconds
diskAvailKb Across the whole service region, the total mounted disk space remaining still available for Cassandra data directory or HyperStore data directory storage
diskTotalKb Across the whole service region, the total size of the disks mounted for Cassandra data directories or HyperStore data directories (the HyperStore File System [HSFS] and erasure coding file system)
nodeStatuses List of NodeStatus objects, one for each node in the service region
Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Parameters:region (string) – Region name (optional)
Returns:Monitoring and perfomance data
Return type:list
Example:region_monitoring_data()
s3credential_add(usr_params={}, userId=None, groupId=None)[source]

Add a new S3 credential to the specified CMC user

You can add a new S3 credential to a specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
Returns:

Status of the S3 credential add operation

Return type:

string

Example:

s3credential_add(userId=”gzuser1”, groupId=”GROUP-Z”)

s3credential_import(usr_params={}, userId=None, groupId=None, accessKey=None, secretKey=None)[source]

import an S3 credential into the specified CMC user

You can import an S3 credential into the specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
accessKey mandatory
secretKey mandatory

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • accessKey (string) – S3 access key
  • secretKey (string) – S3 secret Key
Returns:

Status of the S3 credential import operation

Return type:

string

Example:

s3credential_import(userId=”gzuser8”, groupId=”GROUP-Z”, accessKey=”2596b3dd92f86a466c3d”, secretKey=”Pmy4HPi9uF5FSlABturX/o6HiB0U5n74Mivy/VFu”)

s3credentials_active_list(usr_params={}, userId=None, groupId=None)[source]

List active S3 credentials of the specified CMC user

You can list active S3 credentials of the specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
Returns:

Only active S3 credentials information of a CMC user

Return type:

list

Example:

s3credentials_active_list(userId=”gzuser8”, groupId=”GROUP-Z”)

s3credentials_all_list(usr_params={}, userId=None, groupId=None)[source]

List all S3 credentials of the specified CMC user

You can list all S3 credentials of the specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
Returns:

S3 credentials information of a CMC user

Return type:

list

Example:

s3credentials_all_list(userId=”gzuser1”, groupId=”GROUP-Z”)

secretkey_list(usr_params={}, accessKey=None)[source]

List a S3 secret key

You can list the secret key corresponding to the access key you specified using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
accessKey mandatory

Or…..

Parameters:accessKey (string) – S3 access key
Returns:S3 secret key
Return type:string
Example:secretkey_list(accessKey=”2596b3dd92f86a466c3d”)
storpol_list(usr_params={}, policyId=None)[source]

List storage policy information specified the Policy ID

You can list the detailed information of a storage policy which is specified the policy ID using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
policyId mandatory

Or…..

Parameters:policyId (string) – Storage policy ID
Returns:Storage policy information which is specified tht policy ID
Return type:dict
Example:storpol_list({“policyId”: “0f7a4ca96ee157b6dc8cba7d1308a7bb”})
storpol_status_change(usr_params={}, policyName=None, change_to='enable')[source]

Change the status of a storage policy

You can change the status of a storage policy from enable/disable to disable/enable using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
policyName mandatory
change_to optional

Or…..

Parameters:
  • policyName (string) – Storage policy name
  • change_to (string) – Status to be changed from current status (default: enable)
Returns:

Status of the storage policy status change operation

Return type:

string

Example:

storpol_status_change(policyName=”sp-api-test”, change_to=”enable”)

storpol_usage(usr_params={}, policyName=None, bucketName=None)[source]

List buckets which are assigned a specified storage policy

You can list buckets which are assigned a storage policy you specify using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Parameters:
  • policyName (string) – Storage policy name
  • bucketName (string) – Bucket name if you want to specify a bucket
Returns:

Bucket names assigned the storage policy you specify

Return type:

list

Example:

storpol_usage(policyName=”2replicas”)

storpolid_list(usr_params={}, policyName=None)[source]

List a storage policy ID corresponding to a policy name you specified

You can list a storage policy ID which is specified by “Policy Name” using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
policyName mandatory

Or…..

Parameters:policyName (string) – Storage policy name
Returns:Storage policy ID
Return type:string
Example:storpolid_list(policyName=”sp-api-test”)
storpols_list(usr_params={})[source]

List all storage policy information

You can list the detailed information of a storage policy which is specified the policy ID using this method.

Note

There are no mandatory arguments for this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
region optional
groupId optional
status optional

Or…..

Returns:All storage policy information
Return type:list
Example:storpols_list()
sys_version(usr_params={})[source]

List the version information of your HyperStore system

You can list the version information of your HyperStore system using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

No needed any parameters in usr_params for this method.

Returns:HyperStore Version Information
Return type:string
Example:sys_version()
usagereport_list(usr_params={}, userId=None, groupId=None, operation=None, startTime=None, endTime=None, granularity='raw', reversed=False, limit=100000, pageSize=0, offset=0, region=None, regionOffset=None)[source]

List usage report

You can list the usage report of the user(s)/group(s) using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
id mandatory
operation mandatory
startTime mandatory
endTime mandatory
granularity mandatory
reversed mandatory
limit optional
pageSize optional
offset optional
region optional
regionOffset optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC groupId
  • operation (string) – Type of operations (SB/SO/HG/HP/HD)
  • startTime (string) – Start date of usage report (YYYYMMDDhhmm)
  • endTime (string) – End date of usage report (YYYYMMDDhhmm)
  • granularity (string) – raw/hour/day/month (default: raw)
  • reversed (bool) – (default: False)
  • limit (string) – Maximum number of results to return (default: 100000)
  • pageSize (string) – (default: 0)
  • offset (string) – (default: 0)
  • region (string) – Region name
  • regionOffset (string) – This argument to specify the region name of your local region
Returns:

Usage report

Return type:

dict

Example:

usagereport_list(usage_report_params)

user_activate(usr_params={}, userId=None, groupId=None, userType='User')[source]

Activate a CMC user

You can make a CMC user’s status “active” using this method.

Note

By default, you can activate the CMC users with “User” type only. If you want to activate different types of user, set the “userType=” argument.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
userType mandatory
fullName optional
emailAddr optional
address1 optional
address2 optional
city optional
state optional
zip optional
country optional
phone optional
groupId mandatory
website optional
active optional
canonicalUserId optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • userType (string) – CMC user type (default: User)
Returns:

Status of the CMC user activation operations

Return type:

string

Example:

user_activate(userId=”gzuser5”, groupId=”GROUP-Z”)

user_add(usr_params={}, file=None)[source]

Add new CMC users

You can add new CMC user(s) using this method. If you set the CSV filename described the UserInfo as the “file=” argument, you can register many users in bulk.

Sample CSV file for user batch registration

Warning

If you set the “file=” argument, all other arguments are ignored.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
userType mandatory
fullName optional
emailAddr optional
address1 optional
address2 optional
city optional
state optional
zip optional
country optional
phone optional
groupId mandatory
website optional
active optional
canonicalUserId optional

Or…..

Parameters:file (string) – CSV file for user batch registration
Returns:Number of successes and failures of this user add operation
Return type:string
Example:user_add(file=’cmc_user_info.csv’)
user_deactivate(usr_params={}, userId=None, groupId=None, userType='User')[source]

Deactivate a CMC user

You can make a CMC user’s status “deactive” using this method.

Note

By default, you can deactivate the CMC users with “User” type only. If you want to deactivate different types of user, set the “userType=” argument.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
userType mandatory
fullName optional
emailAddr optional
address1 optional
address2 optional
city optional
state optional
zip optional
country optional
phone optional
groupId mandatory
website optional
active optional
canonicalUserId optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • userType (string) – CMC user type (default: User)
Returns:

Status of the CMC user deactivation operations

Return type:

string

Example:

user_deactivate(userId=”gzuser5”, groupId=”GROUP-Z”)

user_delete(usr_params={}, file=None, userId=None, groupId=None, deactive_only=True)[source]

Delete CMC users

You can delete existing CMC user(s) using this method.

Note

By default, this function deletes the “deactive” CMC users only. If you want to delete “active” CMC users, please set the “deactive_only” parameter to “False”.

Warning

If you set the “file=” argument, all other arguments are ignored.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory

Or…..

Parameters:
  • file (string) – CSV file for user batch registration
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • deactive_only (boolean) – whether or not to be deleted deactivated users only (default: True)
Returns:

Status of CMC user delete operations

Return type:

string

Example:

user_delete(userId=”gzuser4”, groupId=”GROUP-Z”)

user_list(usr_params={}, userId=None, groupId=None)[source]

List the specified CMC UserInfo

You can list the CMC UserInfo of a specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
userType mandatory

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
Returns:

UserInfo of a CMC user

Return type:

dict

Example:

user_list(userId=”gzuser5”, groupId=”GROUP-Z”)

user_ratingplan_list(usr_params={}, userId=None, groupId=None, region=None)[source]

List rating plans for users

You can list rating plans for users using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
region optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • region (string) – Region name (optional)
Returns:

S3 rating plans for users

Return type:

dict

Example:

user_ratingplan_list(userId=”gzuser5”, groupId=”GROUP-Z”)

user_ratingplanid_list(usr_params={}, userId=None, groupId=None, region=None)[source]

List a rating plan ID assigned to the specified user

You can list a rating plan ID to be assigned to the specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
region optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • region (string) – Region name (optional)
Returns:

S3 rating plan ID

Return type:

string

Example:

user_ratingplanid_list(userId=”gzuser5”, groupId=”GROUP-Z”)

user_ratingplanid_set(usr_params={}, userId=None, groupId=None, ratingPlanId=None, region=None)[source]

Set a rating plan ID to the specified user

You can set a rating plan ID to the specified user using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
ratingPlanId mandatory
region optional

Or…..

Parameters:
  • userId (string) – CMC user ID
  • groupId (string) – CMC group ID
  • ratingPlanId (string) – Rating Plan ID
  • region (string) – Region name (optional)
Returns:

Status of the rating plan id set operation

Return type:

string

Example:

user_ratingplanid_set(userId=”gzuser13”, groupId=”GROUP-Z”, ratingPlanId=”API-TEST-RP”)

userpasswd_set(usr_params={}, file=None)[source]

Set password to a CMC user

You can set password to CMC user(s) using this method. If you set the CSV filename described the UserInfo as the “file=” argument, you can set password to many users in bulk.

Warning

If you set the “file=” argument, all other arguments are ignored.

Parameters:usr_params (dict) – Python dictionary to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
userId mandatory
groupId mandatory
password mandatory

Or…..

Parameters:file (string) – CSV file for user batch registration
Returns:Status of the CMC user password set operations
Return type:string
Example:userpasswd_set(file=’cmc_user_info.csv’)
users_list(usr_params={}, groupId=None, userType='all', userStatus='active', prefix=None, limit=None, offset=None)[source]

List some of the CMC UserInfo specified CMC group

You can list the CMC UserInfo of a specified group using this method.

Parameters:usr_params (dict) – Python directory to be set necessary parameters

Note

You must set some mandatory keys in the following table into usr_params.

Parameters of usr_params
Key Mandatory/Optional
groupId mandatory
userType mandatory
userStatus mandatory
prefix optional
limit optional
offset optional

Or…..

Parameters:
  • groupId (string) – CMC group ID
  • userType (string) – CMC user type (default: all)
  • userStatus (string) – CMC user status (default: active)
  • prefix (string) – Prefix (optional)
  • limit (string) – Limit (optional)
  • offset (string) – Offset (optional)
Returns:

UserInfo of a CMC users belonging to a group

Return type:

list

Example:

users_list(groupId=”GROUP-Z”, userStatus=”inactive”)

hssadmin.admincore module

class hssadmin.admincore.APIParameters[source]

Bases: object

This module defines a number of parameters that are used to judge the mandatory or optional argument for Cloudian HyperStore(R) Admin APIs.

p_accesskey_status = {'isActive': 'optional', 'accessKey': 'mandatory'}
p_billingreport_info = {'userId': 'optional', 'billingPeriod': 'mandatory', 'groupId': 'mandatory'}
p_group_info = {'active': 'optional', 'groupName': 'optional', 'ldapGroup': 'optional', 'groupId': 'mandatory'}
p_group_ratingplan_info = {'region': 'optional', 'groupId': 'mandatory'}
p_group_ratingplanid_info = {'region': 'optional', 'ratingPlanId': 'mandatory', 'groupId': 'mandatory'}
p_qos_info = {'region': 'optional', 'userId': 'mandatory', 'groupId': 'mandatory'}
p_qos_set = {'hlRequestRate': 'mandatory', 'region': 'optional', 'userId': 'mandatory', 'hlDataKBytesOut': 'mandatory', 'wlDataKBytesOut': 'mandatory', 'hlDataKBytesIn': 'mandatory', 'storageQuotaCount': 'mandatory', 'wlDataKBytesIn': 'mandatory', 'wlRequestRate': 'mandatory', 'storageQuotaKBytes': 'mandatory', 'groupId': 'mandatory'}
p_s3cred_add = {'userId': 'mandatory', 'groupId': 'mandatory'}
p_s3cred_imp = {'userId': 'mandatory', 'accessKey': 'mandatory', 'groupId': 'mandatory', 'secretKey': 'mandatory'}
p_s3creds_list = {'userId': 'mandatory', 'groupId': 'mandatory'}
p_secretkey_list = {'accessKey': 'mandatory'}
p_storpol_list = {'policyId': 'mandatory'}
p_storpol_status_change = {'policyId': 'mandatory'}
p_storpols_list = {'region': 'optional', 'status': 'optional', 'groupId': 'optional'}
p_usagereport_info = {'region': 'optional', 'granularity': 'mandatory', 'regionOffset': 'optional', 'reversed': 'mandatory', 'startTime': 'mandatory', 'limit': 'optional', 'id': 'mandatory', 'offset': 'optional', 'endTime': 'mandatory', 'pageSize': 'optional', 'operation': 'mandatory'}
p_user_delete = {'userId': 'mandatory', 'groupId': 'mandatory'}
p_user_info = {'emailAddr': 'optional', 'userId': 'mandatory', 'userType': 'mandatory', 'state': 'optional', 'active': 'optional', 'address2': 'optional', 'address1': 'optional', 'groupId': 'mandatory', 'website': 'optional', 'country': 'optional', 'canonicalUserId': 'optional', 'city': 'optional', 'fullName': 'optional', 'zip': 'optional', 'phone': 'optional'}
p_user_list = {'userId': 'mandatory', 'groupId': 'mandatory'}
p_user_ratingplan_info = {'region': 'optional', 'userId': 'mandatory', 'groupId': 'mandatory'}
p_user_ratingplanid_info = {'region': 'optional', 'userId': 'mandatory', 'ratingPlanId': 'mandatory', 'groupId': 'mandatory'}
p_userpasswd_set = {'userId': 'mandatory', 'groupId': 'mandatory', 'password': 'mandatory'}
p_users_list = {'limit': 'optional', 'userType': 'mandatory', 'groupId': 'mandatory', 'offset': 'optional', 'prefix': 'optional', 'userStatus': 'mandatory'}

Module contents

Cloudian HyperStore Admin API SDK for Python

copyright:
  1. 2017 by Ryosuke Matsui (Cloudian K.K.).
license:

MIT, see LICENSE for more details.